summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
commit3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (patch)
tree197c810e5f5bce17b1233a7cb8d7b50c0bcd25e2 /TAO/orbsvcs/tests
parent6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (diff)
downloadATCD-3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c.tar.gz
Repo restructuring
Diffstat (limited to 'TAO/orbsvcs/tests')
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/AVS_Asynch_Three_Stage.mpc30
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.cpp663
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.h152
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Makefile.am123
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/README85
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.cpp308
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.h159
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer_addr_file2
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.cpp277
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.h124
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver_addr_file1
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl244
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp359
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h108
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender_addr_file1
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/AVS_Bidirectional_Flows.mpc19
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/README45
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.cpp359
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.h146
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl71
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.cpp518
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.h150
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/AVS_Component_Switching.mpc30
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.cpp645
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.h143
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/Makefile.am126
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/README66
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf8
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.cpp512
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.h233
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.cpp376
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.h154
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl164
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.cpp522
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.h166
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Full_Profile/AVS_Full_Profile.mpc19
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Full_Profile/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Full_Profile/README54
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp399
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.h89
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl118
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp270
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Full_Profile/server.h66
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/AVS_Latency.mpc27
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/Makefile.am121
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/README9
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/control.cpp184
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/ping.cpp347
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/ping.h77
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/pong.cpp360
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/pong.h83
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Latency/run_test.pl61
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/svc.conf5
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Latency/svc.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Makefile.am26
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Modify_QoS/AVS_Modify_QoS.mpc19
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Modify_QoS/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Modify_QoS/README52
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.cpp335
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.h90
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl71
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.cpp444
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.h125
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/AVS_Multicast.mpc19
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/Makefile.am88
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/README37
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf8
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf.xml10
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp394
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h101
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl90
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp244
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast/server.h52
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/AVS_Multicast_Full_Profile.mpc19
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/README38
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp431
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.h88
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl87
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp291
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.h70
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multiple_Flows/AVS_Multiple_Flows.mpc19
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multiple_Flows/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multiple_Flows/README57
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.cpp306
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.h144
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl71
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.cpp439
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.h123
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable/AVS_Pluggable.mpc19
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable/README45
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp489
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h173
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl123
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp232
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable/server.h94
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/AVS_Pluggable_Flow_Protocol.mpc28
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/Makefile.am109
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/README47
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.cpp241
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.h61
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/export.h40
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.cpp261
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.h100
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl71
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.cpp417
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.h117
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf5
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf.xml15
-rw-r--r--TAO/orbsvcs/tests/AVStreams/README28
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/AVS_Simple_Three_Stage.mpc27
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/Makefile.am117
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/README56
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.cpp377
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.h171
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.cpp257
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.h100
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp393
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h113
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/AVS_Simple_Two_Stage.mpc20
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Makefile.am90
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README60
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.cpp81
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.h88
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.inl59
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.cpp326
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.h110
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl124
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp505
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h135
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/AVS_Simple_Two_Stage_With_QoS.mpc17
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README57
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.cpp262
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.h104
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl122
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp576
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h134
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/README.uav14
-rw-r--r--TAO/orbsvcs/tests/BiDir_CORBALOC/BiDirCORBALOC.mpc10
-rw-r--r--TAO/orbsvcs/tests/BiDir_CORBALOC/Makefile.am88
-rw-r--r--TAO/orbsvcs/tests/BiDir_CORBALOC/README14
-rw-r--r--TAO/orbsvcs/tests/BiDir_CORBALOC/TimeModule.idl18
-rw-r--r--TAO/orbsvcs/tests/BiDir_CORBALOC/TimeServer.cpp174
-rwxr-xr-xTAO/orbsvcs/tests/BiDir_CORBALOC/run_test.pl59
-rw-r--r--TAO/orbsvcs/tests/Bug_1334_Regression/Makefile.am43
-rw-r--r--TAO/orbsvcs/tests/Bug_1334_Regression/README5
-rw-r--r--TAO/orbsvcs/tests/Bug_1334_Regression/client.cpp44
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1334_Regression/run_test.pl101
-rw-r--r--TAO/orbsvcs/tests/Bug_1334_Regression/test.mpc9
-rw-r--r--TAO/orbsvcs/tests/Bug_1393_Regression/Bug_1393_Regression.mpc12
-rw-r--r--TAO/orbsvcs/tests/Bug_1393_Regression/Makefile.am41
-rw-r--r--TAO/orbsvcs/tests/Bug_1393_Regression/README3
-rw-r--r--TAO/orbsvcs/tests/Bug_1393_Regression/client.cpp64
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl110
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/Bug_1395_Regression.mpc37
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/Makefile.am98
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/README3
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/Test.idl7
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp86
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.h34
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/client.cpp89
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl195
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/server.cpp120
-rw-r--r--TAO/orbsvcs/tests/Bug_1436_Regression/README5
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl89
-rw-r--r--TAO/orbsvcs/tests/Bug_1436_Regression/test.idl7
-rw-r--r--TAO/orbsvcs/tests/Bug_1437_Regression/README5
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl107
-rw-r--r--TAO/orbsvcs/tests/Bug_1630_Regression/Makefile.am46
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1630_Regression/run_test.pl60
-rw-r--r--TAO/orbsvcs/tests/Bug_1630_Regression/test.mpc10
-rw-r--r--TAO/orbsvcs/tests/Bug_1630_Regression/testclient.cpp240
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc10
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/Makefile.am57
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp64
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h25
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl27
-rw-r--r--TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp22
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/Bug_2137_Regression.mpc8
-rw-r--r--TAO/orbsvcs/tests/Bug_2137_Regression/Makefile.am65
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/README15
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/client.cpp312
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep1.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v1.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v2.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g2_v1.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep1_d2_g1_v1.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep2.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v1.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v2.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g2_v1.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/ep2_d2_g1_v1.ior1
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2137_Regression/run_test.pl34
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/Bug_2247_Regression.mpc32
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/Client_i.h29
-rw-r--r--TAO/orbsvcs/tests/Bug_2247_Regression/Makefile.am136
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/Manager.cpp629
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/Manager.h50
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/README31
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/run_test.pl142
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/server.cpp136
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/test.idl10
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/test_i.cpp71
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2247_Regression/test_i.h38
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/Bug_2248_Regression.mpc43
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/Client_i.h39
-rw-r--r--TAO/orbsvcs/tests/Bug_2248_Regression/Makefile.am180
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/README14
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.cpp56
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.h75
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.cpp136
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.h109
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/client.cpp520
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/client.h57
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/run_test.pl57
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/server.cpp178
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/test.idl8
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/test_i.cpp71
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/test_i.h38
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2248_Regression/tests.idl13
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/Bug_2285_Regression.mpc67
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/Hello.cpp74
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/Hello.h63
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/Makefile.am252
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/README96
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.cpp52
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.h51
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.cpp52
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.h51
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.cpp145
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.h91
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.cpp240
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.h96
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/Test.idl43
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/client.cpp137
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp215
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2285_Regression/run_test.pl49
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2285_Regression/run_test2.pl70
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/server.cpp241
-rw-r--r--TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp175
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/Bug_2287_Regression.mpc39
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/Hello.cpp32
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/Hello.h45
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/Makefile.am153
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/README32
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.cpp52
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.h51
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.cpp176
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.h98
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/Test.idl24
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/client.cpp110
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2287_Regression/run_test.pl49
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp243
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/Bug_2316_Regression.mpc36
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/Makefile.am130
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/README26
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/Test.idl12
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.cpp19
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.h19
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/client.cpp55
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2316_Regression/run_test.pl42
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/server.cpp38
-rw-r--r--TAO/orbsvcs/tests/Bug_2316_Regression/svc.conf4
-rw-r--r--TAO/orbsvcs/tests/Bug_2377_Regression/Bug_2377_Regression.mpc9
-rw-r--r--TAO/orbsvcs/tests/Bug_2377_Regression/Hello.cpp340
-rw-r--r--TAO/orbsvcs/tests/Bug_2377_Regression/Hello.idl9
-rw-r--r--TAO/orbsvcs/tests/Bug_2377_Regression/Makefile.am97
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2377_Regression/run_test.pl32
-rw-r--r--TAO/orbsvcs/tests/Bug_2377_Regression/svc.conf5
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_client.cpp475
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_client.h142
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_command.cpp684
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_command.h475
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_command.l58
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_command.tab.cpp1071
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_command.tab.h32
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_command.y126
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_naming_service.cpp185
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_naming_service.h86
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_test_utils.cpp73
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_test_utils.h37
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_tests.cpp388
-rw-r--r--TAO/orbsvcs/tests/Concurrency/CC_tests.h183
-rw-r--r--TAO/orbsvcs/tests/Concurrency/Concurrency.mpc6
-rw-r--r--TAO/orbsvcs/tests/Concurrency/Makefile.am59
-rw-r--r--TAO/orbsvcs/tests/Concurrency/README111
-rw-r--r--TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp1702
-rw-r--r--TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp.diff209
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.basic21
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.dinphil12
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.e12
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.extended4
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.phil16
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.phil26
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.phil36
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.phil46
-rw-r--r--TAO/orbsvcs/tests/Concurrency/test.phil56
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/CosEvent_Basic.mpc45
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/Disconnect.cpp204
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.cpp236
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.h49
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/Makefile.am286
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/Pull_Push_Event.cpp232
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/Push_Event.cpp196
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/Random.cpp514
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/Random.h184
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/Shutdown.cpp181
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/basiceventtestexe.mpb13
-rwxr-xr-xTAO/orbsvcs/tests/CosEvent/Basic/run_test.pl60
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf2
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Makefile.am14
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Timeout/README40
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.cpp78
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.h46
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Timeout/Timeout.mpc4
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp177
-rw-r--r--TAO/orbsvcs/tests/CosEvent/Timeout/cosevent.conf3
-rwxr-xr-xTAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl66
-rw-r--r--TAO/orbsvcs/tests/CosEvent/lib/CosEvent_lib.mpc10
-rw-r--r--TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.cpp292
-rw-r--r--TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.h155
-rw-r--r--TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.cpp257
-rw-r--r--TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.h143
-rw-r--r--TAO/orbsvcs/tests/CosEvent/lib/Makefile.am50
-rw-r--r--TAO/orbsvcs/tests/CosEvent/lib/cectest_export.h40
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp445
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.h120
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.cpp53
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.h43
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp529
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.h145
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/EC_Custom_Marshal.mpc39
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/Makefile.am147
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/README19
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/data.idl21
-rwxr-xr-xTAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl74
-rw-r--r--TAO/orbsvcs/tests/EC_Custom_Marshal/svc.conf4
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp22
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h40
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.cpp105
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.h51
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/EC_MT_Mcast.mpc6
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp424
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/Makefile.am65
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/README13
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.cpp95
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.h49
-rwxr-xr-xTAO/orbsvcs/tests/EC_MT_Mcast/run_test.pl54
-rw-r--r--TAO/orbsvcs/tests/EC_MT_Mcast/svc.conf5
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp1159
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h526
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.i120
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.mpc6
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/Makefile.am60
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/README21
-rwxr-xr-xTAO/orbsvcs/tests/EC_Mcast/run_test.pl53
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/sample.cfg116
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/svc.conf2
-rw-r--r--TAO/orbsvcs/tests/EC_Mcast/svc.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp1612
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h387
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.mpc6
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/Makefile.am66
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/README34
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime1.h162
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime2.h160
-rw-r--r--TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime_Dynamic.h1032
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/dyn_plot77
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/gen_dynamic68
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/gen_latency90
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/gen_overhead114
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/gen_throughput43
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/gen_utilization80
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/histo.pl76
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/run_dynamic59
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/run_latency50
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/run_overhead113
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/run_schedule43
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/run_test.pl44
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/run_throughput35
-rwxr-xr-xTAO/orbsvcs/tests/EC_Multiple/run_utilization55
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp183
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.h96
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp377
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.h97
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.cpp10
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.h43
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Scheduler_Info.h80
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp260
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.h101
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp406
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.h92
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp639
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.h134
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/EC_Throughput.mpc34
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/Makefile.am151
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/README49
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ec.conf3
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ec.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf4
-rw-r--r--TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf.xml8
-rwxr-xr-xTAO/orbsvcs/tests/EC_Throughput/run_test.pl110
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.cpp317
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.h58
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/BCast.cpp157
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/BCast.h85
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Bitmask.cpp254
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Complex.cpp238
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Control.cpp205
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Control.h50
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Disconnect.cpp223
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Event_Basic.mpc93
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Gateway.cpp359
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp254
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.h45
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Makefile.am680
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Negation.cpp214
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Observer.cpp415
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Observer.h120
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/README43
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Random.cpp578
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Random.h183
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Reconnect.cpp242
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Reconnect.h75
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Schedule.cpp215
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Schedule.h85
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Shutdown.cpp89
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Shutdown.h59
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Timeout.cpp205
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp319
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/control.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/control.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl60
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/mt.svc.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/mt.svc.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/observer.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/observer.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/rteventtestexe.mpb13
-rwxr-xr-xTAO/orbsvcs/tests/Event/Basic/run_test.pl101
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/sched.conf3
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/sched.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/svc.complex.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/svc.complex.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/svc.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Basic/svc.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Makefile.am16
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_export.h40
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_lib.mpc7
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp163
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h97
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp162
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h50
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Common/Makefile.am51
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/Complex.mpc53
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/Constants.h9
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/Makefile.am141
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/README55
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/consumer-ec.conf3
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp229
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/gateway-ec.cpp13
-rwxr-xr-xTAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl215
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/supplier-ec.conf3
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Complex/supplier.cpp120
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Makefile.am16
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumerMain.cpp109
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp54
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.h29
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp245
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.cpp26
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.h24
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/README138
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc25
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.cpp18
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.h25
-rwxr-xr-xTAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl142
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/supplier.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/Constants.h6
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/Makefile.am141
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/README62
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/Simple.mpc53
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/consumer-ec.conf4
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp195
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/gateway-ec.cpp15
-rwxr-xr-xTAO/orbsvcs/tests/Event/Mcast/Simple/run_test.pl235
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/supplier-ec.conf32
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/supplier.cpp107
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/udp-consumer-ec.conf4
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Simple/udp-supplier-ec.conf32
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Two_Way/Constants.h7
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Two_Way/Makefile.am102
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Two_Way/README57
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Two_Way/Two_Way.mpc36
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp666
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway-ec.cpp14
-rw-r--r--TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway.conf3
-rwxr-xr-xTAO/orbsvcs/tests/Event/Mcast/Two_Way/run_test.pl205
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Connect.cpp400
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Connect.h133
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Event_Performance.mpc38
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Inversion.cpp176
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Inversion.h60
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Latency.cpp421
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Latency.h100
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Latency_Server.cpp180
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Makefile.am229
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/README50
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Throughput.cpp61
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/Throughput.h56
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.list.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.list.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.mt.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.mt.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.st.conf2
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/ec.st.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/eventperftestexe.mpb13
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/latency.conf4
-rw-r--r--TAO/orbsvcs/tests/Event/Performance/latency.conf.xml8
-rwxr-xr-xTAO/orbsvcs/tests/Event/Performance/run_test.pl65
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Consumer.cpp167
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Consumer.h121
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Counting_Consumer.cpp116
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Counting_Consumer.h72
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Counting_Supplier.cpp225
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Counting_Supplier.h129
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Driver.cpp1027
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Driver.h329
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Driver.i7
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Event_lib.mpc10
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Makefile.am58
-rw-r--r--TAO/orbsvcs/tests/Event/lib/README5
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Supplier.cpp298
-rw-r--r--TAO/orbsvcs/tests/Event/lib/Supplier.h193
-rw-r--r--TAO/orbsvcs/tests/Event/lib/ectest_export.h40
-rw-r--r--TAO/orbsvcs/tests/FT_App/FTAPP_Analyzer_Main.cpp22
-rw-r--r--TAO/orbsvcs/tests/FT_App/FTAPP_FactoryRegistry_Main.cpp22
-rw-r--r--TAO/orbsvcs/tests/FT_App/FTAPP_FaultConsumer_Main.cpp23
-rw-r--r--TAO/orbsvcs/tests/FT_App/FTAPP_Notifier_Main.cpp23
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_App.mpc153
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_Client.cpp647
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_Creator.cpp290
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_Creator.h117
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_Replica.cpp22
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.cpp773
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h294
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/FT_ReplicationManagerController.cpp200
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_TestReplica.idl117
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp484
-rw-r--r--TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.h219
-rw-r--r--TAO/orbsvcs/tests/FT_App/Makefile.am489
-rw-r--r--TAO/orbsvcs/tests/FT_App/README88
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.cpp379
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.h151
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubBatchConsumer.cpp172
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubBatchConsumer.h153
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.cpp272
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.h133
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubFaultConsumer.cpp311
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubFaultConsumer.h152
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubFaultNotifier.cpp485
-rw-r--r--TAO/orbsvcs/tests/FT_App/StubFaultNotifier.h188
-rw-r--r--TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.cpp470
-rw-r--r--TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.h110
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/replica.cmd9
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_basic.pl107
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_demo.pl433
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_detector.pl221
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl270
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_notifier.pl248
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_registry.pl438
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_rmnotifier.pl319
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_rmregistry.pl385
-rw-r--r--TAO/orbsvcs/tests/FT_App/testscript10
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/GroupRef_Manipulation.mpc36
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Makefile.am156
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/README21
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.cpp59
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.h78
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp214
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h125
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp134
-rwxr-xr-xTAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/run_test.pl36
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/server.cpp280
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl30
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.cpp35
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.h53
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/Client_i.h45
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/FaultTolerance_IOGR.mpc31
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/Makefile.am150
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.cpp404
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.h66
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/README20
-rwxr-xr-xTAO/orbsvcs/tests/FaultTolerance/IOGR/run_test.pl61
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/server.cpp106
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/svc.conf.xml7
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/test.idl9
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.cpp38
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.h47
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/FaultTolerance_IOGRManipulation.mpc6
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp229
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/Makefile.am67
-rwxr-xr-xTAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/run_test.pl21
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/Makefile.am15
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/FtRtEvent.mpc28
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/Makefile.am128
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp56
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h42
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/PushSupplier.cpp146
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/PushSupplier.h61
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/consumer.cpp150
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/supplier.cpp142
-rw-r--r--TAO/orbsvcs/tests/FtRtEvent/svc.conf5
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/HTIOP_AMI.mpc50
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/Makefile.am165
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/README39
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/Test_Output.cpp230
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/ami_test.idl40
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.cpp86
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.h60
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/client.cpp339
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/exclusive.conf9
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/muxed.conf9
-rwxr-xr-xTAO/orbsvcs/tests/HTIOP/AMI/run_test.pl60
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/server.conf8
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/server.cpp144
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/simple_client.cpp320
-rw-r--r--TAO/orbsvcs/tests/HTIOP/AMI/svc.conf6
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/HTIOP_BiDirectional.mpc35
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/Makefile.am114
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/Test_Output.cpp230
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/client.cpp168
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/inside.conf7
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/outside.conf7
-rwxr-xr-xTAO/orbsvcs/tests/HTIOP/BiDirectional/run_test.pl45
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/server.cpp177
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/test.idl27
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.cpp94
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.h92
-rw-r--r--TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.i17
-rw-r--r--TAO/orbsvcs/tests/HTIOP/HT_Config.conf4
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/HTIOP_Hello.mpc45
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/Hello.cpp27
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/Hello.h42
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/Makefile.am105
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/README22
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/Test.idl20
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/Test_Output.cpp230
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/client.cpp94
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/outside.conf8
-rwxr-xr-xTAO/orbsvcs/tests/HTIOP/Hello/run_test.pl91
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/server.cpp167
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Hello/svc.conf7
-rw-r--r--TAO/orbsvcs/tests/HTIOP/Makefile.am15
-rw-r--r--TAO/orbsvcs/tests/HTIOP/test_config.h319
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/IOR_MCast.mpc40
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/MCast.idl19
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.cpp15
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.h18
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/Makefile.am116
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/README20
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/client.cpp33
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.cpp80
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.h36
-rwxr-xr-xTAO/orbsvcs/tests/IOR_MCast/run_test_ipv6.pl34
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/server.cpp28
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/server_i.cpp185
-rw-r--r--TAO/orbsvcs/tests/IOR_MCast/server_i.h59
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/Airplane.idl7
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/ImplRepo.mpc90
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/Makefile.am210
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/NameService/ImplRepo_NameService.mpc6
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/NameService/Makefile.am48
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/NameService/README3
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl139
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp52
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/Nestea.idl19
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/README75
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_client.cpp24
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_client_i.cpp146
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_client_i.h70
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_i.cpp91
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_i.h55
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_server.cpp44
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp227
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h75
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/locked/run_test.pl188
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_client.cpp25
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_client_i.cpp138
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_client_i.h66
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_i.cpp166
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_i.h83
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_server.cpp43
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp239
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/nestea_server_i.h74
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/run_test.pl1001
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/Makefile.am112
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/client.conf4
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/client.cpp41
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/scale/run_test.pl217
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/scaletest.mpc35
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/server.cpp37
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp230
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/server_i.h32
-rw-r--r--TAO/orbsvcs/tests/ImplRepo/scale/test.idl4
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/IFR_Application_Test.mpc21
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/Makefile.am115
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/README111
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/client.cpp45
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp418
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h85
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl112
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp107
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test.idl14
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp51
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.h19
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/IFR_IDL3_Test.mpc14
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/Makefile.am48
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/README33
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp44
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp1894
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h133
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl82
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl123
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.idl33
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.mpc11
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/Makefile.am42
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/README75
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp121
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl156
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp3577
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.h95
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/IFR_IFR_Test.mpc6
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Makefile.am48
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/README113
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp23
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl72
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp257
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h77
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Test.mpc4
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Makefile.am48
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp26
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl69
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Makefile.am18
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/IFR_Persistence_Test.mpc6
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Makefile.am48
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp270
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h74
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README69
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl95
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/svc.conf2
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp23
-rw-r--r--TAO/orbsvcs/tests/Interoperable_Naming/Interoperable_Naming.mpc6
-rw-r--r--TAO/orbsvcs/tests/Interoperable_Naming/Makefile.am86
-rw-r--r--TAO/orbsvcs/tests/Interoperable_Naming/README39
-rw-r--r--TAO/orbsvcs/tests/Interoperable_Naming/Web_Server.idl26
-rw-r--r--TAO/orbsvcs/tests/Interoperable_Naming/client.cpp47
-rw-r--r--TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.cpp355
-rw-r--r--TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.h81
-rwxr-xr-xTAO/orbsvcs/tests/Interoperable_Naming/run_test.pl54
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Application_Controlled.mpc32
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp72
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.h59
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp212
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.h86
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Makefile.am147
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/README11
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Test.idl23
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp92
-rwxr-xr-xTAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/run_test.pl86
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp112
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/svc.conf2
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf3
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.cpp107
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.h75
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.cpp9
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.h27
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.cpp5
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.h34
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Infrastructure_Controlled.mpc34
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.cpp249
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.h71
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Makefile.am154
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/README8
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.cpp18
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.h32
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Test.idl15
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/client.cpp86
-rwxr-xr-xTAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/run_test.pl72
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/server.cpp31
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf3
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile.am15
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp81
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.h64
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.cpp349
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.h107
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Makefile.am110
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Manage_Object_Group.mpc11
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.cpp81
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.h66
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Test.idl38
-rwxr-xr-xTAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/run_test.pl61
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/server.cpp132
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf3
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/LoadMonitorCPU.mpc4
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/Makefile.am63
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/README11
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/client.cpp180
-rwxr-xr-xTAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/run_test.pl61
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/Makefile.am13
-rw-r--r--TAO/orbsvcs/tests/LoadBalancing/Makefile.am14
-rw-r--r--TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.cpp803
-rw-r--r--TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.h160
-rw-r--r--TAO/orbsvcs/tests/Log/Basic_Log_Test/Log_Basic_Log_Test.mpc6
-rw-r--r--TAO/orbsvcs/tests/Log/Basic_Log_Test/Makefile.am49
-rw-r--r--TAO/orbsvcs/tests/Log/Basic_Log_Test/README18
-rw-r--r--TAO/orbsvcs/tests/Log/Basic_Log_Test/client.cpp119
-rwxr-xr-xTAO/orbsvcs/tests/Log/Basic_Log_Test/run_test.pl57
-rw-r--r--TAO/orbsvcs/tests/Log/Makefile.am13
-rw-r--r--TAO/orbsvcs/tests/Log/README10
-rw-r--r--TAO/orbsvcs/tests/Makefile.am56
-rw-r--r--TAO/orbsvcs/tests/Miop/Makefile.am13
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/Makefile.am130
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/McastHello.cpp68
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/McastHello.h51
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/McastHello.mpc32
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/README34
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/Test.idl26
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/client.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/client.cpp103
-rwxr-xr-xTAO/orbsvcs/tests/Miop/McastHello/run_test.pl62
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/server.conf.xml12
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/server.cpp144
-rw-r--r--TAO/orbsvcs/tests/Miop/McastHello/svc.conf4
-rw-r--r--TAO/orbsvcs/tests/Miop/README13
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/AdminProperties.cpp490
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/AdminProperties.h153
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Basic.mpc73
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.cpp382
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.h136
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Events.cpp355
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Events.h132
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Filter.cpp249
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Filter.h92
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/IdAssignment.cpp489
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/IdAssignment.h71
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/LifeCycle.cpp271
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/LifeCycle.h49
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Makefile.am494
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/MultiTypes.cpp412
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/MultiTypes.h169
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/README109
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp387
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Sequence.h142
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Simple.cpp271
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Simple.h130
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Updates.cpp488
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/Updates.h148
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/adminproperties.conf6
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/notify.mt.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/notify.reactive.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/Basic/notify.rt.conf5
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Basic/run_test.pl152
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl145
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/Blocking.mpc35
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/Makefile.am154
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.cpp116
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.h51
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/README42
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp173
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp255
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/notify.conf10
-rw-r--r--TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Blocking/run_test.pl120
-rw-r--r--TAO/orbsvcs/tests/Notify/Destroy/Destroy.mpc9
-rw-r--r--TAO/orbsvcs/tests/Notify/Destroy/Makefile.am70
-rw-r--r--TAO/orbsvcs/tests/Notify/Destroy/main.cpp36
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Discarding.mpc62
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Makefile.am254
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp172
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h50
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp144
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h52
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/README53
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp193
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp288
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp196
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp270
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/notify.conf4
-rw-r--r--TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Discarding/run_test.pl217
-rw-r--r--TAO/orbsvcs/tests/Notify/Driver/Driver.mpc10
-rw-r--r--TAO/orbsvcs/tests/Notify/Driver/Makefile.am69
-rw-r--r--TAO/orbsvcs/tests/Notify/Driver/main.cpp32
-rw-r--r--TAO/orbsvcs/tests/Notify/Lanes/README58
-rw-r--r--TAO/orbsvcs/tests/Notify/Lanes/consumer.conf61
-rw-r--r--TAO/orbsvcs/tests/Notify/Lanes/notify.conf8
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Lanes/run_test.pl98
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Lanes/run_test_consumer.pl44
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Lanes/run_test_notify.pl48
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Lanes/run_test_supplier.pl46
-rw-r--r--TAO/orbsvcs/tests/Notify/Lanes/supplier.conf65
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc38
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am162
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp39
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h43
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/README38
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp192
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp271
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf4
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml6
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl132
-rw-r--r--TAO/orbsvcs/tests/Notify/Makefile.am30
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Makefile.am254
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp158
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h52
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp131
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h53
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Ordering.mpc61
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/README53
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp185
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp284
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp181
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp281
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/notify.conf6
-rw-r--r--TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Ordering/run_test.pl219
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/Makefile.am99
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/PlugTop.mpc19
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp37
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h39
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp26
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h31
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp109
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_export.h40
-rw-r--r--TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf3
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/Makefile.am57
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.cpp35
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.h43
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_Factories_Define.cpp13
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_Notify_lib.mpc16
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.cpp390
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.h81
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.cpp40
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.h54
-rw-r--r--TAO/orbsvcs/tests/Notify/RT_lib/rt_notify_test_export.h39
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp1908
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h295
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/Makefile.am118
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/README351
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/Reconnecting.mpc14
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp1376
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.h209
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/event.conf6
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf7
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf5
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_topo.conf3
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf4
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf4
-rw-r--r--TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_topo.conf2
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Reconnecting/run_test.pl392
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Makefile.am162
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp86
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h49
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/README36
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Seq_Multi_ETCL_Filter.mpc38
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp203
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp284
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf4
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl76
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Makefile.am154
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp90
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h51
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/README39
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Seq_Multi_Filter.mpc36
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp196
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp287
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf5
-rw-r--r--TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl93
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/Makefile.am154
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp107
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h46
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/README36
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc35
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp158
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp204
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf3
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl119
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Makefile.am155
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp185
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h50
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp58
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h18
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/README39
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc37
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp180
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp281
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf4
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl111
-rw-r--r--TAO/orbsvcs/tests/Notify/Test_Filter/Makefile.am51
-rw-r--r--TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp292
-rw-r--r--TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h136
-rw-r--r--TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.cpp82
-rw-r--r--TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h82
-rw-r--r--TAO/orbsvcs/tests/Notify/Test_Filter/Test_Filter.mpc17
-rw-r--r--TAO/orbsvcs/tests/Notify/Test_Filter/rt_test_filter_export.h39
-rw-r--r--TAO/orbsvcs/tests/Notify/ThreadPool/README52
-rw-r--r--TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf61
-rw-r--r--TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf8
-rwxr-xr-xTAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl96
-rw-r--r--TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf66
-rw-r--r--TAO/orbsvcs/tests/Notify/XML_Persistence/Makefile.am67
-rw-r--r--TAO/orbsvcs/tests/Notify/XML_Persistence/XML_Persistence.mpc5
-rw-r--r--TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp409
-rwxr-xr-xTAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl50
-rw-r--r--TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Activation_Manager.cpp296
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Activation_Manager.h139
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Activation_Manager.idl32
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Application_Command.cpp224
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Application_Command.h83
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command.cpp59
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command.h78
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command_Builder.cpp92
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command_Builder.h74
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command_Factory.cpp14
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command_Factory.h44
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.cpp53
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.h64
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.cpp180
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.h90
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Consumer_T.cpp107
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Consumer_T.h98
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.cpp37
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.h44
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.cpp56
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.h59
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Driver.cpp325
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Driver.h151
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Driver_Base.h38
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp225
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.h95
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Factories_Define.cpp23
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Factories_Define.h38
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Filter_Command.cpp208
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Filter_Command.h83
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp256
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/LookupManager.h120
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Makefile.am183
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Name.cpp37
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Name.h63
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_PushConsumer.h36
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_PushSupplier.h12
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushConsumer.h30
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushSupplier.h29
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushConsumer.h29
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushSupplier.h29
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp242
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h116
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Notify_lib.mpc8
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp149
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Options_Parser.h48
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Peer.cpp94
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Peer.h80
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Peer.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp251
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Peer_T.h121
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp273
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h102
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.cpp273
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.h95
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp358
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h115
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.cpp261
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.h95
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.cpp25
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.h45
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp56
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/PushConsumer.h104
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/PushConsumer.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp55
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/PushSupplier.h97
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/PushSupplier.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/README10
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.cpp44
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.h56
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp57
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.h104
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp57
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.h98
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredEvent.cpp88
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredEvent.h67
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp57
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.h104
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp58
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.h98
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.inl3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.cpp179
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.h89
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Supplier_T.cpp104
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Supplier_T.h99
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Task_Callback.cpp7
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Task_Callback.h40
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Task_Stats.cpp149
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Task_Stats.h101
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl54
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/common.cpp56
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/common.h36
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/notify_test_export.h40
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Filter.mpc57
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Makefile.am258
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp92
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h50
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp86
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h50
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/README34
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp225
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp263
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp223
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp257
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl10
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf6
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml6
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl211
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Makefile.am15
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/Makefile.am71
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/README65
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen.mpc6
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.cpp772
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h329
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf5
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml5
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf.xml5
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp34
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf3
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf.xml5
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/RedGreen/run_test.pl79
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf1
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf.xml5
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Makefile.am73
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Throughput/README20
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp656
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h228
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.mpc6
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/README37
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/cos_notify.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/rt_notify.conf3
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_all.pl58
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl167
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf38
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/README41
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf43
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/cos_notify.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/rt_notify.conf3
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_all.pl58
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl165
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf24
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/run_test.pl94
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf25
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf27
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/run_test.pl94
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf25
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf26
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf27
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl117
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf25
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf27
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf28
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl117
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf26
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf48
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/run_test.pl69
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf55
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/run_test.pl69
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf28
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/notify.conf2
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl167
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf33
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf31
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/notify.conf3
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl170
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf32
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/README33
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/run_all.pl34
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf42
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf85
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf125
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf57
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf65
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/README37
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/cos_notify.conf2
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/high_path.conf49
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/rt_notify.conf3
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_all.pl58
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl109
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl98
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl111
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl167
-rw-r--r--TAO/orbsvcs/tests/Notify/performance-tests/scripts/README12
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/run_all.pl50
-rw-r--r--TAO/orbsvcs/tests/Property/Makefile.am78
-rw-r--r--TAO/orbsvcs/tests/Property/Property.mpc15
-rw-r--r--TAO/orbsvcs/tests/Property/README42
-rw-r--r--TAO/orbsvcs/tests/Property/client.cpp763
-rw-r--r--TAO/orbsvcs/tests/Property/client.h107
-rw-r--r--TAO/orbsvcs/tests/Property/main.cpp586
-rwxr-xr-xTAO/orbsvcs/tests/Property/run_test.pl64
-rw-r--r--TAO/orbsvcs/tests/Property/server.cpp121
-rw-r--r--TAO/orbsvcs/tests/Property/server.h27
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/Object1_i.cpp81
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/Object1_i.h43
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/README270
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/RTCosScheduling.mpc48
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/client.cpp433
-rwxr-xr-xTAO/orbsvcs/tests/RTCosScheduling/run_test.pl318
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/schedule.cfg24
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/server.cpp267
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/server.ior1
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/svc.conf2
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/testSched.idl43
-rw-r--r--TAO/orbsvcs/tests/RTCosScheduling/testSched_export.h60
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/Makefile.am84
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/README89
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc7
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/client.cpp540
-rwxr-xr-xTAO/orbsvcs/tests/Redundant_Naming/run_test.pl118
-rw-r--r--TAO/orbsvcs/tests/Redundant_Naming/test_object.idl11
-rw-r--r--TAO/orbsvcs/tests/Sched/DynSched_Test.cpp320
-rw-r--r--TAO/orbsvcs/tests/Sched/Makefile.am46
-rw-r--r--TAO/orbsvcs/tests/Sched/Sched.mpc6
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/Makefile.am48
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/README42
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.cpp452
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.mpc8
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies.cpp381
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies_Runtime.h59
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.cpp175
-rw-r--r--TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.h62
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/Makefile.am118
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/README29
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/Secure_BiDir.mpc33
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/client.conf10
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/client.cpp207
-rwxr-xr-xTAO/orbsvcs/tests/Security/BiDirectional/run_test.pl187
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/server.conf10
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/server.cpp175
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/ssl/ca.pem34
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-cert.pem17
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-key.pem32
-rwxr-xr-xTAO/orbsvcs/tests/Security/BiDirectional/ssl/make-client-keys16
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-cert.pem17
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-key.pem32
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/test.idl26
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/test_i.cpp102
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/test_i.h92
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/test_i.inl17
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/Big_Request.mpc34
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/Makefile.am125
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/README35
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/TX_Object.idl27
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.cpp55
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.h56
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/cacert.pem21
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/client.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/client.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/client.cpp126
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/client_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/client_key.pem15
-rwxr-xr-xTAO/orbsvcs/tests/Security/Big_Request/run_test.pl54
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/server.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/server.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/server.cpp121
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/server_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Big_Request/server_key.pem15
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/Callback.mpc40
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/Makefile.am154
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/README13
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/cacert.pem21
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client.cpp135
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client.idl11
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client_i.cpp26
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client_i.h43
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/client_key.pem15
-rwxr-xr-xTAO/orbsvcs/tests/Security/Callback/run_test.pl54
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server.cpp110
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server.idl14
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server_i.cpp38
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server_i.h52
-rw-r--r--TAO/orbsvcs/tests/Security/Callback/server_key.pem15
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/Makefile.am152
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/README20
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/Security_Crash_Test.mpc31
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/cacert.pem21
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/client.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/client.cpp146
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/client_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/client_key.pem15
-rwxr-xr-xTAO/orbsvcs/tests/Security/Crash_Test/run_test.pl116
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/server.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/server.cpp168
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/server_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/server_key.pem15
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/test.idl10
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/test_i.cpp40
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/test_i.h49
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/test_i.i7
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.cpp74
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.h62
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/MT_IIOP_SSL.mpc33
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Makefile.am130
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/README25
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.cpp23
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.h56
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf32
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.cpp119
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/pvtkey.pem9
-rwxr-xr-xTAO/orbsvcs/tests/Security/MT_IIOP_SSL/run_test.pl86
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/selfsigncert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf7
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.cpp121
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test.idl23
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.cpp91
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.h68
-rw-r--r--TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.inl9
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.cpp70
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.h67
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/MT_SSLIOP.mpc33
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/Makefile.am131
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/README25
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.cpp23
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.h56
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf31
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/client.cpp139
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/pvtkey.pem9
-rwxr-xr-xTAO/orbsvcs/tests/Security/MT_SSLIOP/run_test.pl65
-rwxr-xr-xTAO/orbsvcs/tests/Security/MT_SSLIOP/run_test_harsh.pl64
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test_heavy.pl65
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/selfsigncert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf7
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/server.cpp187
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/test.idl15
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.cpp43
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.h71
-rw-r--r--TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.i13
-rw-r--r--TAO/orbsvcs/tests/Security/Makefile.am20
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl32
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp46
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h47
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/Makefile.am137
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/README28
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/Secure_Invocation.mpc31
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/cacert.pem21
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client.cpp189
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client_key.pem15
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client_key_nopasswd.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf.xml9
-rwxr-xr-xTAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl55
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server.cpp167
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server_cert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server_key.pem15
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server_key_nopasswd.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf4
-rw-r--r--TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/Makefile.am88
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/README87
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf5
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf.xml9
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.cpp1279
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.h335
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/corbaloc_ssliop.mpc9
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey-client.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey.pem10
-rwxr-xr-xTAO/orbsvcs/tests/Security/ssliop_corbaloc/run_test.pl161
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert-client.pem24
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert.pem16
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf6
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf.xml8
-rw-r--r--TAO/orbsvcs/tests/Security/ssliop_corbaloc/test_object.idl11
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/Makefile.am88
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/README262
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/Simple_Naming.mpc9
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/client.cpp1279
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/client.h335
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/process-m-output.pl115
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test.pl196
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl131
-rw-r--r--TAO/orbsvcs/tests/Simple_Naming/test_object.idl11
-rw-r--r--TAO/orbsvcs/tests/Time/Client_i.cpp453
-rw-r--r--TAO/orbsvcs/tests/Time/Client_i.h99
-rw-r--r--TAO/orbsvcs/tests/Time/Makefile.am48
-rw-r--r--TAO/orbsvcs/tests/Time/README46
-rw-r--r--TAO/orbsvcs/tests/Time/Time.mpc6
-rw-r--r--TAO/orbsvcs/tests/Time/client.cpp22
-rwxr-xr-xTAO/orbsvcs/tests/Time/run_test.pl64
-rw-r--r--TAO/orbsvcs/tests/Trading/Makefile.am206
-rw-r--r--TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp634
-rw-r--r--TAO/orbsvcs/tests/Trading/Offer_Exporter.h143
-rw-r--r--TAO/orbsvcs/tests/Trading/Offer_Importer.cpp304
-rw-r--r--TAO/orbsvcs/tests/Trading/Offer_Importer.h96
-rw-r--r--TAO/orbsvcs/tests/Trading/README3301
-rw-r--r--TAO/orbsvcs/tests/Trading/Service_Type_Exporter.cpp518
-rw-r--r--TAO/orbsvcs/tests/Trading/Service_Type_Exporter.h122
-rw-r--r--TAO/orbsvcs/tests/Trading/Simple_Dynamic.cpp30
-rw-r--r--TAO/orbsvcs/tests/Trading/Simple_Dynamic.h51
-rw-r--r--TAO/orbsvcs/tests/Trading/TT_Info.cpp354
-rw-r--r--TAO/orbsvcs/tests/Trading/TT_Info.h206
-rw-r--r--TAO/orbsvcs/tests/Trading/TTest.idl44
-rw-r--r--TAO/orbsvcs/tests/Trading/Trading.mpc61
-rw-r--r--TAO/orbsvcs/tests/Trading/colocated_test.cpp133
-rw-r--r--TAO/orbsvcs/tests/Trading/export_test.cpp158
-rw-r--r--TAO/orbsvcs/tests/Trading/import_test.cpp60
-rwxr-xr-xTAO/orbsvcs/tests/Trading/run_test.pl63
-rw-r--r--TAO/orbsvcs/tests/Trading/ttest_export.h40
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/Makefile.am105
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/README32
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/client.cpp46
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/corbaname.idl20
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/ior_corbaname.mpc37
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.cpp150
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.h64
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/server.cpp83
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/status_i.cpp19
-rw-r--r--TAO/orbsvcs/tests/ior_corbaname/status_i.h19
-rwxr-xr-xTAO/orbsvcs/tests/start_services112
-rw-r--r--TAO/orbsvcs/tests/tests.mwc5
-rw-r--r--TAO/orbsvcs/tests/tests_svc_loader/Makefile.am44
-rw-r--r--TAO/orbsvcs/tests/tests_svc_loader/README12
-rw-r--r--TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.cpp94
-rw-r--r--TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.mpc6
1498 files changed, 170563 insertions, 0 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/AVS_Asynch_Three_Stage.mpc b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/AVS_Asynch_Three_Stage.mpc
new file mode 100644
index 00000000000..7d7a080db9c
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/AVS_Asynch_Three_Stage.mpc
@@ -0,0 +1,30 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe {
+ exename = sender
+
+ Source_Files {
+ Connection_Manager.cpp
+ sender.cpp
+ }
+}
+
+project(*dist): avstreamsexe {
+ exename = distributer
+
+ Source_Files {
+ Connection_Manager.cpp
+ distributer.cpp
+ }
+}
+
+project(*recv): avstreamsexe {
+ exename = receiver
+
+ Source_Files {
+ Connection_Manager.cpp
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.cpp b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.cpp
new file mode 100644
index 00000000000..baded47bc1f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.cpp
@@ -0,0 +1,663 @@
+//$Id$
+
+#include "Connection_Manager.h"
+
+Connection_Manager::Connection_Manager (void)
+{
+}
+
+Connection_Manager::~Connection_Manager (void)
+{
+}
+
+void
+Connection_Manager::load_ep_addr (const char* file_name)
+{
+ FILE* addr_file = ACE_OS::fopen (file_name, "r");
+
+ if (addr_file == 0)
+ {
+ ACE_ERROR ((LM_DEBUG,
+ "Cannot open addr file %s\n",
+ file_name));
+ return;
+ }
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "Addr file opened successfully\n"));
+
+ while (1)
+ {
+ char buf [BUFSIZ];
+
+ // Read from the file into a buffer
+
+
+ /*
+ int n = ACE_OS::fread (buf,
+ 1,
+ BUFSIZ,
+ addr_file);
+ */
+
+ if ((ACE_OS::fgets (buf,BUFSIZ,addr_file)) == NULL)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"End of Addr file\n"));
+ break;
+ }
+
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s\n",
+ buf));
+
+ Endpoint_Addresses* addr;
+ ACE_NEW (addr,
+ Endpoint_Addresses);
+
+ TAO_Tokenizer addr_tokenizer (buf,'/');
+
+ ACE_CString flowname;
+
+ if (addr_tokenizer [0] == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Corresponding flow name not specified for endpoint addresses\n"));
+ return;
+ }
+ else
+ flowname += addr_tokenizer [0];
+
+ if (addr_tokenizer [1] != 0)
+ {
+ ACE_CString token (addr_tokenizer [1]);
+
+ ACE_CString::size_type pos = token.find ('\r');
+ if (pos != ACE_CString::npos)
+ {
+ addr->sender_addr = CORBA::string_dup ((token.substr (0, pos)).c_str ());
+ }
+ else addr->sender_addr = CORBA::string_dup (token.c_str());
+
+ pos = addr->sender_addr.find ('\n');
+ if (pos != ACE_CString::npos)
+ {
+ addr->sender_addr = (addr->sender_addr.substr (0, pos)).c_str ();
+ }
+ }
+
+ if (addr_tokenizer [2] != 0)
+ {
+ ACE_CString token (addr_tokenizer [2]);
+
+ ACE_CString::size_type pos = token.find ('\r');
+ if (pos != ACE_CString::npos)
+ {
+ addr->receiver_addr = CORBA::string_dup ((token.substr (0, pos)).c_str ());
+ }
+ else addr->receiver_addr = CORBA::string_dup (token.c_str());
+
+ pos = addr->receiver_addr.find ('\n');
+ if (pos != ACE_CString::npos)
+ {
+ addr->receiver_addr = (addr->receiver_addr.substr (0, pos)).c_str ();
+ }
+ }
+
+ int result = ep_addr_.bind (flowname,
+ addr);
+ if (result == 0)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Flowname %s Bound Successfully\n",
+ flowname.c_str ()));
+ }
+ else if (result == 1)
+ ACE_DEBUG ((LM_DEBUG,
+ "Flowname %s already exists\n",
+ flowname.c_str ()));
+ else ACE_DEBUG ((LM_DEBUG,
+ "Flowname %s Bound Failed\n",
+ flowname.c_str ()));
+
+
+ }
+
+}
+
+int
+Connection_Manager::init (CORBA::ORB_ptr orb)
+{
+ // Initialize the naming service
+ if (this->naming_client_.init (orb) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+ return 0;
+}
+
+void
+Connection_Manager::bind_to_receivers (const ACE_CString &sender_name,
+ AVStreams::MMDevice_ptr sender
+ ACE_ENV_ARG_DECL)
+{
+ this->sender_name_ =
+ sender_name;
+
+ /*
+ this->sender_ =
+ AVStreams::MMDevice::_duplicate (sender);
+ */
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ ACE_TRY
+ {
+ // Try binding the sender context in the NS
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ this->sender_context_ =
+ this->naming_client_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // We reach here if there was no exception raised in
+ // <bind_new_context>. We then create a receiver context.
+ //
+
+ // Create the context for storing the receivers
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ // Try binding the receivers context under the sender context.
+ this->receiver_context_ =
+ this->sender_context_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, al_ex)
+ {
+ //
+ // The sender context already exists, probably created by the
+ // receiver(s).
+ //
+
+ // Get the sender context.
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ CORBA::Object_var object =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->sender_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ // Find the Receiver context.
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ object =
+ this->sender_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->receiver_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ this->find_receivers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ // Register the sender object with the sender context.
+ this->sender_context_->rebind (name,
+ sender
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Connection_Manager::find_receivers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::BindingIterator_var iterator;
+ CosNaming::BindingList_var binding_list;
+ const CORBA::ULong chunk = 100;
+
+ // Get the list of receivers registered for this sender.
+ this->receiver_context_->list (chunk,
+ binding_list,
+ iterator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Add the receivers found in the bindinglist to the <receivers>.
+ this->add_to_receivers (binding_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (iterator.in ()))
+ {
+ CORBA::Boolean more = 1;
+
+ // Check to see if there are more receivers listed.
+ while (more)
+ {
+ more = iterator->next_n (chunk,
+ binding_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->add_to_receivers (binding_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+Connection_Manager::add_to_receivers (CosNaming::BindingList &binding_list
+ ACE_ENV_ARG_DECL)
+{
+ for (CORBA::ULong i = 0;
+ i < binding_list.length ();
+ i++)
+ {
+ // Get the receiver name from the binding list.
+ ACE_CString receiver_name =
+ binding_list [i].binding_name [0].id.in ();
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup (receiver_name.c_str ());
+
+ // Resolve the reference of the receiver from the receiver
+ // context.
+ CORBA::Object_var obj =
+ this->receiver_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+
+ AVStreams::MMDevice_var receiver_device =
+ AVStreams::MMDevice::_narrow (obj.in ());
+
+ // Add this receiver to the receiver map.
+ ACE_CString flowname =
+ this->sender_name_ +
+ "_" +
+ receiver_name;
+ this->receivers_.bind (flowname,
+ receiver_device);
+ }
+}
+
+void
+Connection_Manager::connect_to_receivers (AVStreams::MMDevice_ptr sender
+ ACE_ENV_ARG_DECL)
+{
+ // Connect to all receivers that we know about.
+ for (Receivers::iterator iterator = this->receivers_.begin ();
+ iterator != this->receivers_.end ();
+ ++iterator)
+ {
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ ACE_CString flowname =
+ (*iterator).ext_id_;
+
+ Endpoint_Addresses* addr = 0;
+ ep_addr_.find (flowname,
+ addr);
+
+ ACE_CString sender_addr_str;
+ ACE_CString receiver_addr_str;
+
+ if (addr != 0)
+ {
+ sender_addr_str = addr->sender_addr;
+ receiver_addr_str = addr->receiver_addr;
+ ACE_DEBUG ((LM_DEBUG,
+ "Address Strings %s %s\n",
+ sender_addr_str.c_str (),
+ receiver_addr_str.c_str ()));
+
+ }
+ else ACE_DEBUG ((LM_DEBUG,
+ "No endpoint address for flowname %s\n",
+ flowname.c_str ()));
+
+ ACE_INET_Addr receiver_addr (receiver_addr_str.c_str ());
+ ACE_INET_Addr sender_addr (sender_addr_str.c_str ());
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry sender_entry (flowname.c_str (),
+ "IN",
+ "USER_DEFINED",
+ "",
+ "UDP",
+ &sender_addr);
+
+ sender_entry.set_peer_addr (&receiver_addr);
+
+ // Set the flow specification for the stream between receiver
+ // and distributer
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] =
+ CORBA::string_dup (sender_entry.entry_to_string ());
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Connection_Manager::connect_to_receivers Flow Spec Entry %s\n",
+ sender_entry.entry_to_string ()));
+
+ // Create the stream control for this stream.
+ TAO_StreamCtrl *streamctrl = 0;
+ ACE_NEW (streamctrl,
+ TAO_StreamCtrl);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_streamctrl =
+ streamctrl;
+
+ // Register streamctrl.
+ AVStreams::StreamCtrl_var streamctrl_object =
+ streamctrl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Bind the flowname and the corresponding stream controller to
+ // the stream controller map
+ this->streamctrls_.bind (flowname,
+ streamctrl_object);
+
+ // Bind the sender and receiver MMDevices.
+ (void) streamctrl->bind_devs (sender,
+ (*iterator).int_id_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Connection_Manager::bind_to_sender (const ACE_CString &sender_name,
+ const ACE_CString &receiver_name,
+ AVStreams::MMDevice_ptr receiver
+ ACE_ENV_ARG_DECL)
+{
+ this->sender_name_ =
+ sender_name;
+
+ this->receiver_name_ =
+ receiver_name;
+
+ this->receiver_ =
+ AVStreams::MMDevice::_duplicate (receiver);
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ int sender_context_exists = 0;
+
+ ACE_TRY
+ {
+ // Try binding the sender context in the NS
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ CORBA::Object_var object =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // We reach here if there was no exception raised in <resolve>.
+ // Therefore, there must be a valid sender context available.
+ //
+ sender_context_exists = 1;
+
+ this->sender_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ // Find the receivers context under the sender's context
+ object =
+ this->sender_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->receiver_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ // Create the sender context
+ this->sender_context_ =
+ this->naming_client_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ // Create the receivers context under the sender's context
+ this->receiver_context_ =
+ this->sender_context_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ //
+ // At this point we either have resolved the receiver context or we
+ // have created a new one.
+ //
+ name [0].id =
+ CORBA::string_dup (this->receiver_name_.c_str ());
+
+ // Register this receiver object under the receiver context.
+ this->receiver_context_->rebind (name,
+ receiver
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ //
+ // Check if the sender was registered. Note that if we created the
+ // sender context, there is no point in checking for the sender.
+ //
+ if (sender_context_exists)
+ {
+ ACE_TRY_EX(SENDER_CONTEXT_EXISTS)
+ {
+ // Try binding the sender under the sender context
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ CORBA::Object_var object =
+ this->sender_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(SENDER_CONTEXT_EXISTS);
+
+ this->sender_ =
+ AVStreams::MMDevice::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(SENDER_CONTEXT_EXISTS);
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ // No problem if the sender was not there.
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+void
+Connection_Manager::connect_to_sender (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->sender_.in ()))
+ return;
+
+ ACE_CString flowname =
+ this->sender_name_ +
+ "_" +
+ this->receiver_name_;
+
+ Endpoint_Addresses* addr = 0;
+ ep_addr_.find (flowname,
+ addr);
+
+ ACE_CString sender_addr_str;
+ ACE_CString receiver_addr_str;
+
+ if (addr != 0)
+ {
+ sender_addr_str = addr->sender_addr;
+ receiver_addr_str = addr->receiver_addr;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Address Strings %s %s\n",
+ sender_addr_str.c_str (),
+ receiver_addr_str.c_str ()));
+ }
+
+ ACE_INET_Addr receiver_addr (receiver_addr_str.c_str ());
+ ACE_INET_Addr sender_addr (sender_addr_str.c_str ());
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry sender_entry (flowname.c_str (),
+ "IN",
+ "USER_DEFINED",
+ "",
+ "UDP",
+ &sender_addr);
+
+ sender_entry.set_peer_addr (&receiver_addr);
+
+
+ // Set the flow specification for the stream between sender and
+ // receiver.
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] =
+ CORBA::string_dup (sender_entry.entry_to_string ());
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Connection_Manager::connect_to_sender Flow Spec Entry %s\n",
+ sender_entry.entry_to_string ()));
+
+ // Create the stream control for this stream
+ TAO_StreamCtrl* streamctrl = 0;
+ ACE_NEW (streamctrl,
+ TAO_StreamCtrl);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_streamctrl =
+ streamctrl;
+
+ // Register streamctrl.
+ AVStreams::StreamCtrl_var streamctrl_object =
+ streamctrl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ //
+ // Since senders terminate the streams, we don't need the streamctrl
+ // for these.
+ //
+ // this->streamctrls_.bind (flowname,
+ // streamctrl_object);
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Connect the sender and receiver devices.
+ CORBA::Boolean result =
+ streamctrl->bind_devs (this->sender_.in (),
+ this->receiver_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (result == 0)
+ ACE_ERROR ((LM_ERROR,
+ "Streamctrl::bind_devs failed\n"));
+
+ // Start the data sending.
+ AVStreams::flowSpec start_spec;
+ streamctrl->start (start_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Connection_Manager::add_streamctrl (const ACE_CString &flowname,
+ TAO_StreamEndPoint *endpoint
+ ACE_ENV_ARG_DECL)
+{
+ // Get the stream controller for this endpoint.
+ CORBA::Any_var streamctrl_any =
+ endpoint->get_property_value ("Related_StreamCtrl"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ AVStreams::StreamCtrl_ptr streamctrl;
+
+ if( streamctrl_any.in() >>= streamctrl )
+ {
+ // Any still owns the pointer, so we duplicate it
+ AVStreams::StreamCtrl::_duplicate( streamctrl );
+ this->streamctrls_.bind (flowname,
+ streamctrl);
+ }
+}
+
+void
+Connection_Manager::destroy (const ACE_CString &flowname
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ this->protocol_objects_.unbind (flowname);
+ this->receivers_.unbind (flowname);
+
+ this->streamctrls_.unbind (flowname );
+
+}
+
+Connection_Manager::Receivers &
+Connection_Manager::receivers (void)
+{
+ return this->receivers_;
+}
+
+Connection_Manager::Protocol_Objects &
+Connection_Manager::protocol_objects (void)
+{
+ return this->protocol_objects_;
+}
+
+Connection_Manager::StreamCtrls &
+Connection_Manager::streamctrls (void)
+{
+ return this->streamctrls_;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.h b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.h
new file mode 100644
index 00000000000..8045519e6bc
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Connection_Manager.h
@@ -0,0 +1,152 @@
+//$Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage
+//
+// = FILENAME
+// Connection_Manager.h
+//
+// = DESCRIPTION
+// This is a helper class that allows the senders bind to multiple
+// receivers and receivers to bind to senders. It also lets the
+// senders and receivers disconnect streams.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "tao/PortableServer/PortableServer.h"
+
+class Endpoint_Addresses
+{
+ public:
+ ACE_CString sender_addr;
+ ACE_CString receiver_addr;
+};
+
+class Connection_Manager
+{
+ // = TITLE
+ // Defines the Connection Manager.
+ //
+ // = DESCRIPTION
+ // This is a helper class that allows the senders bind to
+ // multiple receivers and receivers to bind to senders. It also
+ // lets the senders and receivers disconnect streams.
+public:
+
+ Connection_Manager (void);
+ // Constructor
+
+ ~Connection_Manager (void);
+ // Destructor
+
+ int init (CORBA::ORB_ptr orb);
+ // Initialize this class.
+
+ void bind_to_receivers (const ACE_CString &sender_name,
+ AVStreams::MMDevice_ptr sender
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Method that binds the sender to the Naming Service and retreives
+ // the references of any registered receivers.
+
+ void connect_to_receivers (AVStreams::MMDevice_ptr sender
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Connect to the receivers that we found.
+
+ void bind_to_sender (const ACE_CString &sender_name,
+ const ACE_CString &receiver_name,
+ AVStreams::MMDevice_ptr receiver
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Bind receiver to the sender.
+
+ void connect_to_sender (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Connect to the sender that we found.
+
+ void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Destroy all streams.
+
+ void destroy (const ACE_CString &flowname
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Destroy streams associated with <flowname>.
+
+ void add_streamctrl (const ACE_CString &flowname,
+ TAO_StreamEndPoint *endpoint
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Add new streamctrl.
+
+ // Map of receivers.
+ typedef ACE_Hash_Map_Manager<ACE_CString,
+ AVStreams::MMDevice_var,
+ ACE_Null_Mutex>
+ Receivers;
+
+ // Map of protocol objects.
+ typedef ACE_Hash_Map_Manager<ACE_CString,
+ TAO_AV_Protocol_Object *,
+ ACE_Null_Mutex>
+ Protocol_Objects;
+
+
+
+ // Map of streamctrl.
+ typedef ACE_Hash_Map_Manager<ACE_CString,
+ AVStreams::StreamCtrl_var,
+ ACE_Null_Mutex>
+ StreamCtrls;
+
+ // Map of flownames and corresponding endpoint addresses
+ typedef ACE_Hash_Map_Manager<ACE_CString,
+ Endpoint_Addresses*,
+ ACE_Null_Mutex>
+ EP_Addr;
+
+ // Map accessors.
+ Receivers &receivers (void);
+ Protocol_Objects &protocol_objects (void);
+ StreamCtrls &streamctrls (void);
+
+ void load_ep_addr (const char* file_name);
+
+protected:
+
+
+
+ void find_receivers (ACE_ENV_SINGLE_ARG_DECL);
+
+ void add_to_receivers (CosNaming::BindingList &binding_list
+ ACE_ENV_ARG_DECL);
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ // The maps.
+ Receivers receivers_;
+ Protocol_Objects protocol_objects_;
+ StreamCtrls streamctrls_;
+ EP_Addr ep_addr_;
+
+ // Sender name.
+ ACE_CString sender_name_;
+
+ // Sender device.
+ AVStreams::MMDevice_var sender_;
+
+ // Sender context.
+ CosNaming::NamingContext_var sender_context_;
+
+ // Receiver name.
+ ACE_CString receiver_name_;
+
+ // Receiver device.
+ AVStreams::MMDevice_var receiver_;
+
+ // Receiver context.
+ CosNaming::NamingContext_var receiver_context_;
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Makefile.am
new file mode 100644
index 00000000000..8a7311e2ae6
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/Makefile.am
@@ -0,0 +1,123 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Asynch_Three_Stage_Dist.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += distributer
+
+distributer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+distributer_SOURCES = \
+ Connection_Manager.cpp \
+ distributer.cpp \
+ Connection_Manager.h \
+ distributer.h
+
+distributer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Asynch_Three_Stage_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ Connection_Manager.cpp \
+ receiver.cpp \
+ Connection_Manager.h \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Asynch_Three_Stage_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ Connection_Manager.cpp \
+ sender.cpp \
+ Connection_Manager.h \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/README b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/README
new file mode 100644
index 00000000000..dbe086c6a04
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/README
@@ -0,0 +1,85 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a three stage AV test with the ability to
+aynschronously start the processes in any order. It also supports
+multiple receivers for a sender. The stages are:
+
+a. Sender
+b. Distributer
+c. Receiver
+
+This test has a sender process that reads data from a file and sends
+it to the distributer. The distributer acts as a conduit. It receives
+data from the sender and sends it immediately to the receiver process.
+
+Running the test
+----------------
+
+Start the Naming Service
+
+Start the following processes in any order.
+
+sender
+------
+
+sender [-f <filename>] [-r <data_rate>] [-s <sender device name>] [-a <address_file>]
+
+-f filename --> The name of the file from which data needs to be sent
+
+-r data_rate --> The rate at which the data needs to be paced.
+
+-s sender device name --> This is the name of the sender as it will be
+ registered with the naming service and which
+ receivers connect to.
+
+-a address_file --> This file contains the sender and receiver
+ endpoint addressses to be used to set up a
+ flow for each flow. The format for each flow
+ is Flowname/sender_endpoint_host:sender_endpoint_port/receiver_endpoint_host:receiver_endpoint_port
+ If no endpoint addresses are specified default addresses would be used.
+
+
+receiver
+--------
+
+receiver [-f <filename>] [-s <sender device name>] [-r <receiver device name>] [-a <address_file>]
+
+-f filename --> File into which the data received from the distributer is stored.
+
+-s sender device name --> This is the name of the sender that the
+ receiver wants to connect to.
+
+-r receiver device name --> This is the name with which this receiver
+ will be registered with the naming
+ service.
+
+-a address_file --> This file contains the sender and receiver
+ endpoint addressses to be used to set up a
+ flow for each flow. The format for each flow
+ is Flowname/sender_endpoint_host:sender_endpoint_port/receiver_endpoint_host:receiver_endpoint_port
+ If no endpoint addresses are specified default addresses would be used.
+
+
+distributer:
+-----------
+
+distributer [-s <sender device name>] [-r <distributer device name>] [-a <address_file>]
+
+-s sender device name --> This is the name of the sender that the
+ distributer wants to connect to.
+
+-r distributer device name --> This is the name with which this
+ distributer will be registered with the
+ naming service. The receivers will bind
+ with this name to receieve data from
+ this distributer.
+
+-a address_file --> This file contains the sender and receiver
+ endpoint addressses to be used to set up a
+ flow for each flow. The format for each flow
+ is Flowname/sender_endpoint_host:sender_endpoint_port/receiver_endpoint_host:receiver_endpoint_port
+ If no endpoint addresses are specified default addresses would be used.
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.cpp b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.cpp
new file mode 100644
index 00000000000..34239319d22
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.cpp
@@ -0,0 +1,308 @@
+// $Id$
+
+#include "distributer.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+typedef ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex> DISTRIBUTER;
+
+int
+Distributer_Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Distributer_Sender_StreamEndPoint::set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object)
+{
+ Connection_Manager &connection_manager =
+ DISTRIBUTER::instance ()->connection_manager ();
+
+ // Add to the map of protocol objects.
+ connection_manager.protocol_objects ().bind (flowname,
+ object);
+
+ // Store the related streamctrl.
+ connection_manager.add_streamctrl (flowname,
+ this);
+
+ return 0;
+}
+
+int
+Distributer_Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the receiver application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+Distributer_Receiver_Callback::Distributer_Receiver_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+int
+Distributer_Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ Connection_Manager::Protocol_Objects &protocol_objects =
+ DISTRIBUTER::instance ()->connection_manager ().protocol_objects ();
+
+ // Send frame to all receivers.
+ for (Connection_Manager::Protocol_Objects::iterator iterator = protocol_objects.begin ();
+ iterator != protocol_objects.end ();
+ ++iterator)
+ {
+ int result =
+ (*iterator).int_id_->send_frame (frame);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+Distributer_Receiver_Callback::handle_destroy (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Callback::end_stream\n"));
+
+ // We can close down now.
+ DISTRIBUTER::instance ()->done (1);
+
+ return 0;
+}
+
+Distributer::Distributer (void)
+ : sender_name_ ("sender")
+ , distributer_name_ ("distributer")
+ , done_ (0)
+ , addr_file_ ("addr_file")
+{
+}
+
+Distributer::~Distributer (void)
+{
+}
+
+Connection_Manager &
+Distributer::connection_manager (void)
+{
+ return this->connection_manager_;
+}
+
+int
+Distributer::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "s:r:a:");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'a':
+ this->addr_file_ = opts.opt_arg ();
+ break;
+ case 's':
+ this->sender_name_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->distributer_name_ = opts.opt_arg ();
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG,"Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+
+int
+Distributer::init (int argc,
+ char ** argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the connection class.
+ int result =
+ this->connection_manager_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Initialize the endpoint strategy with the orb and poa.
+ result =
+ this->sender_endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ result =
+ this->receiver_endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ this->connection_manager_.load_ep_addr (this->addr_file_.c_str ());
+
+ ACE_NEW_RETURN (this->distributer_sender_mmdevice_,
+ TAO_MMDevice (&this->sender_endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_sender_mmdevice =
+ this->distributer_sender_mmdevice_;
+
+ AVStreams::MMDevice_var distributer_sender_mmdevice =
+ this->distributer_sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->distributer_receiver_mmdevice_,
+ TAO_MMDevice (&this->receiver_endpoint_strategy_),
+ -1);
+
+
+ AVStreams::MMDevice_var distributer_receiver_mmdevice =
+ this->distributer_receiver_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Bind to receivers.
+ this->connection_manager_.bind_to_receivers (this->distributer_name_,
+ distributer_sender_mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Connect to receivers
+ this->connection_manager_.connect_to_receivers (distributer_sender_mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Bind to sender.
+ this->connection_manager_.bind_to_sender (this->sender_name_,
+ this->distributer_name_,
+ distributer_receiver_mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Connect to sender.
+ this->connection_manager_.connect_to_sender (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Distributer::done (void) const
+{
+ return this->done_;
+}
+
+void
+Distributer::done (int done)
+{
+ this->done_ = done;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Distributer
+ int result =
+ DISTRIBUTER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ while (!DISTRIBUTER::instance ()->done ())
+ {
+ orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"main");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ DISTRIBUTER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.h b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.h
new file mode 100644
index 00000000000..319f6287193
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer.h
@@ -0,0 +1,159 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage
+//
+// = FILENAME
+// distributer.h
+//
+// = DESCRIPTION
+// Process to receive data from the sender and send it to the
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "Connection_Manager.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Distributer_Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Distributer_Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Count of the frames passing through us.
+};
+
+class Distributer_Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Distributer_Receiver_Callback callback_;
+ // Receiver application callback.
+};
+
+class Distributer_Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Distributer_Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_B
+ <Distributer_Receiver_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ RECEIVER_ENDPOINT_STRATEGY;
+
+class Distributer
+{
+ // = TITLE
+ // Distributer Application.
+ //
+ // = DESCRIPTION
+ // The distributer is the intermediate receiver that receives
+ // data from the sender and forwards to a receiver.
+public:
+ Distributer (void);
+ // Constructor
+
+ ~Distributer (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+ int parse_args (int argc,
+ char **argv);
+ // Parse args.
+
+ // Flag to know when we are done.
+ int done (void) const;
+ void done (int);
+
+ Connection_Manager &connection_manager (void);
+ // Accessor to connection manager.
+
+protected:
+ Connection_Manager connection_manager_;
+ // Connection manager.
+
+ SENDER_ENDPOINT_STRATEGY sender_endpoint_strategy_;
+ // The sender endpoint strategy.
+
+ RECEIVER_ENDPOINT_STRATEGY receiver_endpoint_strategy_;
+ // The receiver endpoint strategy.
+
+ TAO_MMDevice* distributer_receiver_mmdevice_;
+ // The distributer receiver multimedia device
+
+ TAO_MMDevice* distributer_sender_mmdevice_;
+ // The distributer receiver multimedia device
+
+ ACE_CString sender_name_;
+ // The name of the sender to connect to.
+
+ ACE_CString distributer_name_;
+ // Our name.
+
+ int done_;
+ // Flag to know when we are done.
+
+ ACE_CString addr_file_;
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer_addr_file b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer_addr_file
new file mode 100644
index 00000000000..82c5613c959
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/distributer_addr_file
@@ -0,0 +1,2 @@
+Sender_Distributer/192.168.1.3:5000/192.168.1.4:5000
+Distributer_Receiver/192.168.1.4:6000/192.168.1.2:5000 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.cpp
new file mode 100644
index 00000000000..437bf6d21b7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.cpp
@@ -0,0 +1,277 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+
+// File handle of the file into which received data is written.
+static FILE *output_file = 0;
+
+// Flag to tell us if we are done or not.
+static int done=0;
+
+int
+Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ return 0;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::end_stream\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ done=1;
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Receiver_Callback::handle_destroy Failed\n");
+ return -1;
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0),
+ output_file_name_ ("output"),
+ addr_file_ ("addr_file"),
+ sender_name_ ("distributer"),
+ receiver_name_ ("receiver")
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+int
+Receiver::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the connection manager.
+ result =
+ this->connection_manager_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ this->connection_manager_.load_ep_addr (this->addr_file_.c_str ());
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Bind to sender.
+ this->connection_manager_.bind_to_sender (this->sender_name_,
+ this->receiver_name_,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Connect to the sender.
+ this->connection_manager_.connect_to_sender (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Receiver::parse_args (int argc,
+ char **argv)
+{
+ // Parse the command line arguments
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:s:r:a:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'a':
+ this->addr_file_ = opts.opt_arg ();
+ break;
+ case 'f':
+ this->output_file_name_ = opts.opt_arg ();
+ break;
+ case 's':
+ this->sender_name_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->receiver_name_ = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: receiver -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+ACE_CString
+Receiver::output_file_name (void)
+{
+ return this->output_file_name_;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Receiver receiver;
+ int result =
+ receiver.parse_args (argc,
+ argv);
+ if (result == -1)
+ return -1;
+
+ // Make sure we have a valid <output_file>
+ output_file =
+ ACE_OS::fopen (receiver.output_file_name ().c_str (),
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ receiver.output_file_name ().c_str ()),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ result =
+ receiver.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ ACE_Time_Value tv(0, 10000);
+ while(!done)
+ {
+ orb->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.h b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.h
new file mode 100644
index 00000000000..8d9638f4d2e
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver.h
@@ -0,0 +1,124 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "Connection_Manager.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Receiver_Callback callback_;
+ // Receiver application callback.
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ // Constructor
+
+ ~Receiver (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+ int parse_args (int argc,
+ char **argv);
+ // Parse args.
+
+ ACE_CString output_file_name (void);
+ // Name of the output file.
+
+protected:
+ Connection_Manager connection_manager_;
+ // Connection manager.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reactive strategy.
+
+ AVStreams::MMDevice_var mmdevice_obj_;
+ // The receiver MMDevice.
+
+ TAO_MMDevice *mmdevice_;
+ // Receiver MMDevice.
+
+ AVStreams::MMDevice_var sender_mmdevice_;
+ // The sender MMDevice
+
+ ACE_CString output_file_name_;
+ // File name of the file into which received data is written.
+
+ ACE_CString addr_file_;
+
+ ACE_CString sender_name_;
+ // Sender name.
+
+ ACE_CString receiver_name_;
+ // Receiver name.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver_addr_file b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver_addr_file
new file mode 100644
index 00000000000..29ab7465637
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/receiver_addr_file
@@ -0,0 +1 @@
+Distributer_Receiver/192.168.1.4:6000/192.168.1.2:5000 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl
new file mode 100755
index 00000000000..79b0dd65a36
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl
@@ -0,0 +1,244 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$testfile = PerlACE::LocalFile ("output");
+$input = PerlACE::LocalFile ("test_input");
+
+unlink $nsior;
+unlink $testfile, $input;
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+$SV = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -s sender -r 10 -f $input");
+$SV1 = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -s sender -r 1 -f $input");
+$RE1 = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -s distributer -r receiver1 -f output1");
+$RE2 = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -s distributer -r receiver2 -f output2");
+$DI = new PerlACE::Process ("distributer", "-ORBInitRef NameService=file://$nsior -s sender -r distributer");
+
+print STDERR "\nReceiver 1 --> Receiver 2 --> Distributer --> Sender\n\n";
+
+print STDERR "Starting Naming Service\n";
+
+if ($NS->Spawn () == -1) {
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Receiver 1\n";
+
+$RE1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Receiver 2\n";
+
+$RE2->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Distributer\n";
+
+$DI->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender\n";
+
+$sender = $SV->SpawnWaitKill (1000);
+
+if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+$distributer = $DI->TerminateWaitKill (1000);
+
+if ($distributer != 0) {
+ print STDERR "ERROR: distributer returned $distributer\n";
+ $status = 1;
+}
+
+$receiver1 = $RE1->TerminateWaitKill (1000);
+
+if ($receiver1 != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$receiver2 = $RE2->TerminateWaitKill (1000);
+
+if ($receiver2 != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (1000);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $testfile;
+
+print STDERR "\nDistributer --> Receiver 1 --> Receiver 2 --> Sender\n\n";
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Distributer\n";
+
+$DI->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Receiver 1\n";
+
+$RE1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Receiver 2\n";
+
+$RE2->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender\n";
+
+$sender = $SV->SpawnWaitKill (1000);
+
+if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+$distributer = $DI->TerminateWaitKill (1000);
+
+if ($distributer != 0) {
+ print STDERR "ERROR: distributer returned $distributer\n";
+ $status = 1;
+}
+
+$receiver1 = $RE1->TerminateWaitKill (1000);
+
+if ($receiver1 != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$receiver2 = $RE2->TerminateWaitKill (1000);
+
+if ($receiver2 != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (1000);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $testfile;
+
+print STDERR "\nSender --> Receiver 1 --> Receiver 2 --> Distributer\n\n";
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Sender\n";
+
+$SV1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Receiver 1\n";
+
+$RE1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Receiver 2\n";
+
+$RE2->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Distributer\n";
+
+$DI->Spawn ();
+
+$SV1->WaitKill(1000);
+
+$distributer = $DI->TerminateWaitKill(1000);
+
+if ($distributer != 0) {
+ print STDERR "ERROR: sender returned $distributer\n";
+ $status = 1;
+}
+
+$receiver1 = $RE1->TerminateWaitKill (1000);
+
+if ($receiver1 != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$receiver2 = $RE2->TerminateWaitKill (1000);
+
+if ($receiver2 != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (1000);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $testfile, $input;
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp
new file mode 100644
index 00000000000..e97f210997e
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp
@@ -0,0 +1,359 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the client application callback and return to the AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object)
+{
+ Connection_Manager &connection_manager =
+ SENDER::instance ()->connection_manager ();
+
+ // Add to the map of protocol objects.
+ connection_manager.protocol_objects ().bind (flowname,
+ object);
+
+ // Store the related streamctrl.
+ connection_manager.add_streamctrl (flowname,
+ this);
+
+ return 0;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ addr_file_ ("addr_file"),
+ frame_rate_ (10.0),
+ mb_ (BUFSIZ),
+ sender_name_ ("sender")
+{
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "s:f:r:da:");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'a':
+ this->addr_file_ = opts.opt_arg ();
+ break;
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 's':
+ this->sender_name_ = opts.opt_arg ();
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the connection manager.
+ result =
+ this->connection_manager_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ this->connection_manager_.load_ep_addr (this->addr_file_.c_str ());
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the object reference with the Naming Service and bind to
+ // the receivers
+ this->connection_manager_.bind_to_receivers (this->sender_name_,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Connect to the receivers
+ this->connection_manager_.connect_to_receivers (mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The time that should lapse between two consecutive frames sent.
+ ACE_Time_Value inter_frame_time;
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1.0 / ((double) this->frame_rate_));
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %d / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ break;
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ Connection_Manager::Protocol_Objects &protocol_objects =
+ this->connection_manager_.protocol_objects ();
+
+ // Send frame to all receivers.
+ for (Connection_Manager::Protocol_Objects::iterator iterator = protocol_objects.begin ();
+ iterator != protocol_objects.end ();
+ ++iterator)
+ {
+ int result =
+ (*iterator).int_id_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ } // end while
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+Connection_Manager &
+Sender::connection_manager (void)
+{
+ return this->connection_manager_;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Client.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "client::init failed\n"), -1);
+
+ SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h
new file mode 100644
index 00000000000..b4392ed9a4c
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h
@@ -0,0 +1,108 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "Connection_Manager.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ // = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Method to pace and send data from a file.
+
+ Connection_Manager &connection_manager (void);
+ // Accessor to the connection manager.
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ // The endpoint strategy used by the sender.
+
+ TAO_MMDevice *sender_mmdevice_;
+ // The sender MMDevice.
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ ACE_CString addr_file_;
+ // File from which data is read.
+
+ double frame_rate_;
+ // Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ ACE_CString sender_name_;
+ // Name of this sender.
+
+ // Connection manager.
+ Connection_Manager connection_manager_;
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender_addr_file b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender_addr_file
new file mode 100644
index 00000000000..cea405d8599
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender_addr_file
@@ -0,0 +1 @@
+Sender_Distributer/192.168.1.3:5000/192.168.1.4:5000 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/AVS_Bidirectional_Flows.mpc b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/AVS_Bidirectional_Flows.mpc
new file mode 100644
index 00000000000..ff55e80a109
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/AVS_Bidirectional_Flows.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe {
+ exename = sender
+
+ Source_Files {
+ sender.cpp
+ }
+}
+
+project(*recv): avstreamsexe {
+ exename = receiver
+
+ Source_Files {
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/Makefile.am
new file mode 100644
index 00000000000..7bf11f4dad7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Bidirectional_Flows_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ receiver.cpp \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Bidirectional_Flows_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ sender.cpp \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/README b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/README
new file mode 100644
index 00000000000..c637b2c3b25
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/README
@@ -0,0 +1,45 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a simple test in the form of a sender and a
+receiver. The test has the following features:
+
+1. It tests the AVStreams Pluggable Protocol Framework
+2. Shows a mechanism to pace data.
+3. Shows how to set up bidirectional data.
+
+Running the test
+----------------
+
+receiver
+--------
+
+receiver -f <input_filename>
+
+-f <input_filename> -> The name of the file from which data is sent to the receiver
+
+sender
+------
+
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-d]
+
+
+-f filename --> The file to be streamed to the receiver (defaults to
+ "input").
+
+-p protocol --> The protocol string could be UDP or TCP (defaults to
+ UDP). But with the multicast address it should be UDP.
+
+-r framerate--> The rate at which tha data frames need to be sent
+ (defaults to 30 frames per second).
+
+-d --> Increament the TAO_debug_level for debug messages.
+
+
+The test must be run with the naming service. Check the run_test.pl
+to see how to configure the test case.
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.cpp
new file mode 100644
index 00000000000..3683e3e7ba2
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.cpp
@@ -0,0 +1,359 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+static FILE *output_file = 0;
+// File handle of the file into which received data is written.
+
+static const char *output_file_name = "output";
+// File name of the file into which received data is written.
+
+typedef ACE_Unmanaged_Singleton<Receiver,ACE_Null_Mutex> RECEIVER;
+//Create a singleton instance of the receiver.
+
+int
+Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+
+int
+Receiver_StreamEndPoint::set_protocol_object (const char * flowname,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ if (ACE_OS::strcmp (flowname, "Data_Receiver1") == 0)
+ RECEIVER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (1),
+ mb_ (BUFSIZ)
+{
+}
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ RECEIVER::instance ()->input_file ());
+
+ if (n < 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver::receive_frame fread failed\n"));
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ ACE_DEBUG ((LM_DEBUG,"End of file\n"));
+ }
+ else
+ {
+ this->mb_.wr_ptr (n);
+
+ // Send frame.
+ int result =
+ RECEIVER::instance ()->protocol_object ()->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Send Frame Failed\n"));
+
+ // Reset the message block.
+ this->mb_.reset ();
+ }
+ return 0;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::handle_destroy\n"));
+
+ static int count = 0;
+ ++count;
+
+ if (count < 2)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Receiver_Callback::handle_destroy Failed\n");
+ return -1;
+
+ }
+
+ ACE_ENDTRY;
+ }
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0),
+ frame_rate_ (30),
+ input_file_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ mb_ (BUFSIZ)
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+void
+Receiver::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Receiver::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
+Receiver::init (int argc,
+ char ** argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "Input File opened successfully\n"));
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Initialize the naming services
+ if (this->naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the receiver object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+Receiver::protocol_object (void)
+{
+ return this->protocol_object_;
+}
+
+FILE *
+Receiver::input_file (void)
+{
+ return this->input_file_;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (), root_poa.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "Output File Opened Successfully\n"));
+
+ int result =
+ RECEIVER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // // Start sending data.
+ // result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ // ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ //orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+ RECEIVER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Receiver, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Receiver, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.h b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.h
new file mode 100644
index 00000000000..539f43b8b43
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/receiver.h
@@ -0,0 +1,146 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+
+private:
+ Receiver_Callback callback_;
+ // Receiver application callback.
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ // Constructor
+
+ ~Receiver (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ TAO_AV_Protocol_Object * protocol_object (void);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ FILE * input_file (void);
+
+protected:
+ TAO_Naming_Client naming_client_;
+ // The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reactive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ // Receiver MMDevice.
+
+ int frame_rate_;
+ // Rate at which the data will be sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+};
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl
new file mode 100755
index 00000000000..efe05403c37
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl
@@ -0,0 +1,71 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib $ENV{"ACE_ROOT"}.'/bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$outfile = PerlACE::LocalFile ("output");
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+unlink $nsior;
+
+$NS = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/Naming_Service/Naming_Service", "-o $nsior");
+$SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -f output");
+$CL = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -f $input -r 2");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 5) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Receiver\n";
+
+$SV->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender\n";
+
+$sender = $CL->SpawnWaitKill (200);
+
+if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+$receiver = $SV->TerminateWaitKill (5);
+
+if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.cpp
new file mode 100644
index 00000000000..2e806a208a2
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.cpp
@@ -0,0 +1,518 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+// Create a singleton instance of the Sender.
+
+static FILE *output_file = 0;
+// File handle of the file into which received data is written.
+
+static const char *output_file_name = "output";
+// File name of the file into which received data is written.
+
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ SENDER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Sender_Callback::Sender_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+int
+Sender_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ if (SENDER::instance ()->eof () == 1)
+ SENDER::instance ()->shutdown ();
+ return 0;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ streamctrl_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ protocol_ ("UDP"),
+ frame_rate_ (30),
+ mb_ (BUFSIZ),
+ eof_ (0)
+{
+}
+
+void
+Sender::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Sender::eof (void)
+{
+ return this->eof_;
+}
+
+void
+Sender::shutdown (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Shut the orb down.
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "shutdown\n");
+ }
+ ACE_ENDTRY;
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:p:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'p':
+ this->protocol_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+// Method to get the object reference of the receiver
+int
+Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Resolve the receiver object reference from the Naming Service
+ CORBA::Object_var receiver_mmdevice_obj =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->receiver_mmdevice_ =
+ AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->receiver_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Receiver_MMdevice in Naming service <%s>\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the naming services
+ result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Resolve the object reference of the receiver from the Naming Service.
+ result = this->bind_to_receiver (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry ("Data_Receiver",
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ 0);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (2);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry1 ("Data_Receiver1",
+ "OUT",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ 0);
+
+ flow_spec [1] = CORBA::string_dup (entry1.entry_to_string ());
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->streamctrl_,
+ TAO_StreamCtrl,
+ -1);
+
+ PortableServer::ServantBase_var safe_streamctrl =
+ this->streamctrl_;
+
+ // Bind/Connect the sender and receiver MMDevices.
+ CORBA::Boolean bind_result =
+ this->streamctrl_->bind_devs (mmdevice.in (),
+ this->receiver_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (bind_result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "streamctrl::bind_devs failed\n"),
+ -1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The time that should lapse between two consecutive frames sent.
+ ACE_Time_Value inter_frame_time;
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1 / (double) this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %d / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ this->eof_ = 1;
+ break;
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ // Send frame.
+ int result =
+ this->protocol_object_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ } // end while
+
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Shut the orb down.
+ //TAO_AV_CORE::instance ()->orb ()->shutdown (1,
+ // ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ //ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ // "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+/* TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER); */
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (), root_poa.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Sender.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::init failed\n"),
+ -1);
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ // Start sending data.
+ result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_Time_Value tv(3,0);
+ orb->run (tv);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.h b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.h
new file mode 100644
index 00000000000..16a78c88b96
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Bidirectional_Flows/sender.h
@@ -0,0 +1,150 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Sender_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Sender_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ // int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+};
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ Sender_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ // = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Method to pace and send data from a file.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ int eof (void);
+
+ void shutdown (void);
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ int bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL);
+ // Method that binds the sender to the receiver.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ // The endpoint strategy used by the sender.
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ // The receiver MMDevice that the sender connects to.
+
+ TAO_MMDevice *sender_mmdevice_;
+ // The sender MMDevice.
+
+ TAO_StreamCtrl *streamctrl_;
+ // Stream controller
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ ACE_CString protocol_;
+ // Selected protocol - default is UDP
+
+ int frame_rate_;
+ // Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+
+ int eof_;
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/AVS_Component_Switching.mpc b/TAO/orbsvcs/tests/AVStreams/Component_Switching/AVS_Component_Switching.mpc
new file mode 100644
index 00000000000..09123c1dc14
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/AVS_Component_Switching.mpc
@@ -0,0 +1,30 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe, strategies {
+ exename = sender
+
+ Source_Files {
+ Connection_Manager.cpp
+ sender.cpp
+ }
+}
+
+project(*dist): avstreamsexe, strategies {
+ exename = distributer
+
+ Source_Files {
+ Connection_Manager.cpp
+ distributer.cpp
+ }
+}
+
+project(*recv): avstreamsexe, strategies {
+ exename = receiver
+
+ Source_Files {
+ Connection_Manager.cpp
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.cpp b/TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.cpp
new file mode 100644
index 00000000000..c532f635976
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.cpp
@@ -0,0 +1,645 @@
+//$Id$
+
+#include "Connection_Manager.h"
+#include "tao/debug.h"
+
+Connection_Manager::Connection_Manager (void)
+{
+}
+
+Connection_Manager::~Connection_Manager (void)
+{
+}
+
+int
+Connection_Manager::init (CORBA::ORB_ptr orb)
+{
+ // Initialize the naming service
+ if (this->naming_client_.init (orb) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+ return 0;
+}
+
+void
+Connection_Manager::bind_to_receivers (const ACE_CString &sender_name,
+ AVStreams::MMDevice_ptr sender
+ ACE_ENV_ARG_DECL)
+{
+ this->sender_name_ =
+ sender_name;
+
+ this->sender_ =
+ AVStreams::MMDevice::_duplicate (sender);
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ ACE_TRY
+ {
+ // Try binding the sender context in the NS
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ this->sender_context_ =
+ this->naming_client_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // We reach here if there was no exception raised in
+ // <bind_new_context>. We then create a receiver context.
+ //
+
+ // Create the context for storing the receivers
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ // Try binding the receivers context under the sender context.
+ this->receiver_context_ =
+ this->sender_context_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, al_ex)
+ {
+ //
+ // The sender context already exists, probably created by the
+ // receiver(s).
+ //
+
+ // Get the sender context.
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ CORBA::Object_var object =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->sender_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ // Find the Receiver context.
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ object =
+ this->sender_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->receiver_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ this->find_receivers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ // Register the sender object with the sender context.
+ this->sender_context_->rebind (name,
+ sender
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Connection_Manager::find_receivers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::BindingIterator_var iterator;
+ CosNaming::BindingList_var binding_list;
+ const CORBA::ULong chunk = 100;
+
+ // Get the list of receivers registered for this sender.
+ this->receiver_context_->list (chunk,
+ binding_list,
+ iterator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Add the receivers found in the bindinglist to the <receivers>.
+ this->add_to_receivers (binding_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!CORBA::is_nil (iterator.in ()))
+ {
+ CORBA::Boolean more = 1;
+
+ // Check to see if there are more receivers listed.
+ while (more)
+ {
+ more = iterator->next_n (chunk,
+ binding_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->add_to_receivers (binding_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+Connection_Manager::add_to_receivers (CosNaming::BindingList &binding_list
+ ACE_ENV_ARG_DECL)
+{
+ for (CORBA::ULong i = 0;
+ i < binding_list.length ();
+ i++)
+ {
+ // Get the receiver name from the binding list.
+ ACE_CString receiver_name =
+ binding_list [i].binding_name [0].id.in ();
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup (receiver_name.c_str ());
+
+ // Resolve the reference of the receiver from the receiver
+ // context.
+ CORBA::Object_var obj =
+ this->receiver_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+
+ AVStreams::MMDevice_var receiver_device =
+ AVStreams::MMDevice::_narrow (obj.in ());
+
+ // Add this receiver to the receiver map.
+ ACE_CString flowname =
+ this->sender_name_ +
+ "_" +
+ receiver_name;
+ this->receivers_.bind (flowname,
+ receiver_device);
+ }
+}
+
+void
+Connection_Manager::connect_to_receivers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Connect to all receivers that we know about.
+ for (Receivers::iterator iterator = this->receivers_.begin ();
+ iterator != this->receivers_.end ();
+ ++iterator)
+ {
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ ACE_CString flowname =
+ (*iterator).ext_id_;
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry sender_entry (flowname.c_str (),
+ "IN",
+ "USER_DEFINED",
+ "",
+ "UDP",
+ 0);
+
+ // Set the flow specification for the stream between receiver
+ // and distributer
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] =
+ CORBA::string_dup (sender_entry.entry_to_string ());
+
+ // Create the stream control for this stream.
+ TAO_StreamCtrl *streamctrl;
+ ACE_NEW (streamctrl,
+ TAO_StreamCtrl);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_streamctrl =
+ streamctrl;
+
+ // Register streamctrl.
+ AVStreams::StreamCtrl_var streamctrl_object =
+ streamctrl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Bind the flowname and the corresponding stream controller to
+ // the stream controller map
+ this->streamctrls_.bind (flowname,
+ streamctrl_object);
+
+ // Bind the sender and receiver MMDevices.
+ (void) streamctrl->bind_devs (this->sender_.in (),
+ (*iterator).int_id_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Connection_Manager::bind_to_sender (const ACE_CString &sender_name,
+ const ACE_CString &receiver_name,
+ AVStreams::MMDevice_ptr receiver
+ ACE_ENV_ARG_DECL)
+{
+ this->sender_name_ =
+ sender_name;
+
+ this->receiver_name_ =
+ receiver_name;
+
+ this->receiver_ =
+ AVStreams::MMDevice::_duplicate (receiver);
+
+ this->sender_ = 0 ;
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ int sender_context_exists = 0;
+
+ ACE_TRY
+ {
+ // Try binding the sender context in the NS
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ CORBA::Object_var object =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // We reach here if there was no exception raised in <resolve>.
+ // Therefore, there must be a valid sender context available.
+ //
+ sender_context_exists = 1;
+
+ this->sender_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ // Find the receivers context under the sender's context
+ object =
+ this->sender_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->receiver_context_ =
+ CosNaming::NamingContext::_narrow (object.in ());
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ // Create the sender context
+ this->sender_context_ =
+ this->naming_client_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ // Create the receivers context under the sender's context
+ this->receiver_context_ =
+ this->sender_context_->bind_new_context (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ //
+ // At this point we either have resolved the receiver context or we
+ // have created a new one.
+ //
+ name [0].id =
+ CORBA::string_dup (this->receiver_name_.c_str ());
+
+ // Register this receiver object under the receiver context.
+ this->receiver_context_->rebind (name,
+ receiver
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ //
+ // Check if the sender was registered. Note that if we created the
+ // sender context, there is no point in checking for the sender.
+ //
+ if (sender_context_exists)
+ {
+ ACE_TRY_EX(SENDER_CONTEXT_EXISTS)
+ {
+ // Try binding the sender under the sender context
+ name [0].id =
+ CORBA::string_dup (this->sender_name_.c_str ());
+
+ CORBA::Object_var object =
+ this->sender_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(SENDER_CONTEXT_EXISTS);
+
+ this->sender_ =
+ AVStreams::MMDevice::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(SENDER_CONTEXT_EXISTS);
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ // No problem if the sender was not there.
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+void
+Connection_Manager::connect_to_sender (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->sender_.in ()))
+ return;
+
+ ACE_CString flowname =
+ this->sender_name_ +
+ "_" +
+ this->receiver_name_;
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry sender_entry (flowname.c_str (),
+ "IN",
+ "USER_DEFINED",
+ "",
+ "UDP",
+ 0);
+
+ // Set the flow specification for the stream between sender and
+ // receiver.
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] =
+ CORBA::string_dup (sender_entry.entry_to_string ());
+
+ // Create the stream control for this stream
+ TAO_StreamCtrl* streamctrl;
+ ACE_NEW (streamctrl,
+ TAO_StreamCtrl);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_streamctrl =
+ streamctrl;
+
+ // Register streamctrl.
+ AVStreams::StreamCtrl_var streamctrl_object =
+ streamctrl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ //
+ // Since senders terminate the streams, we don't need the streamctrl
+ // for these.
+ //
+ // this->streamctrls_.bind (flowname,
+ // streamctrl_object);
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Connect the sender and receiver devices.
+ CORBA::Boolean result =
+ streamctrl->bind_devs (this->sender_.in (),
+ this->receiver_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (result == 0)
+ ACE_ERROR ((LM_ERROR,
+ "Streamctrl::bind_devs failed\n"));
+
+ // Start the data sending.
+ AVStreams::flowSpec start_spec;
+ streamctrl->start (start_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Connection_Manager::add_streamctrl (const ACE_CString &flowname,
+ TAO_StreamEndPoint *endpoint
+ ACE_ENV_ARG_DECL)
+{
+ // Get the stream controller for this endpoint.
+ CORBA::Any_var streamctrl_any =
+ endpoint->get_property_value ("Related_StreamCtrl"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ AVStreams::StreamCtrl_ptr streamctrl;
+
+ if( streamctrl_any.in() >>= streamctrl )
+ {
+ // the CORBA::Any_var owns the pointer, so we should
+ // _duplicate it before passing it around
+ AVStreams::StreamCtrl::_duplicate( streamctrl );
+ this->streamctrls_.unbind(flowname);
+ this->streamctrls_.bind (flowname,
+ streamctrl);
+ }
+}
+
+
+void
+Connection_Manager::destroy (const ACE_CString &flowname
+ ACE_ENV_ARG_DECL)
+{
+ this->protocol_objects_.unbind (flowname);
+ this->receivers_.unbind (flowname);
+
+ this->streamctrls_.unbind(flowname);
+ ACE_CHECK;
+}
+
+void
+Connection_Manager::unbind_sender (const ACE_CString &sender_name,
+ AVStreams::MMDevice_ptr sender_mmdevice_obj
+ ACE_ENV_ARG_DECL)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Connection_Manager::unbind_sender\n"));
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ // Try binding the sender context in the NS
+ name [0].id =
+ CORBA::string_dup (sender_name.c_str ());
+
+ ACE_TRY
+ {
+ CORBA::Object_var object =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var sender_context =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender Context Found\n"));
+
+ ACE_TRY_EX (Resolve_Sender)
+ {
+ object =
+ sender_context->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (Resolve_Sender);
+
+ AVStreams::MMDevice_var mmdevice =
+ AVStreams::MMDevice::_narrow (object.in ());
+
+ if (mmdevice->_is_equivalent (sender_mmdevice_obj))
+ {
+ sender_context->unbind (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (Resolve_Sender);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender Unbound\n"));
+ }
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender object not found\n"));
+ // Do not have to unbind.
+ }
+ ACE_ENDTRY;
+
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender Context Not Found\n"));
+ // Do not have to unbind.
+ }
+ ACE_ENDTRY;
+
+}
+
+void
+Connection_Manager::unbind_receiver (const ACE_CString &sender_name,
+ const ACE_CString &receiver_name,
+ AVStreams::MMDevice_ptr receiver_mmdevice)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Connection_Manager::unbind_receiver\n"));
+
+ CosNaming::Name name (1);
+ name.length (1);
+
+ // Try binding the sender context in the NS
+ name [0].id =
+ CORBA::string_dup (sender_name.c_str ());
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var object =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var sender_context =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender Context Found\n"));
+
+ ACE_TRY_EX (Resolve_Receiver)
+ {
+ name [0].id =
+ CORBA::string_dup ("Receivers");
+
+ object =
+ sender_context->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (Resolve_Receiver);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Receivers Context Found\n"));
+
+ CosNaming::NamingContext_var receivers_context =
+ CosNaming::NamingContext::_narrow (object.in ());
+
+ name [0].id =
+ CORBA::string_dup (receiver_name.c_str ());
+
+ object =
+ receivers_context->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (Resolve_Receiver);
+
+ AVStreams::MMDevice_var mmdevice =
+ AVStreams::MMDevice::_narrow (object.in ());
+
+ if (mmdevice->_is_equivalent (receiver_mmdevice))
+ {
+ receivers_context->unbind (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (Resolve_Receiver);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver Unbound\n"));
+ }
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver Not found\n"));
+ // Do not have to unbind.
+ }
+ ACE_ENDTRY;
+
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, al_ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender Context Not Found\n"));
+ // Do not have to unbind.
+ }
+ ACE_ENDTRY;
+
+}
+
+Connection_Manager::Receivers &
+Connection_Manager::receivers (void)
+{
+ return this->receivers_;
+}
+
+Connection_Manager::Protocol_Objects &
+Connection_Manager::protocol_objects (void)
+{
+ return this->protocol_objects_;
+}
+
+Connection_Manager::StreamCtrls &
+Connection_Manager::streamctrls (void)
+{
+ return this->streamctrls_;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.h b/TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.h
new file mode 100644
index 00000000000..5af3fec6390
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/Connection_Manager.h
@@ -0,0 +1,143 @@
+//$Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Component_Switching
+//
+// = FILENAME
+// Connection_Manager.h
+//
+// = DESCRIPTION
+// This is a helper class that allows the senders bind to multiple
+// receivers and receivers to bind to senders. It also lets the
+// senders and receivers disconnect streams.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef CONNECTION_MANAGER_H
+#define CONNECTION_MANAGER_H
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "tao/PortableServer/PortableServer.h"
+
+class Connection_Manager
+{
+ // = TITLE
+ // Defines the Connection Manager.
+ //
+ // = DESCRIPTION
+ // This is a helper class that allows the senders bind to
+ // multiple receivers and receivers to bind to senders. It also
+ // lets the senders and receivers disconnect streams.
+public:
+
+ Connection_Manager (void);
+ // Constructor
+
+ ~Connection_Manager (void);
+ // Destructor
+
+ int init (CORBA::ORB_ptr orb);
+ // Initialize this class.
+
+ void bind_to_receivers (const ACE_CString &sender_name,
+ AVStreams::MMDevice_ptr sender
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Method that binds the sender to the Naming Service and retreives
+ // the references of any registered receivers.
+
+ void connect_to_receivers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Connect to the receivers that we found.
+
+ void bind_to_sender (const ACE_CString &sender_name,
+ const ACE_CString &receiver_name,
+ AVStreams::MMDevice_ptr receiver
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Bind receiver to the sender.
+
+ void connect_to_sender (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // Connect to the sender that we found.
+
+ void destroy (const ACE_CString &flowname
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Destroy streams associated with <flowname>.
+
+ void unbind_sender (const ACE_CString &sender_name,
+ AVStreams::MMDevice_ptr sender_mmdevice
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS) ;
+ // Unbind the sender from the Naming Service
+
+ void unbind_receiver (const ACE_CString &sender_name,
+ const ACE_CString &receiver_name,
+ AVStreams::MMDevice_ptr receiver_mmdevice);
+ // Unbind the Receiver from the Naming Service
+
+ void add_streamctrl (const ACE_CString &flowname,
+ TAO_StreamEndPoint *endpoint
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Add new streamctrl.
+
+ // Map of receivers.
+ typedef ACE_Hash_Map_Manager<ACE_CString,
+ AVStreams::MMDevice_var,
+ ACE_Null_Mutex>
+ Receivers;
+
+ // Map of protocol objects.
+ typedef ACE_Hash_Map_Manager<ACE_CString,
+ TAO_AV_Protocol_Object *,
+ ACE_Null_Mutex>
+ Protocol_Objects;
+
+ // Map of streamctrl.
+ typedef ACE_Hash_Map_Manager<ACE_CString,
+ AVStreams::StreamCtrl_var,
+ ACE_Null_Mutex>
+ StreamCtrls;
+
+ // Map accessors.
+ Receivers &receivers (void);
+ Protocol_Objects &protocol_objects (void);
+ StreamCtrls &streamctrls (void);
+
+protected:
+
+ void find_receivers (ACE_ENV_SINGLE_ARG_DECL);
+
+ void add_to_receivers (CosNaming::BindingList &binding_list
+ ACE_ENV_ARG_DECL);
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ // The maps.
+ Receivers receivers_;
+ Protocol_Objects protocol_objects_;
+ StreamCtrls streamctrls_;
+
+ // Sender name.
+ ACE_CString sender_name_;
+
+ // Sender device.
+ AVStreams::MMDevice_var sender_;
+
+ // Sender context.
+ CosNaming::NamingContext_var sender_context_;
+
+ // Receiver name.
+ ACE_CString receiver_name_;
+
+ // Receiver device.
+ AVStreams::MMDevice_var receiver_;
+
+ // Receiver context.
+ CosNaming::NamingContext_var receiver_context_;
+};
+
+#endif /*CONNECTION_MANAGER_H*/
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Component_Switching/Makefile.am
new file mode 100644
index 00000000000..c003c046e46
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/Makefile.am
@@ -0,0 +1,126 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Component_Switching_Dist.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += distributer
+
+distributer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+distributer_SOURCES = \
+ Connection_Manager.cpp \
+ distributer.cpp \
+ Connection_Manager.h \
+ distributer.h
+
+distributer_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Component_Switching_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ Connection_Manager.cpp \
+ receiver.cpp \
+ Connection_Manager.h \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Component_Switching_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ Connection_Manager.cpp \
+ sender.cpp \
+ Connection_Manager.h \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/README b/TAO/orbsvcs/tests/AVStreams/Component_Switching/README
new file mode 100644
index 00000000000..df2cefe3967
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/README
@@ -0,0 +1,66 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a three stage AV test with the ability to
+aynschronously start the processes in any order and to be able to
+switch distributers and senders. It also supports multiple receivers for a sender.
+The stages are:
+
+a. Sender
+b. Distributer
+c. Receiver
+
+This test has a sender process that reads data from a file and sends
+it to the distributer. The distributer acts as a conduit. It receives
+data from the sender and sends it immediately to the receiver process.
+
+Running the test
+----------------
+
+Start the Naming Service
+
+Start the following processes in any order.
+
+sender
+------
+
+sender [-f <filename>] [-r <data_rate>] [-s <sender name>]
+
+-f filename --> The name of the file from which data needs to be sent
+
+-r data_rate --> The rate at which the data needs to be paced.
+
+-s sender name --> This is the name of the sender as it will be
+ registered with the naming service and which
+ receivers connect to.
+
+receiver
+--------
+
+receiver [-f <filename>] [-s <sender name>] [-r <receiver name>]
+
+-f filename --> File into which the data received from the distributer is stored.
+
+-s sender name --> This is the name of the sender that the xreceiver
+ wants to connect to.
+
+-r receiver name --> This is the name with which this receiver will be
+ registered with the naming service.
+
+distributer:
+-----------
+
+distributer [-s <sender name>] [-r <distributer name>]
+
+-s sender name --> This is the name of the sender that the receiver
+ wants to connect to.
+
+-r distributer name --> This is the name with which this distributer
+ will be registered with the naming
+ service. The receivers will bind with this
+ name to receieve data from this distributer.
+
+When you start another distributer, the sender will switch to the new
+distributer. See run_test.pl for details.
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf b/TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf
new file mode 100644
index 00000000000..05579a12523
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf
@@ -0,0 +1,8 @@
+# $Id$
+#
+
+# This configuration file is used to use only the default TAO
+# strategies
+
+static Advanced_Resource_Factory "-ORBReactorType select_mt"
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf.xml b/TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf.xml
new file mode 100644
index 00000000000..d838f4e9eeb
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/AVStreams/Component_Switching/components_svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <!-- -->
+ <!-- This configuration file is used to use only the default TAO -->
+ <!-- strategies -->
+ <static id="Advanced_Resource_Factory" params="-ORBReactorType select_mt"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.cpp b/TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.cpp
new file mode 100644
index 00000000000..bcc4f71458d
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.cpp
@@ -0,0 +1,512 @@
+// $Id$
+
+#include "distributer.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+
+#include "tao/Strategies/advanced_resource.h"
+
+typedef ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex> DISTRIBUTER;
+
+// constructor.
+Signal_Handler::Signal_Handler (void)
+{
+}
+
+int
+Signal_Handler::handle_signal (int signum, siginfo_t *, ucontext_t*)
+{
+ if (signum == SIGINT)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "In the signal handler\n"));
+
+ DISTRIBUTER::instance ()->done (1);
+
+ }
+ return 0;
+}
+
+int
+Distributer_Sender_StreamEndPoint::get_callback (const char *flow_name,
+ TAO_AV_Callback *&callback)
+{
+ /// Create and return the sender application callback to AVStreams
+ /// for further upcalls.
+ callback = &this->callback_;
+
+ ACE_CString fname = flow_name;
+
+ this->callback_.flowname (fname);
+
+ return 0;
+}
+
+int
+Distributer_Sender_StreamEndPoint::set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object)
+{
+ Connection_Manager &connection_manager =
+ DISTRIBUTER::instance ()->connection_manager ();
+
+ /// Add to the map of protocol objects.
+ connection_manager.protocol_objects ().bind (flowname,
+ object);
+
+ /// Store the related streamctrl.
+ connection_manager.add_streamctrl (flowname,
+ this);
+
+ return 0;
+}
+
+int
+Distributer_Receiver_StreamEndPoint::get_callback (const char *flow_name,
+ TAO_AV_Callback *&callback)
+{
+ /// Create and return the receiver application callback to AVStreams
+ /// for further upcalls.
+ callback = &this->callback_;
+
+ ACE_CString flowname (flow_name);
+ this->callback_.flowname (flowname);
+
+ return 0;
+}
+
+int
+Distributer_Receiver_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *)
+{
+ /// Increment the stream count.
+ DISTRIBUTER::instance ()->stream_created ();
+
+ return 0;
+}
+
+CORBA::Boolean
+Distributer_Receiver_StreamEndPoint::handle_connection_requested (AVStreams::flowSpec &flowspec
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ //if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Receiver_StreamEndPoint::handle_connection_requested\n"));
+
+ Connection_Manager &connection_manager =
+ DISTRIBUTER::instance ()->connection_manager ();
+
+ /// Check to see if the flow already exists. If it does then close the
+ /// old connection and setup a new one with the new sender.
+
+ for (CORBA::ULong i = 0;
+ i < flowspec.length ();
+ i++)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (flowspec[i]);
+
+ //if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Handle Conection Requested flowname %s \n",
+ entry.flowname ()));
+
+ ACE_CString flowname (entry.flowname ());
+
+ int result =
+ connection_manager.streamctrls ().find (flowname);
+
+ /// If the flowname is found.
+ if (result == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "\nDistributer switching senders handle connection requested\n\n"));
+
+ ///Destroy old stream with the same flowname.
+ connection_manager.destroy (flowname);
+
+ }
+
+ /// Store the related streamctrl.
+ connection_manager.add_streamctrl (flowname.c_str (),
+ this);
+
+ }
+ return 1;
+
+}
+
+
+Distributer_Receiver_Callback::Distributer_Receiver_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+ACE_CString &
+Distributer_Receiver_Callback::flowname (void)
+{
+ return this->flowname_;
+}
+
+void
+Distributer_Receiver_Callback::flowname (const ACE_CString &flowname)
+{
+ this->flowname_ = flowname;
+}
+
+
+int
+Distributer_Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ /// Upcall from the AVStreams when there is data to be received from
+ /// the sender.
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ Connection_Manager::Protocol_Objects &protocol_objects =
+ DISTRIBUTER::instance ()->connection_manager ().protocol_objects ();
+
+ /// Send frame to all receivers.
+ for (Connection_Manager::Protocol_Objects::iterator iterator = protocol_objects.begin ();
+ iterator != protocol_objects.end ();
+ ++iterator)
+ {
+ int result =
+ (*iterator).int_id_->send_frame (frame);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+Distributer_Receiver_Callback::handle_destroy (void)
+{
+ /// Called when the sender requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Receiver_Callback::end_stream\n"));
+
+ DISTRIBUTER::instance ()->connection_manager ().streamctrls ().unbind (this->flowname_.c_str ());
+
+ /// Decrement the stream count.
+ DISTRIBUTER::instance ()->stream_destroyed ();
+
+ return 0;
+}
+
+ACE_CString &
+Distributer_Sender_Callback::flowname (void)
+{
+ return this->flowname_;
+}
+
+void
+Distributer_Sender_Callback::flowname (const ACE_CString &flowname)
+{
+ this->flowname_ = flowname;
+}
+
+int
+Distributer_Sender_Callback::handle_destroy (void)
+{
+ /// Called when the sender requests the stream to be shutdown.
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Sender_Callback::end_stream\n"));
+
+ DISTRIBUTER::instance ()->connection_manager ().protocol_objects ().unbind (this->flowname_.c_str ());
+
+ DISTRIBUTER::instance ()->connection_manager ().streamctrls ().unbind (this->flowname_.c_str ());
+
+ DISTRIBUTER::instance ()->connection_manager ().receivers ().unbind (this->flowname_.c_str ());
+
+ return 0;
+}
+
+Distributer::Distributer (void)
+ : sender_name_ ("sender"),
+ distributer_name_ ("distributer"),
+ done_ (0),
+ stream_count_ (0)
+{
+}
+
+Distributer::~Distributer (void)
+{
+}
+
+void
+Distributer::stream_created (void)
+{
+ this->stream_count_++;
+}
+
+void
+Distributer::stream_destroyed (void)
+{
+ this->stream_count_--;
+
+ if (this->stream_count_ == 0)
+ this->done_ = 1;
+}
+
+
+Connection_Manager &
+Distributer::connection_manager (void)
+{
+ return this->connection_manager_;
+}
+
+int
+Distributer::parse_args (int argc,
+ char **argv)
+{
+ /// Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "s:r:");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 's':
+ this->sender_name_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->distributer_name_ = opts.opt_arg ();
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG,"Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+
+int
+Distributer::init (int argc,
+ char ** argv
+ ACE_ENV_ARG_DECL)
+{
+ /// Initialize the connection class.
+ int result =
+ this->connection_manager_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ /// Initialize the endpoint strategy with the orb and poa.
+ result =
+ this->sender_endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ result =
+ this->receiver_endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ /// Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ ACE_Reactor *reactor =
+ TAO_AV_CORE::instance ()->reactor ();
+
+ if (reactor->register_handler (SIGINT,
+ &this->signal_handler_) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in handler register\n"),
+ -1);
+ /// Register the signal handler for clean termination of the process.
+
+ ACE_NEW_RETURN (this->distributer_sender_mmdevice_,
+ TAO_MMDevice (&this->sender_endpoint_strategy_),
+ -1);
+
+ /// Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_sender_mmdevice =
+ this->distributer_sender_mmdevice_;
+
+ AVStreams::MMDevice_var distributer_sender_mmdevice =
+ this->distributer_sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->distributer_receiver_mmdevice_,
+ TAO_MMDevice (&this->receiver_endpoint_strategy_),
+ -1);
+
+ /// Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_receiver_mmdevice =
+ this->distributer_receiver_mmdevice_;
+
+ AVStreams::MMDevice_var distributer_receiver_mmdevice =
+ this->distributer_receiver_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ /// Bind to sender.
+ this->connection_manager_.bind_to_sender (this->sender_name_,
+ this->distributer_name_,
+ distributer_receiver_mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /// Connect to sender.
+ this->connection_manager_.connect_to_sender (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /// Bind to receivers.
+ this->connection_manager_.bind_to_receivers (this->distributer_name_,
+ distributer_sender_mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /// Connect to receivers
+ this->connection_manager_.connect_to_receivers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Distributer::done (void) const
+{
+ return this->done_;
+}
+
+void
+Distributer::shut_down (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ AVStreams::MMDevice_var receiver_mmdevice =
+ this->distributer_receiver_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DISTRIBUTER::instance ()->connection_manager ().unbind_receiver (this->sender_name_,
+ this->distributer_name_,
+ receiver_mmdevice.in ());
+ AVStreams::MMDevice_var sender_mmdevice =
+ this->distributer_sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DISTRIBUTER::instance ()->connection_manager ().unbind_sender (this->distributer_name_,
+ sender_mmdevice.in ());
+
+ // DISTRIBUTER::instance ()->connection_manager ().destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ // ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Distributer::shut_down");
+ }
+ ACE_ENDTRY;
+}
+
+void
+Distributer::done (int done)
+{
+ this->done_ = done;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ /// Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Initialize the Distributer
+ int result =
+ DISTRIBUTER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ while (!DISTRIBUTER::instance ()->done ())
+ {
+ CORBA::Boolean wp = orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (wp)
+ {
+ orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ }
+ }
+
+ DISTRIBUTER::instance ()->shut_down (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+// orb->shutdown(1 ACE_ENV_ARG_PARAMETER);
+// ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"main");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ DISTRIBUTER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.h b/TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.h
new file mode 100644
index 00000000000..ab6f4753a14
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/distributer.h
@@ -0,0 +1,233 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Component_Switching
+//
+// = FILENAME
+// distributer.h
+//
+// = DESCRIPTION
+// Process to receive data from the sender and send it to the
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "Connection_Manager.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Signal_Handler : public ACE_Event_Handler
+{
+ // TITLE
+ // This class Handles the SIGINT signal through the Reactor.
+ // Useful to gracefully release the process
+
+public:
+
+ Signal_Handler (void);
+
+ int handle_signal(int signum, siginfo_t*,ucontext_t*);
+ // Override this method to implement graceful shutdown.
+
+};
+
+
+class Distributer_Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Distributer_Receiver_Callback (void);
+ /// Constructor.
+
+ /// Method that is called when there is data to be received from a
+ /// sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ /// Called when the sender is done sending data and wants to close
+ /// down the connection.
+ int handle_destroy (void);
+
+ /// Accessor methods for the flowname of the callback.
+ ACE_CString &flowname (void);
+ void flowname (const ACE_CString &flowname);
+
+private:
+ int frame_count_;
+ /// Count of the frames passing through us.
+
+ ACE_CString flowname_;
+ /// Flowname of the flow.
+};
+
+class Distributer_Sender_Callback : public TAO_AV_Callback
+{
+ /// = TITLE
+ // Defines a class for the distributer application callback
+ // for receiving data.
+ //
+ // = DESCRIPTION
+ // This class overides the methods of the TAO_AV_Callback so the
+ // AVStreams can make upcalls to the application.
+
+public:
+
+ int handle_destroy (void);
+ /// Called when the sender has finished reading the file and wants
+ /// to close down the connection.
+
+ /// Accessor methods for the flowname of the callback.
+ ACE_CString &flowname (void);
+ void flowname (const ACE_CString &flowname);
+
+private:
+
+ ACE_CString flowname_;
+
+};
+
+class Distributer_Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ /// Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+ int set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object);
+ /// Store the reference to the protocol object corresponding
+ /// to the transport
+
+ virtual CORBA::Boolean handle_connection_requested (AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Called when a sender makes a connection request.
+
+private:
+ Distributer_Receiver_Callback callback_;
+ /// Receiver application callback.
+};
+
+class Distributer_Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ /// = TITLE
+ /// Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ /// Create the application callback and return its handle to
+ /// AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ /// Set protocol object corresponding to the transport protocol
+ /// chosen.
+
+protected:
+ Distributer_Sender_Callback callback_;
+ /// Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Distributer_Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_B
+ <Distributer_Receiver_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ RECEIVER_ENDPOINT_STRATEGY;
+
+class Distributer
+{
+ // = TITLE
+ // Distributer Application.
+ //
+ // = DESCRIPTION
+ // The distributer is the intermediate receiver that receives
+ // data from the sender and forwards to a receiver.
+public:
+ Distributer (void);
+ /// Constructor
+
+ ~Distributer (void);
+ /// Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Initialize data components.
+
+ int parse_args (int argc,
+ char **argv);
+ /// Parse args.
+
+ /// Flag to know when we are done.
+ int done (void) const;
+ void done (int);
+
+ Connection_Manager &connection_manager (void);
+ /// Accessor to connection manager.
+
+ void stream_created (void);
+ /// Called when stream created
+
+ void stream_destroyed (void);
+ /// Called when stream destroyed
+
+ void shut_down (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ ///Unbind the sender and receiver from the Naming Service
+
+protected:
+ Connection_Manager connection_manager_;
+ /// Connection manager.
+
+ SENDER_ENDPOINT_STRATEGY sender_endpoint_strategy_;
+ /// The sender endpoint strategy.
+
+ RECEIVER_ENDPOINT_STRATEGY receiver_endpoint_strategy_;
+ /// The receiver endpoint strategy.
+
+ TAO_MMDevice* distributer_receiver_mmdevice_;
+ /// The distributer receiver multimedia device
+
+ TAO_MMDevice* distributer_sender_mmdevice_;
+ /// The distributer receiver multimedia device
+
+ ACE_CString sender_name_;
+ /// The name of the sender to connect to.
+
+ ACE_CString distributer_name_;
+ /// Our name.
+
+ int done_;
+ /// Flag to know when we are done.
+
+ int stream_count_;
+ /// Number of active streams. When a stream is disconnected this
+ /// count is decremented.
+
+ Signal_Handler signal_handler_;
+ /// Reference to the signal handler.
+
+};
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.cpp
new file mode 100644
index 00000000000..573fdb12f34
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.cpp
@@ -0,0 +1,376 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+
+#include "tao/Strategies/advanced_resource.h"
+
+static FILE *output_file = 0;
+/// File handle of the file into which received data is written.
+
+static int done = 0;
+/// Flag set when a signal is raised.
+
+// constructor.
+Signal_Handler::Signal_Handler (void)
+{
+}
+
+int
+Signal_Handler::handle_signal (int signum, siginfo_t *, ucontext_t*)
+{
+ if (signum == SIGINT)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "In the signal handler\n"));
+
+ done = 1;
+ }
+ return 0;
+}
+
+
+Connection_Manager *connection_manager;
+
+int
+Receiver_StreamEndPoint::get_callback (const char *flow_name,
+ TAO_AV_Callback *&callback)
+{
+ /// Return the receiver application callback to the AVStreams for
+ /// future upcalls.
+ callback = &this->callback_;
+
+ ACE_CString fname = flow_name;
+ this->callback_.flowname (fname);
+ return 0;
+}
+
+CORBA::Boolean
+Receiver_StreamEndPoint::handle_connection_requested (AVStreams::flowSpec &flowspec
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "In Handle Conection Requested \n"));
+
+ for (CORBA::ULong i = 0;
+ i < flowspec.length ();
+ i++)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (flowspec[i]);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Handle Conection Requested flowname %s \n",
+ entry.flowname ()));
+
+ ACE_CString flowname (entry.flowname ());
+
+ /// Store the related streamctrl.
+ connection_manager->add_streamctrl (flowname.c_str (),
+ this);
+
+ }
+ return 1;
+
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+ACE_CString &
+Receiver_Callback::flowname (void)
+{
+ return this->flowname_;
+}
+
+void
+Receiver_Callback::flowname (const ACE_CString &flowname)
+{
+ this->flowname_ = flowname;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ /// Called when the sender requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::end_stream\n"));
+
+ /// Remove the related stream control reference.
+ connection_manager->streamctrls ().unbind (this->flowname_.c_str ());
+
+ return 0;
+}
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ ///
+ /// Upcall from the AVStreams when there is data to be received from
+ /// the sender.
+ ///
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ while (frame != 0)
+ {
+ /// Write the received data to the file.
+ int result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == (signed) frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0),
+ output_file_name_ ("output"),
+ sender_name_ ("distributer"),
+ receiver_name_ ("receiver")
+{
+}
+
+Receiver::~Receiver (void)
+{
+
+}
+
+ACE_CString
+Receiver::sender_name (void)
+{
+ return this->sender_name_;
+}
+
+ACE_CString
+Receiver::receiver_name (void)
+{
+ return this->receiver_name_;
+}
+
+int
+Receiver::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ /// Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ /// Initialize the connection manager.
+ result =
+ this->connection_manager_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ connection_manager = &this->connection_manager_;
+
+ ACE_Reactor *reactor =
+ TAO_AV_CORE::instance ()->reactor ();
+
+ if (reactor->register_handler (SIGINT,
+ &this->signal_handler_) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in handler register\n"),
+ -1);
+ /// Register the signal handler for clean termination of the process.
+
+ /// Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ /// Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /// Bind to sender.
+ this->connection_manager_.bind_to_sender (this->sender_name_,
+ this->receiver_name_,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /// Connect to the sender.
+ this->connection_manager_.connect_to_sender (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Receiver::parse_args (int argc,
+ char **argv)
+{
+ /// Parse the command line arguments
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:s:r:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->output_file_name_ = opts.opt_arg ();
+ break;
+ case 's':
+ this->sender_name_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->receiver_name_ = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: receiver -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+ACE_CString
+Receiver::output_file_name (void)
+{
+ return this->output_file_name_;
+}
+
+void
+Receiver::shut_down (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ AVStreams::MMDevice_var mmdevice_obj =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ this->connection_manager_.unbind_receiver (this->sender_name_,
+ this->receiver_name_,
+ mmdevice_obj.in ());
+
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Receiver::shut_down");
+ }
+ ACE_ENDTRY;
+
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ /// Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Receiver receiver;
+ int result =
+ receiver.parse_args (argc,
+ argv);
+ if (result == -1)
+ return -1;
+
+ /// Make sure we have a valid <output_file>
+ output_file =
+ ACE_OS::fopen (receiver.output_file_name ().c_str (),
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ receiver.output_file_name ().c_str ()),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ result =
+ receiver.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ while (!done)
+ {
+ orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ receiver.shut_down (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_OS::fclose (output_file);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.h b/TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.h
new file mode 100644
index 00000000000..19a9c673b8c
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/receiver.h
@@ -0,0 +1,154 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Component_Switching
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "Connection_Manager.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Signal_Handler : public ACE_Event_Handler
+{
+ // TITLE
+ // This class Handles the SIGINT signal through the Reactor.
+ // Useful to gracefully release the process
+
+public:
+
+ Signal_Handler (void);
+
+ int handle_signal(int signum, siginfo_t*,ucontext_t*);
+ // Override this method to implement graceful shutdown.
+
+};
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ /// Constructor.
+
+ /// Method that is called when there is data to be received from a
+ /// sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ int handle_destroy (void);
+
+ /// Accessor methods for the flowname of the callback.
+ ACE_CString &flowname (void);
+ void flowname (const ACE_CString &flowname);
+
+private:
+ int frame_count_;
+ /// Keeping a count of the incoming frames.
+
+ ACE_CString flowname_;
+ /// Flowname of the flow.
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ /// Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+ virtual CORBA::Boolean handle_connection_requested (AVStreams::flowSpec &the_spec
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Called when a distributor tries to connect to the receiver
+
+private:
+ Receiver_Callback callback_;
+ /// Receiver application callback.
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ /// Constructor
+
+ virtual ~Receiver (void);
+ /// Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Initialize data components.
+
+ int parse_args (int argc,
+ char **argv);
+ /// Parse args.
+
+ ACE_CString output_file_name (void);
+ /// Name of the output file.
+
+ ACE_CString sender_name (void);
+ ACE_CString receiver_name (void);
+
+ void shut_down (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+protected:
+ Connection_Manager connection_manager_;
+ /// Connection manager.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ /// The endpoint reactive strategy.
+
+ AVStreams::MMDevice_var mmdevice_obj_;
+ /// The receiver MMDevice.
+
+ TAO_MMDevice *mmdevice_;
+ /// Receiver MMDevice.
+
+ AVStreams::MMDevice_var sender_mmdevice_;
+ /// The sender MMDevice
+
+ ACE_CString output_file_name_;
+ /// File name of the file into which received data is written.
+
+ ACE_CString sender_name_;
+ /// Sender name.
+
+ ACE_CString receiver_name_;
+ /// Receiver name.
+
+ Signal_Handler signal_handler_;
+ /// Reference to the signal handler.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl
new file mode 100755
index 00000000000..de19cf0ba3c
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl
@@ -0,0 +1,164 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib $ENV{'ACE_ROOT'}."/bin";
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 5;
+$distributor_time = 8;
+$sender_time = 8;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$testfile = PerlACE::LocalFile ("output");
+$input = PerlACE::LocalFile ("test_input");
+
+unlink $nsior;
+unlink $testfile, $input;
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-ORBDottedDecimalAddresses 1 -o $nsior");
+$SV1 = new PerlACE::Process ("sender", "-ORBDottedDecimalAddresses 1 ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s sender -r 30 -f $input");
+$SV2 = new PerlACE::Process ("sender", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s sender -r 30 -f $input");
+$SV3 = new PerlACE::Process ("sender", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s sender -r 30 -f $input");
+$RE1 = new PerlACE::Process ("receiver", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s distributer -r receiver1 -f output1");
+$RE2 = new PerlACE::Process ("receiver", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s distributer -r receiver2 -f output2");
+$DI1 = new PerlACE::Process ("distributer", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s sender -r distributer");
+$DI2 = new PerlACE::Process ("distributer", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s sender -r distributer");
+$DI3 = new PerlACE::Process ("distributer", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s sender -r distributer");
+$DI4 = new PerlACE::Process ("distributer", " -ORBDottedDecimalAddresses 1 -ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -s sender -r distributer");
+
+print STDERR "\nReceiver 1 --> Receiver 2 --> Distributer 1 --> Sender1 --> Distributer 2 --> Distributer 3 --> Sender2 --> Sender3 --> Distributer4\n\n";
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Receiver 1\n";
+
+$RE1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Receiver 2\n";
+
+$RE2->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Distributer 1\n";
+
+$DI1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender1\n";
+
+$SV1->Spawn ();
+
+sleep $distributor_time;
+
+print STDERR "\nStarting Distributer 2\n\n";
+
+$DI2->Spawn ();
+
+sleep $distributor_time;
+
+print STDERR "\nStarting Distributer 3\n\n";
+
+$DI3->Spawn ();
+
+sleep $sender_time;
+
+print STDERR "Starting Sender2\n";
+
+$SV2->Spawn ();
+
+sleep $sender_time;
+
+print STDERR "Starting Sender3\n";
+
+$SV3->Spawn ();
+
+sleep $distributor_time;
+
+print STDERR "\nStarting Distributer 4\n\n";
+
+$DI4->Spawn ();
+
+$SV2->WaitKill (300);
+
+$SV3->WaitKill (300);
+
+$SV1->WaitKill ( 300 );
+
+$distributer3 = $DI3->TerminateWaitKill (5);
+
+if ($distributer3 != 0) {
+ print STDERR "ERROR: distributer3 returned $distributer3\n";
+ $status = 1;
+}
+
+$distributer2 = $DI2->TerminateWaitKill (5);
+
+if ($distributer2 != 0) {
+ print STDERR "ERROR: distributer2 returned $distributer2\n";
+ $status = 1;
+}
+
+$distributer1 = $DI1->TerminateWaitKill (5);
+
+if ($distributer1 != 0) {
+ print STDERR "ERROR: distributer1 returned $distributer1\n";
+ $status = 1;
+}
+
+$receiver1 = $RE1->TerminateWaitKill (5);
+
+if ($receiver1 != 0) {
+ print STDERR "ERROR: receiver1 returned $receiver1\n";
+ $status = 1;
+}
+
+$receiver2 = $RE2->TerminateWaitKill (5);
+
+if ($receiver2 != 0) {
+ print STDERR "ERROR: receiver2 returned $receiver2\n";
+ $status = 1;
+}
+
+$distributer4 = $DI4->TerminateWaitKill (5);
+if ($distributer4 != 0) {
+ print STDERR "ERROR: distributer4 returned $distributer4\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $testfile, $input;
+
+exit $status;
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.cpp
new file mode 100644
index 00000000000..34c878c4584
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.cpp
@@ -0,0 +1,522 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Event_Handler.h"
+
+#include "tao/Strategies/advanced_resource.h"
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+
+int g_shutdown = 0;
+/// Flag set when a signal is raised.
+
+// constructor.
+Signal_Handler::Signal_Handler (void)
+{
+}
+
+int
+Signal_Handler::handle_signal (int signum, siginfo_t *, ucontext_t*)
+{
+ if (signum == SIGINT)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "In the signal handler\n"));
+
+ g_shutdown = 1;
+
+ }
+ return 0;
+}
+
+ACE_CString &
+Sender_Callback::flowname (void)
+{
+ return this->flowname_;
+}
+
+void
+Sender_Callback::flowname (const ACE_CString &flowname)
+{
+ this->flowname_ = flowname;
+}
+
+
+int
+Sender_Callback::handle_destroy (void)
+{
+ SENDER::instance ()->connection_manager ().protocol_objects ().unbind (this->flowname_.c_str ());
+
+ SENDER::instance ()->connection_manager ().streamctrls ().unbind (this->flowname_.c_str ());
+
+ SENDER::instance ()->connection_manager ().receivers ().unbind (this->flowname_.c_str ());
+
+ // SENDER::instance ()->remove_stream ();
+
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::get_callback (const char * flowname,
+ TAO_AV_Callback *&callback)
+{
+ //SENDER::instance ()->add_stream ();
+
+ /// Create and return the client application callback and return to the AVStreams
+ /// for further upcalls.
+ callback = &this->callback_;
+
+ ACE_CString flow_name (flowname);
+ this->callback_.flowname (flow_name);
+
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object)
+{
+ Connection_Manager &connection_manager =
+ SENDER::instance ()->connection_manager ();
+
+ /// Add to the map of protocol objects.
+ connection_manager.protocol_objects ().bind (flowname,
+ object);
+
+ /// Store the related streamctrl.
+ connection_manager.add_streamctrl (flowname,
+ this);
+
+ return 0;
+}
+
+CORBA::Boolean
+Sender_StreamEndPoint::handle_preconnect (AVStreams::flowSpec &flowspec)
+{
+ /// If another receiver of the same flowname is in the map, destroy
+ /// the old stream.
+ for (CORBA::ULong i = 0;
+ i < flowspec.length ();
+ i++)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (flowspec[i]);
+
+ ACE_CString flowname (entry.flowname ());
+
+ Connection_Manager &connection_manager =
+ SENDER::instance ()->connection_manager ();
+
+ int result =
+ connection_manager.protocol_objects ().find (flowname);
+
+ /// If the flowname is found.
+ if (result == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "\nSender switching distributers\n\n"));
+
+ /// Destroy old stream with the same flowname.
+ connection_manager.destroy (flowname);
+ }
+ }
+ return 1;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ frame_rate_ (5),
+ mb_ (BUFSIZ),
+ sender_name_ ("sender")
+{
+}
+
+Sender::~Sender (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender destructor\n"));
+}
+
+void
+Sender::shut_down (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ SENDER::instance ()->connection_manager ().unbind_sender (this->sender_name_,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::shut_down Failed\n");
+ }
+ ACE_ENDTRY;
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ /// Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "s:f:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 's':
+ this->sender_name_ = opts.opt_arg ();
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ /// Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ /// Initialize the connection manager.
+ result =
+ this->connection_manager_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ /// Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ /*
+ ACE_Reactor *reactor =
+ TAO_AV_CORE::instance ()->reactor ();
+
+
+ if (reactor->register_handler (SIGINT,
+ &this->signal_handler_) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error in handler register\n"),
+ -1);
+ /// Register the signal handler for clean termination of the process.
+ */
+
+ /// Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ /// Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ /// Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /// Register the object reference with the Naming Service and bind to
+ /// the receivers
+ this->connection_manager_.bind_to_receivers (this->sender_name_,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /// Connect to the receivers
+ this->connection_manager_.connect_to_receivers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+/// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+ /// The time that should lapse between two consecutive frames sent.
+ ACE_Time_Value inter_frame_time;
+
+ /// The time between two consecutive frames.
+ inter_frame_time.set (1.0 / this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %d / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ /// The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ /// Continue to send data till the file is read to the end.
+ while (1)
+ {
+
+ if (g_shutdown == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Shut Down called\n"));
+
+ this->shut_down (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+ }
+
+ /// Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ /// At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+
+ this->shut_down (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ break;
+
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ ///
+ /// Second frame and beyond
+ ///
+
+ /// Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ /// Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ /// Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ /// Inter frame time has not elapsed.
+
+ /// Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ /// Run the orb for the wait time so the sender can
+ /// continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ }
+
+ /// Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ Connection_Manager::Protocol_Objects &protocol_objects =
+ this->connection_manager_.protocol_objects ();
+
+ /// Send frame to all receivers.
+ for (Connection_Manager::Protocol_Objects::iterator iterator = protocol_objects.begin ();
+ iterator != protocol_objects.end ();
+ ++iterator)
+ {
+ int result =
+ (*iterator).int_id_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ /// Reset the message block.
+ this->mb_.reset ();
+
+ } /// end while
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+Connection_Manager &
+Sender::connection_manager (void)
+{
+ return this->connection_manager_;
+}
+
+// void
+// Sender::add_stream (void)
+// {
+// this->stream_count_++;
+// }
+
+// void
+// Sender::remove_stream (void)
+// {
+// this->stream_count_--;
+// }
+
+// int
+// Sender::stream_alive (void)
+// {
+// return this->stream_count_;
+// }
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ///Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Initialize the Client.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "client::init failed\n"), -1);
+
+ SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.h b/TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.h
new file mode 100644
index 00000000000..6b5e8ef9e76
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/sender.h
@@ -0,0 +1,166 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Component_Switching
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "Connection_Manager.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Signal_Handler : public ACE_Event_Handler
+{
+ // TITLE
+ // This class Handles the SIGINT signal through the Reactor.
+ // Useful to gracefully release the process
+
+public:
+
+ Signal_Handler (void);
+
+ int handle_signal(int signum, siginfo_t*,ucontext_t*);
+ // Override this method to implement graceful shutdown.
+
+};
+
+
+class Sender_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Defines a class for the sender application callback.
+ //
+ // = DESCRIPTION
+ // This class overides the methods of the TAO_AV_Callback so the
+ // AVStreams can make upcalls to the application.
+
+public:
+
+ int handle_destroy (void);
+ /// Called when the sender has finished reading the file and wants
+ /// to close down the connection. Also called when the distributer
+ /// tears down the connection when it switches to a new sender.
+
+ ACE_CString &flowname (void);
+ void flowname (const ACE_CString &flowname);
+ /// Accessor methods for the flowname of the callback
+
+private:
+ ACE_CString flowname_;
+ /// Flowname of the callback.
+};
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ /// Create the application callback and return its handle to
+ /// AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ /// Set protocol object corresponding to the transport protocol
+ /// chosen.
+
+ CORBA::Boolean handle_preconnect (AVStreams::flowSpec &flowspec);
+ /// Perform application specific actions before accepting new
+ /// connections.
+
+protected:
+ Sender_Callback callback_;
+ /// Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ /// = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ /// Constructor
+
+ ~Sender (void);
+ /// Destructor
+
+ void shut_down (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ /// Method to pace and send data from a file.
+
+ Connection_Manager &connection_manager (void);
+ /// Accessor to the connection manager.
+
+private:
+ int parse_args (int argc, char **argv);
+ /// Method to parse the command line arguments.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ /// The endpoint strategy used by the sender.
+
+ TAO_MMDevice *sender_mmdevice_;
+ /// The sender MMDevice.
+
+ int frame_count_;
+ /// Number of frames sent.
+
+ ACE_CString filename_;
+ /// File from which data is read.
+
+ FILE *input_file_;
+ /// File handle of the file read from.
+
+ double frame_rate_;
+ /// Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ /// Message block into which data is read from a file and then sent.
+
+ ACE_CString sender_name_;
+ /// Name of this sender.
+
+ Connection_Manager connection_manager_;
+ /// Connection manager.
+
+ // int stream_count_;
+ /// Teh count of the number of streams that are active
+
+ Signal_Handler signal_handler_;
+ /// Reference to the signal handler.
+};
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/AVS_Full_Profile.mpc b/TAO/orbsvcs/tests/AVStreams/Full_Profile/AVS_Full_Profile.mpc
new file mode 100644
index 00000000000..f18041d3f25
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/AVS_Full_Profile.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(*server): avstreamsexe {
+ exename = server
+
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*ftp): avstreamsexe {
+ exename = ftp
+
+ Source_Files {
+ ftp.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Full_Profile/Makefile.am
new file mode 100644
index 00000000000..3db5feff051
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Full_Profile_Ftp.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ftp
+
+ftp_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ftp_SOURCES = \
+ ftp.cpp \
+ ftp.h
+
+ftp_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Full_Profile_Server.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ server.cpp \
+ server.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/README b/TAO/orbsvcs/tests/AVStreams/Full_Profile/README
new file mode 100644
index 00000000000..cbbbe9ea837
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/README
@@ -0,0 +1,54 @@
+This directory contains a simple file transfer test program for the
+Full Profile in the TAO's Audio/Video Streaming Service.
+
+This example follows the sequence of steps for using the Full Profile
+as outlined in the following section of the Audio/Video Streams
+specification:
+http://www.omg.org/technology/documents/formal/audio.htm
+http://www.omg.org/cgi-bin/doc?formal/2000-01-03
+
+This is from Section 2.3.8, The FlowConnection:
+
+===================================================================================
+- User A adds some flowendpoints to an instance of a full profile implementation of
+ StreamEndPoint_A (myA) by calling myA->add_fep(aFEP);
+- User B adds some FEPs to an instance of a full profile implementation of
+ StreamEndPoint_B (theirB).
+User C creates a StreamCtrl and calls aSC->bind(myA,theirB,someQoS,nilflowSpec)
+
+The bind() algorithm will find which pairs of FlowEndPoints are compatible
+between myA and theirB and create a FlowConnection for each pair of
+FlowEndPoints. Each flow connection within a stream can be individually
+accessed and manipulated.
+===================================================================================
+
+This program can be run using UDP by default
+
+Executable Options:
+-------------------
+
+server:
+-------
+
+-f <filename> -> The name of the file under which the received stream
+ data has to be stored.
+
+ftp:
+----
+
+-f <filename> --> The file to be streamed to the server. It is currently
+ streamed at the rate of 0.5kbytes/s.
+
+-s --> flag to use SFP. This option cannot be used with -p
+ TCP since SFP currently runs only over UDP.
+
+Running the Test:
+-----------------
+
+In that order:
+
+Run the Naming Service
+
+server -f <filename>
+
+ftp -f <filename> -p <TCP/UDP>
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp
new file mode 100644
index 00000000000..16d694eb261
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp
@@ -0,0 +1,399 @@
+// $Id$
+
+#include "ftp.h"
+
+
+FTP_Client_Callback::FTP_Client_Callback (void)
+ :count_ (0)
+{
+}
+
+int
+FTP_Client_Callback::handle_end_stream (void)
+{
+ TAO_AV_CORE::instance ()->stop_run ();
+ return 0;
+}
+
+void
+FTP_Client_Callback::get_timeout (ACE_Time_Value *&tv,
+ void *&)
+{
+ ACE_Time_Value *timeout;
+ ACE_NEW (timeout,
+ ACE_Time_Value(2));
+ tv = timeout;
+}
+
+int
+FTP_Client_Callback::handle_timeout (void *)
+{
+ ACE_TRY_NEW_ENV
+ {
+ ACE_Message_Block mb (BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,"FTP_Client_Callback::handle_timeout\n"));
+ char *buf = mb.rd_ptr ();
+ int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ());
+ if (n < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread end of file\n"),-1);
+ }
+
+ if (n == 0)
+ {
+ if (feof (CLIENT::instance ()->file ()))
+ {
+ // wait for sometime for the data to be flushed to the other side.
+ this->count_++;
+ if (this->count_ == 2)
+ {
+ ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n"));
+ AVStreams::flowSpec stop_spec (1);
+ CLIENT::instance ()->streamctrl ()->stop (stop_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ //CLIENT::instance ()->streamctrl ()->destroy (stop_spec ACE_ENV_ARG_PARAMETER);
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0);
+ ACE_TRY_CHECK;
+ return 0;
+ }
+ else
+ return 0;
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1);
+ }
+ mb.wr_ptr (n);
+ int result = this->protocol_object_->send_frame (&mb);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"send failed:%p","FTP_Client_Flow_Handler::send \n"),-1);
+ ACE_DEBUG ((LM_DEBUG,"handle_timeout::buffer sent succesfully\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"FTP_Client_Callback::handle_timeout Failed");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+FTP_Client_Producer::FTP_Client_Producer (void)
+ :TAO_FlowProducer ("Data",CLIENT::instance ()->protocols (),CLIENT::instance ()->format ())
+{
+}
+
+int
+FTP_Client_Producer::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ this->callback_->set_protocol_object (object);
+ return 0;
+}
+
+int
+FTP_Client_Producer::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_NEW_RETURN (this->callback_,
+ FTP_Client_Callback,
+ -1);
+ callback = this->callback_;
+ return 0;
+}
+
+int
+Client::parse_args (int argc,
+ char **argv)
+{
+ ACE_Get_Opt opts (argc,argv,"f:l:a:p:s");
+
+ this->use_sfp_ = 0;
+ int c;
+ int p_addr = 0;
+ int l_addr = 0;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'l':
+ this->address_ = ACE_OS::strdup (opts.opt_arg ());
+ l_addr = 1;
+ break;
+ case 'a':
+ this->peer_addr_ = ACE_OS::strdup (opts.opt_arg ());
+ p_addr =1;
+ break;
+ case 'p':
+ this->protocol_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 's':
+ this->use_sfp_ = 1;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG,"Unknown option\n"));
+ return -1;
+ }
+ }
+ if (l_addr == 0)
+ {
+ char buf [BUFSIZ];
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ address_ = buf;
+ address_ += ":5000";
+ }
+
+ if (p_addr == 0)
+ {
+ char buf [BUFSIZ];
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ peer_addr_ = buf;
+ peer_addr_ += ":5050";
+ }
+
+ return 0;
+}
+
+FILE *
+Client::file (void)
+{
+ return this->fp_;
+}
+
+const char*
+Client::flowname (void)
+{
+ return this->flowname_.c_str();
+}
+
+AVStreams::protocolSpec
+Client::protocols (void)
+{
+ AVStreams::protocolSpec protocols (1);
+ protocols.length (1);
+ char buf [BUFSIZ];
+ ACE_OS::sprintf (buf,"%s=%s",this->protocol_,this->address_.c_str ());
+ protocols [0] = CORBA::string_dup (buf);
+ return protocols;
+}
+
+const char *
+Client::format (void)
+{
+ return "UNS:ftp";
+}
+
+const char *
+Client::address (void)
+
+{
+ return this->address_.c_str ();
+}
+
+TAO_StreamCtrl*
+Client::streamctrl (void)
+{
+ return &this->streamctrl_;
+}
+
+Client::Client (void)
+ : fp_ (0),
+ protocol_ (ACE_OS::strdup ("UDP")),
+ orb_ (TAO_AV_CORE::instance ()->orb ()),
+ poa_ (TAO_AV_CORE::instance ()->poa ())
+{
+ endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+}
+
+
+int
+Client::init (int argc,char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ CORBA::String_var ior;
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ PortableServer::POAManager_var mgr
+ = TAO_AV_CORE::instance ()->poa ()->the_POAManager ();
+
+ mgr->activate ();
+
+ this->parse_args (this->argc_, this->argv_);
+
+ ACE_NEW_RETURN ( this->streamendpoint_a_,
+ TAO_StreamEndPoint_A, -1 );
+
+ ACE_NEW_RETURN (this->fep_a_, FTP_Client_Producer, -1 );
+ this->flowname_ = "Data";
+
+ sep_a_ = this->streamendpoint_a_->_this( ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ fep_a_obj_ = this->fep_a_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var s1 = sep_a_->add_fep( fep_a_obj_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) Added flowendpoint named: %s\n", s1.in() ));
+
+ this->fp_ = ACE_OS::fopen (this->filename_,"r");
+
+ if (this->fp_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,"file opened successfully\n"));
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "ERROR: file %s could not be opened\n",
+ this->filename_), -1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client::init\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Client::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ char flow_protocol_str [BUFSIZ];
+ if (this->use_sfp_)
+ ACE_OS::strcpy (flow_protocol_str,"sfp:1.0");
+ else
+ ACE_OS::strcpy (flow_protocol_str,"");
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+
+ ACE_INET_Addr addr (this->address_.c_str ());
+
+ TAO_Forward_FlowSpec_Entry entry (this->flowname_.c_str(),
+ "IN",
+ "USER_DEFINED",
+ flow_protocol_str,
+ this->protocol_,
+ &addr);
+
+ ACE_INET_Addr peer_addr (this->peer_addr_.c_str ());;
+ entry.set_peer_addr (&peer_addr);
+
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ ACE_High_Res_Timer timer;
+ ACE_Time_Value elapsed;
+ timer.start ();
+
+
+ CORBA::Object_var obj_b = this->orb_->string_to_object("corbaname:rir:#Server_StreamEndPoint_b");
+ AVStreams::StreamEndPoint_B_var sep_b = AVStreams::StreamEndPoint_B::_narrow ( obj_b.in() );
+
+ CORBA::Boolean result =
+ this->streamctrl_.bind (sep_a_.in(),
+ sep_b.in(),
+ the_qos.inout(),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ timer.stop ();
+ timer.elapsed_time (elapsed);
+ elapsed.dump ();
+ ACE_TRY_CHECK;
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"streamctrl::bind failed\n"),-1);
+
+ AVStreams::flowSpec start_spec (1);
+ this->streamctrl_.start (start_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Schedule a timer for the for the flow handler.
+ ACE_Time_Value tv (10000,0);
+ this->orb_->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client::run\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+ 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 ());
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ int result = 0;
+ result = CLIENT::instance ()->init (argc,argv);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"client::init failed\n"),1);
+ result = CLIENT::instance ()->run ();
+
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"client::run failed\n"),1);
+
+ }
+ ACE_CATCHANY
+
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ CLIENT::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.h b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.h
new file mode 100644
index 00000000000..bb0cfdd19c0
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.h
@@ -0,0 +1,89 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TAO_AV_FTP_H
+#define TAO_AV_FTP_H
+
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Flows_T.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Transport.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+
+class Client;
+
+class FTP_Client_Callback;
+
+class FTP_Client_Producer
+ :public virtual TAO_FlowProducer
+{
+public:
+ FTP_Client_Producer (void);
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+protected:
+ FTP_Client_Callback *callback_;
+};
+
+class FTP_Client_Callback
+ :public TAO_AV_Callback
+{
+public:
+ FTP_Client_Callback (void);
+ virtual int handle_timeout (void *arg);
+ virtual int handle_end_stream (void);
+ virtual void get_timeout (ACE_Time_Value *&tv,
+ void *&arg);
+ void set_protocol_object (TAO_AV_Protocol_Object *protocol_object) {this->protocol_object_ = protocol_object;}
+
+protected:
+ int count_;
+ TAO_AV_Protocol_Object *protocol_object_;
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A<TAO_StreamEndPoint_A,TAO_VDev,AV_Null_MediaCtrl> ENDPOINT_STRATEGY;
+
+class Client
+{
+public:
+ Client (void);
+ int init (int argc, char **argv);
+ int run (void);
+ FILE *file (void);
+ const char *flowname (void);
+ TAO_StreamCtrl* streamctrl (void);
+ AVStreams::protocolSpec protocols (void);
+ const char *format (void);
+ const char *address (void);
+private:
+ int parse_args (int argc, char **argv);
+ ENDPOINT_STRATEGY endpoint_strategy_;
+ TAO_StreamCtrl streamctrl_;
+ // Video stream controller
+
+ int argc_;
+ char **argv_;
+ const char *filename_;
+ ACE_CString address_;
+ ACE_CString peer_addr_;
+
+ FILE *fp_;
+ char *protocol_;
+ ACE_CString flowname_;
+ int use_sfp_;
+ CORBA::ORB_var orb_;
+ PortableServer::POA_ptr poa_;
+ TAO_StreamEndPoint_A *streamendpoint_a_;
+ AVStreams::StreamEndPoint_A_var sep_a_;
+ FTP_Client_Producer *fep_a_;
+ AVStreams::FlowProducer_var fep_a_obj_;
+};
+
+typedef ACE_Unmanaged_Singleton<Client,ACE_Null_Mutex> CLIENT;
+
+#endif /* TAO_AV_FTP_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl
new file mode 100755
index 00000000000..f07635bf9d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl
@@ -0,0 +1,118 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$outfile = PerlACE::LocalFile ("output");
+$input = PerlACE::LocalFile ("test_input");
+
+$debug = 0;
+
+unlink $nsior;
+unlink $output, $input;
+
+# generate test stream data
+# the size of this file is limited by the maximum packet size
+# windows has a maximum size of 8KB
+$input = PerlACE::generate_test_file("test_input", 32000);
+
+@protocols = ("TCP",
+ "UDP"
+ );
+
+for ($i = 0; $i <= $#ARGV; $i++)
+{
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ {
+ print STDERR "\nusage: run_test\n";
+
+ print STDERR "\t-h shows options menu\n";
+
+ print STDERR "\t-d: Debug Level defaults to 0";
+
+ print STDERR "\n";
+
+ exit;
+ }
+ elsif ($ARGV[$i] eq "-d")
+ {
+ $debug = $ARGV[$i + 1];
+ $i++;
+ }
+}
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1)
+{
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$output_file = "TCP_output";
+
+for $protocol (@protocols)
+{
+ if ($protocol eq "RTP/UDP")
+ {
+ $output_file = "RTP_output";
+ }
+ else {
+ $output_file = $protocol."_output";
+ }
+
+ $SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
+ $CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
+
+ print STDERR "Using ".$protocol."\n";
+ print STDERR "Starting Server\n";
+
+ $SV->Spawn ();
+
+ sleep $sleeptime;
+
+ print STDERR "Starting Client\n";
+
+ $sender = $CL->SpawnWaitKill (200);
+
+ if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+ }
+
+ $receiver = $SV->TerminateWaitKill (200);
+
+ if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+ }
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp b/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp
new file mode 100644
index 00000000000..7a7a0686962
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp
@@ -0,0 +1,270 @@
+// $Id$
+
+#include "server.h"
+
+FTP_Server_FlowEndPoint::FTP_Server_FlowEndPoint (void)
+ :TAO_FlowConsumer ("Data",FTP_SERVER::instance ()->protocols (), FTP_SERVER::instance ()->format ())
+{
+ AVStreams::protocolSpec protocols (2);
+ protocols.length (3);
+ protocols [0] = CORBA::string_dup ("TCP");
+ protocols [1] = CORBA::string_dup ("UDP");
+ protocols [2] = CORBA::string_dup ("RTP/UDP");
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->set_protocol_restriction (protocols
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"FTP_Server_FlowEndPoint::FTP_Server_FlowEndPoint\n");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+int
+FTP_Server_FlowEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_NEW_RETURN (callback,
+ FTP_Server_Callback,
+ -1);
+ return 0;
+}
+
+FTP_Server_Callback::FTP_Server_Callback (void)
+{
+}
+
+int
+FTP_Server_Callback::handle_stop (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::stop\n"));
+ ACE_OS::fclose (FTP_SERVER::instance ()->file ());
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+ return 0;
+}
+
+int
+FTP_Server_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::receive_frame\n"));
+ while (frame != 0)
+ {
+ int result = ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ FTP_SERVER::instance ()->file ());
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Server_Flow_Handler::fwrite failed\n"),-1);
+ frame = frame->cont ();
+ }
+ return 0;
+}
+
+int
+FTP_Server_Callback::handle_end_stream (void)
+{
+ CORBA::ORB_var orb = TAO_AV_CORE::instance ()->orb ();
+ orb->shutdown ();
+ return 0;
+}
+
+Server::Server (void)
+ :orb_ (TAO_AV_CORE::instance ()->orb ()),
+ poa_ (TAO_AV_CORE::instance ()->poa ())
+{
+ reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+}
+
+AVStreams::protocolSpec
+Server::protocols (void)
+{
+ AVStreams::protocolSpec protocols (2);
+ protocols.length (2);
+ protocols [0] = CORBA::string_dup ("TCP");
+ protocols [1] = CORBA::string_dup ("UDP");
+ return protocols;
+}
+
+const char*
+Server::format (void)
+{
+ return "UNS:ftp";
+}
+
+int
+Server::init (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ PortableServer::POAManager_var mgr
+ = this->poa_->the_POAManager ();
+
+ mgr->activate ();
+
+ int result = this->parse_args (argc,argv);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"parse args failed\n"),-1);
+
+ // Initialize the naming services
+ if (my_naming_client_.init (this->orb_.in ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ ACE_NEW_RETURN (this->streamendpoint_b_, TAO_StreamEndPoint_B, -1);
+
+ ACE_NEW_RETURN (this->fep_b_, FTP_Server_FlowEndPoint, -1);
+
+ sep_b_ = this->streamendpoint_b_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ fep_b_obj_ = this->fep_b_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var s1 = sep_b_->add_fep( fep_b_obj_.in() ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) Added flowendpoint named: %s\n", s1.in() ));
+
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name server_sep_b_name (1);
+ server_sep_b_name.length (1);
+ server_sep_b_name [0].id = CORBA::string_dup ("Server_StreamEndPoint_b");
+
+ // Register the video control object with the naming server.
+ this->my_naming_client_->rebind (server_sep_b_name,
+ sep_b_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Server::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::run\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Server::parse_args (int argc,char **argv)
+{
+ ACE_Get_Opt opts (argc,argv,"f:p:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->fp_ = ACE_OS::fopen (opts.opt_arg (),"w");
+ if (this->fp_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,"file opened successfully\n"));
+ }
+ break;
+ case 'p':
+ this->protocol_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,"Usage: server -f filename\n"),-1);
+ }
+ }
+
+ if( ! this->fp_ )
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Invalid file!\nUsage: server -f filename\n"),-1);
+ }
+
+ return 0;
+}
+
+FILE*
+Server::file (void)
+{
+ return this->fp_;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ int result = 0;
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+ 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 ());
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ result = FTP_SERVER::instance ()->init (argc,argv);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"SERVER::init failed\n"),1);
+
+ result = FTP_SERVER::instance ()->run ();
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"SERVER::run failed\n"),1);
+
+ FTP_SERVER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return result;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Server, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Server, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.h b/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.h
new file mode 100644
index 00000000000..f88e8ee7c20
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.h
@@ -0,0 +1,66 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Flows_T.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Transport.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Server;
+
+class FTP_Server_Callback
+ :public TAO_AV_Callback
+{
+public:
+ FTP_Server_Callback (void);
+ virtual int handle_stop (void);
+ virtual int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &);
+ virtual int handle_end_stream (void);
+};
+
+class FTP_Server_FlowEndPoint
+ :public TAO_FlowConsumer
+{
+public:
+ FTP_Server_FlowEndPoint (void);
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+};
+
+
+class Server
+{
+public:
+ Server (void);
+ int init (int argc,
+ char **argv);
+ int run (void);
+ FILE *file (void);
+ AVStreams::protocolSpec protocols (void);
+ CORBA::ORB_ptr orb (void);
+ void orb (CORBA::ORB_ptr orb_in);
+ PortableServer::POA_ptr poa (void);
+ void poa (PortableServer::POA_ptr poa_in);
+ const char *format (void);
+protected:
+ int parse_args (int argc,char **argv);
+ TAO_Naming_Client my_naming_client_;
+ TAO_AV_Endpoint_Reactive_Strategy_B <TAO_StreamEndPoint_B,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ FILE *fp_;
+ char *protocol_;
+ CORBA::ORB_var orb_;
+ PortableServer::POA_ptr poa_;
+ TAO_StreamEndPoint_B *streamendpoint_b_;
+ AVStreams::StreamEndPoint_B_var sep_b_;
+ FTP_Server_FlowEndPoint *fep_b_;
+ AVStreams::FlowConsumer_var fep_b_obj_;
+};
+
+typedef ACE_Unmanaged_Singleton<Server,ACE_Null_Mutex> FTP_SERVER;
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/AVS_Latency.mpc b/TAO/orbsvcs/tests/AVStreams/Latency/AVS_Latency.mpc
new file mode 100644
index 00000000000..e7f0d165f23
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/AVS_Latency.mpc
@@ -0,0 +1,27 @@
+// -*- MPC -*-
+// $Id$
+
+project(*ping): avstreamsexe, strategies {
+ exename = ping
+
+ Source_Files {
+ ping.cpp
+ }
+}
+
+project(*pong): avstreamsexe, strategies {
+ exename = pong
+
+ Source_Files {
+ pong.cpp
+ }
+}
+
+project(*cntl): avstreamsexe, strategies {
+ exename = control
+
+ Source_Files {
+ control.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Latency/Makefile.am
new file mode 100644
index 00000000000..20caef1661f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/Makefile.am
@@ -0,0 +1,121 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Latency_Cntl.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += control
+
+control_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+control_SOURCES = \
+ control.cpp \
+ ping.h \
+ pong.h
+
+control_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Latency_Ping.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ping
+
+ping_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ping_SOURCES = \
+ ping.cpp \
+ ping.h
+
+ping_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Latency_Pong.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += pong
+
+pong_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+pong_SOURCES = \
+ pong.cpp \
+ pong.h
+
+pong_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/README b/TAO/orbsvcs/tests/AVStreams/Latency/README
new file mode 100644
index 00000000000..6a96f8cff60
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/README
@@ -0,0 +1,9 @@
+# $Id$
+
+ A simple latency test for the AVStreams pluggable protocol
+framework. Run as follows:
+
+$ ping -o ping.ior
+$ pong -o pong.ior
+$ control -f file://ping.ior -g file://pong.ior
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/control.cpp b/TAO/orbsvcs/tests/AVStreams/Latency/control.cpp
new file mode 100644
index 00000000000..07ce3c8e804
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/control.cpp
@@ -0,0 +1,184 @@
+// $Id$
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/FlowSpec_Entry.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/INET_Addr.h"
+
+ACE_RCSID (Latency,
+ ping,
+ "$Id$")
+
+const char *ping_ior = CORBA::string_dup ("file://ping.ior");
+const char *pong_ior = CORBA::string_dup ("file://pong.ior");
+const char *ping_address = CORBA::string_dup ("localhost:12345");
+const char *pong_address = CORBA::string_dup ("localhost:23456");
+const char *protocol = CORBA::string_dup ("UDP");
+
+int milliseconds = 30000;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "f:g:s:r:t:p:d");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'f':
+ ping_ior = get_opts.opt_arg ();
+ break;
+
+ case 'g':
+ pong_ior = get_opts.opt_arg ();
+ break;
+
+ case 'r':
+ ping_address = get_opts.opt_arg ();
+ break;
+
+ case 's':
+ pong_address = get_opts.opt_arg ();
+ break;
+
+ case 't':
+ milliseconds = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'p':
+ protocol = get_opts.opt_arg ();
+ break;
+
+ case 'd':
+ TAO_debug_level++;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-f <ping_ior> "
+ "-g <ping_ior> "
+ "-s <ping_address> "
+ "-r <pong_address> "
+ "-t <milliseconds> "
+ "-p protocols "
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+ parse_args (argc, argv);
+
+ 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 ());
+
+ PortableServer::POAManager_var mgr
+ = poa->the_POAManager ();
+
+ mgr->activate ();
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Connect the two streams and run them...
+ AVStreams::flowSpec flow_spec (2);
+ flow_spec.length (2);
+
+ ACE_INET_Addr ping_addr;
+ ping_addr.set (ping_address);
+ TAO_Forward_FlowSpec_Entry ping ("Ping",
+ "IN",
+ "UNS:ping",
+ "",
+ protocol,
+ &ping_addr);
+ flow_spec[0] = CORBA::string_dup (ping.entry_to_string ());
+
+ ACE_INET_Addr pong_addr;
+ pong_addr.set (pong_address);
+ TAO_Forward_FlowSpec_Entry pong ("Pong",
+ "OUT",
+ "UNS:pong",
+ "",
+ protocol,
+ &pong_addr);
+ flow_spec[1] = CORBA::string_dup (pong.entry_to_string ());
+
+ TAO_StreamCtrl stream_control_impl;
+
+ AVStreams::StreamCtrl_var stream_control =
+ stream_control_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj = orb->string_to_object (ping_ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::MMDevice_var ping_sender =
+ AVStreams::MMDevice::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj = orb->string_to_object (pong_ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::MMDevice_var pong_sender =
+ AVStreams::MMDevice::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ AVStreams::streamQoS_var the_qos =
+ new AVStreams::streamQoS;
+
+ stream_control->bind_devs (pong_sender.in (),
+ ping_sender.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ flow_spec.length (0);
+ stream_control->start (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Time_Value tv (100, 0);
+ orb->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+ orb->shutdown (1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // flow_spec.length (0);
+ // stream_control->stop (flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/ping.cpp b/TAO/orbsvcs/tests/AVStreams/Latency/ping.cpp
new file mode 100644
index 00000000000..886394ae9f9
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/ping.cpp
@@ -0,0 +1,347 @@
+// $Id$
+
+#include "ping.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "tao/ORB.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Stats.h"
+
+ACE_RCSID (Latency,
+ ping,
+ "$Id$")
+
+const char *ior_output_file = "ping.ior";
+const char *protocol = "RTP/UDP";
+int milliseconds = 100;
+int respond = 1;
+AVStreams::protocolSpec ping_protocols;
+AVStreams::protocolSpec pong_protocols;
+
+Pong_Send_Callback pong_callback;
+
+ACE_hrtime_t recv_base = 0;
+ACE_Throughput_Stats recv_latency;
+
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "xo:s:r:t:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case 'r':
+ {
+ CORBA::ULong l = ping_protocols.length ();
+ ping_protocols.length (l + 1);
+ ping_protocols[l] = CORBA::string_dup (get_opts.opt_arg ());
+ }
+ break;
+
+ case 's':
+ {
+ CORBA::ULong l = pong_protocols.length ();
+ pong_protocols.length (l + 1);
+ pong_protocols[l] = CORBA::string_dup (get_opts.opt_arg ());
+ }
+ break;
+
+ case 't':
+ milliseconds = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'x':
+ respond = 0;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> "
+ "-r <protocol=addr> "
+ "-s <protocol=addr> "
+ "-t <milliseconds> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+
+ // If no protocols are specified use the default...
+ if (ping_protocols.length () == 0)
+ {
+ ping_protocols.length (1);
+ ping_protocols[0] = CORBA::string_dup ("UDP=localhost:12345");
+ }
+
+ if (pong_protocols.length () == 0)
+ {
+ pong_protocols.length (1);
+ pong_protocols[0] = CORBA::string_dup ("UDP=localhost:23456");
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+
+ parse_args (argc, argv);
+
+ 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 ());
+
+ PortableServer::POAManager_var mgr
+ = poa->the_POAManager ();
+
+ mgr->activate ();
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Register the video mmdevice object with the ORB
+ Reactive_Strategy *reactive_strategy;
+ ACE_NEW_RETURN (reactive_strategy,
+ Reactive_Strategy,
+ 1);
+ reactive_strategy->init (orb.in (), poa.in ());
+ TAO_MMDevice *mmdevice_impl;
+ ACE_NEW_RETURN (mmdevice_impl,
+ TAO_MMDevice (reactive_strategy),
+ 1);
+
+ AVStreams::MMDevice_var mmdevice =
+ mmdevice_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (mmdevice.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ Ping_Recv_FDev* ping_fdev_impl;
+ ACE_NEW_RETURN (ping_fdev_impl,
+ Ping_Recv_FDev ("Ping"),
+ 1);
+ Pong_Send_FDev* pong_fdev_impl;
+ ACE_NEW_RETURN (pong_fdev_impl,
+ Pong_Send_FDev ("Pong"),
+ 1);
+
+ AVStreams::FDev_var ping_fdev =
+ ping_fdev_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::FDev_var pong_fdev =
+ pong_fdev_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mmdevice->add_fdev (ping_fdev.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (respond == 1)
+ {
+ mmdevice->add_fdev (pong_fdev.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ orb->run ();
+ ACE_TRY_CHECK;
+
+
+ ACE_DEBUG ((LM_DEBUG, "Calibrating scale factory . . . "));
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_DEBUG ((LM_DEBUG, "done %d \n", gsf));
+
+ recv_latency.dump_results ("Receive", gsf);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// ****************************************************************
+
+Ping_Recv::Ping_Recv (void)
+ : TAO_FlowConsumer ("Ping",
+ ping_protocols,
+ "UNS:ping")
+{
+}
+
+int
+Ping_Recv::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_DEBUG ((LM_DEBUG,"Ping_Recv::get_callback\n"));
+ callback = &this->callback_;
+ return 0;
+}
+
+Ping_Recv_Callback::Ping_Recv_Callback (void)
+ : count_ (0)
+{
+}
+
+int
+Ping_Recv_Callback::handle_stop (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"Ping_Recv_Callback::stop"));
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+
+ return 0;
+}
+
+int
+Ping_Recv_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ this->count_++;
+
+ ACE_DEBUG ((LM_DEBUG,"Ping_Recv_Callback::receive_frame %d\n", this->count_));
+
+ if (this->count_ < 10)
+ {
+ for (const ACE_Message_Block *i = frame;
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_hrtime_t stamp;
+
+ if (i->length () < sizeof(stamp))
+ return 0;
+
+ ACE_OS::memcpy (&stamp, i->rd_ptr (), sizeof(stamp));
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ if (recv_base == 0)
+ {
+ recv_base = now;
+ }
+ else
+ {
+ recv_latency.sample (now - recv_base,
+ now - stamp);
+ }
+
+ if (respond == 1)
+ pong_callback.send_response (stamp);
+ }
+ }
+ else
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+ return 0;
+}
+
+int
+Ping_Recv_Callback::handle_destroy (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"Ping_Recv_Callback::destroy\n"));
+ return 0;
+}
+
+// ****************************************************************
+
+Pong_Send::Pong_Send (void)
+ : TAO_FlowProducer ("Pong",
+ pong_protocols,
+ "UNS:pong")
+{
+}
+
+int
+Pong_Send::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_DEBUG ((LM_DEBUG,"Pong_Send::get_callback\n"));
+ callback = &pong_callback;
+ return 0;
+}
+
+void
+Pong_Send_Callback::get_timeout (ACE_Time_Value *&tv,
+ void *&)
+{
+ // @@ ACE_NEW (tv, ACE_Time_Value (0, milliseconds * 1000));
+ ACE_DEBUG ((LM_DEBUG,"Pong_Send_Callback::get_timeout\n"));
+ tv = 0;
+}
+
+int
+Pong_Send_Callback::handle_timeout (void *)
+{
+ // ACE_DEBUG ((LM_DEBUG, "pong timeout (ignored)\n"));
+ return 0;
+}
+
+int
+Pong_Send_Callback::handle_end_stream (void)
+{
+ return 0;
+}
+
+int
+Pong_Send_Callback::send_response (ACE_hrtime_t stamp)
+{
+ ACE_DEBUG ((LM_DEBUG, "pong send response)\n"));
+
+ ACE_hrtime_t buf[2];
+
+ ACE_Message_Block mb (reinterpret_cast<char*> (buf),
+ sizeof(buf));
+
+ buf[0] = stamp;
+ buf[1] = ACE_OS::gethrtime ();
+ mb.wr_ptr (sizeof(buf));
+
+ int result = this->protocol_object_->send_frame (&mb);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Pong_Send_Callback::send - %p\n",
+ ""),
+ -1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/ping.h b/TAO/orbsvcs/tests/AVStreams/Latency/ping.h
new file mode 100644
index 00000000000..88e6fc31b97
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/ping.h
@@ -0,0 +1,77 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Latency
+//
+// = FILENAME
+// ping.h
+//
+// = AUTHOR
+// Carlos O'Ryan
+//
+// ============================================================================
+
+#ifndef TAO_PING_H
+#define TAO_PING_H
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Policy.h"
+#include "orbsvcs/AV/Flows_T.h"
+#include "ace/OS_NS_time.h"
+
+class Ping_Recv_Callback : public TAO_AV_Callback
+{
+public:
+ Ping_Recv_Callback (void);
+ virtual int handle_stop (void);
+ virtual int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0,
+ const ACE_Addr &peer_address = ACE_Addr::sap_any);
+ virtual int handle_destroy (void);
+ protected:
+ int count_;
+};
+
+class Ping_Recv : public TAO_FlowConsumer
+{
+public:
+ Ping_Recv (void);
+
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Ping_Recv_Callback callback_;
+ // The callback object...
+};
+
+class Pong_Send_Callback : public TAO_AV_Callback
+{
+public:
+
+ int send_response (ACE_hrtime_t stamp);
+ // Ad-hoc method to send a response outside the context of a
+ // handle_timeout.
+
+ virtual int handle_timeout (void *arg);
+ virtual int handle_end_stream (void);
+ virtual void get_timeout (ACE_Time_Value *&tv,
+ void *&arg);
+};
+
+class Pong_Send : public TAO_FlowProducer
+{
+public:
+ Pong_Send (void);
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_B <TAO_StreamEndPoint_B,TAO_VDev,AV_Null_MediaCtrl> Reactive_Strategy;
+
+typedef TAO_FDev<TAO_FlowProducer,Ping_Recv> Ping_Recv_FDev;
+typedef TAO_FDev<Pong_Send,TAO_FlowConsumer> Pong_Send_FDev;
+
+#endif /* TAO_PING_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/pong.cpp b/TAO/orbsvcs/tests/AVStreams/Latency/pong.cpp
new file mode 100644
index 00000000000..42979b096e9
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/pong.cpp
@@ -0,0 +1,360 @@
+// $Id$
+
+#include "pong.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/ORB.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Stats.h"
+
+ACE_RCSID (Latency,
+ ping,
+ "$Id$")
+
+const char *ior_output_file = "pong.ior";
+const char *protocol = "RTP/UDP";
+int milliseconds = 100;
+size_t message_size = 64;
+int respond = 1;
+AVStreams::protocolSpec pong_protocols;
+AVStreams::protocolSpec ping_protocols;
+
+ACE_hrtime_t recv_throughput_base = 0;
+ACE_Throughput_Stats recv_latency;
+
+ACE_hrtime_t send_throughput_base = 0;
+ACE_Throughput_Stats send_latency;
+
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "xo:s:r:t:b:d");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case 'r':
+ {
+ CORBA::ULong l = ping_protocols.length ();
+ ping_protocols.length (l + 1);
+ ping_protocols[l] = CORBA::string_dup (get_opts.opt_arg ());
+ }
+ break;
+
+ case 's':
+ {
+ CORBA::ULong l = pong_protocols.length ();
+ pong_protocols.length (l + 1);
+ pong_protocols[l] = CORBA::string_dup (get_opts.opt_arg ());
+ }
+ break;
+
+ case 't':
+ milliseconds = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'b':
+ message_size = ACE_OS::atoi (get_opts.opt_arg ());
+ if (message_size < sizeof(ACE_hrtime_t))
+ {
+ ACE_DEBUG ((LM_DEBUG, "Invalid message size\n"));
+ message_size = 64;
+ }
+ break;
+
+ case 'x':
+ respond = 0;
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> "
+ "-r <protocol=addr> "
+ "-s <protocol=addr> "
+ "-t <milliseconds> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+
+ // If no protocols are specified use the default...
+ if (pong_protocols.length () == 0)
+ {
+ pong_protocols.length (1);
+ pong_protocols[0] = CORBA::string_dup ("UDP=localhost:23456");
+ }
+
+ if (ping_protocols.length () == 0)
+ {
+ ping_protocols.length (1);
+ ping_protocols[0] = CORBA::string_dup ("UDP=localhost:12345");
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+
+ parse_args (argc, argv);
+
+ 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 ());
+
+ PortableServer::POAManager_var mgr
+ = poa->the_POAManager ();
+
+ mgr->activate ();
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Reactive_Strategy *reactive_strategy;
+ ACE_NEW_RETURN (reactive_strategy,
+ Reactive_Strategy,
+ 1);
+ reactive_strategy->init (orb.in (), poa.in ());
+ TAO_MMDevice *mmdevice_impl;
+ ACE_NEW_RETURN (mmdevice_impl,
+ TAO_MMDevice (reactive_strategy),
+ 1);
+
+ AVStreams::MMDevice_var mmdevice =
+ mmdevice_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (mmdevice.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ Pong_Recv_FDev* pong_fdev_impl;
+ ACE_NEW_RETURN (pong_fdev_impl,
+ Pong_Recv_FDev ("Pong"),
+ 1);
+ Ping_Send_FDev* ping_fdev_impl;
+ ACE_NEW_RETURN (ping_fdev_impl,
+ Ping_Send_FDev ("Ping"),
+ 1);
+
+ AVStreams::FDev_var ping_fdev =
+ ping_fdev_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::FDev_var pong_fdev =
+ pong_fdev_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mmdevice->add_fdev (ping_fdev.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (respond == 1)
+ {
+ mmdevice->add_fdev (pong_fdev.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ orb->run ( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "Calibrating scale factory . . . "));
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_DEBUG ((LM_DEBUG, "done\n"));
+
+ recv_latency.dump_results ("Receive", gsf);
+
+ send_latency.dump_results ("Send", gsf);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// ****************************************************************
+
+Pong_Recv::Pong_Recv (void)
+ : TAO_FlowConsumer ("Pong",
+ pong_protocols,
+ "UNS:pong")
+{
+}
+
+int
+Pong_Recv::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // ACE_DEBUG ((LM_DEBUG,"Pong_Recv::get_callback\n"));
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Pong_Recv_Callback::handle_stop (void)
+{
+ // ACE_DEBUG ((LM_DEBUG,"Pong_Recv_Callback::stop"));
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+ return 0;
+}
+
+int
+Pong_Recv_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ // ACE_DEBUG ((LM_DEBUG,"Pong_Recv_Callback::receive_frame\n"));
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ for (const ACE_Message_Block *i = frame;
+ i != 0;
+ i = frame->cont ())
+ {
+ ACE_hrtime_t buf[2];
+
+ if (frame->length () < sizeof(buf))
+ {
+ ACE_DEBUG ((LM_DEBUG, "Unexpected message size\n"));
+ return 0;
+ }
+
+ ACE_OS::memcpy (buf, i->rd_ptr (), sizeof(buf));
+
+ if (recv_throughput_base == 0)
+ {
+ recv_throughput_base = now;
+ }
+ recv_latency.sample (now - recv_throughput_base,
+ now - buf[0]);
+ }
+ return 0;
+}
+
+int
+Pong_Recv_Callback::handle_destroy (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"Pong_Recv_Callback::destroy\n"));
+ return 0;
+}
+
+// ****************************************************************
+
+Ping_Send::Ping_Send (void)
+ : TAO_FlowProducer ("Ping",
+ ping_protocols,
+ "UNS:ping")
+{
+}
+
+int
+Ping_Send::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // ACE_DEBUG ((LM_DEBUG,"Ping_Send::get_callback\n"));
+ callback = &this->callback_;
+ return 0;
+}
+
+Ping_Send_Callback::Ping_Send_Callback (void)
+ :count_ (0)
+{
+ this->timeout_ = ACE_Time_Value (2);
+
+ this->frame_.size (message_size);
+ this->frame_.wr_ptr (message_size);
+}
+
+void
+Ping_Send_Callback::get_timeout (ACE_Time_Value *&tv,
+ void *&)
+{
+ tv = &this->timeout_;
+}
+
+int
+Ping_Send_Callback::handle_timeout (void *)
+{
+
+ this->count_++;
+
+ ACE_DEBUG ((LM_DEBUG, "Ping timeout frame %d\n", this->count_));
+
+ if (this->count_ > 10)
+ {
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+ return 0;
+ }
+
+ ACE_hrtime_t stamp = ACE_OS::gethrtime ();
+ ACE_OS::memcpy (this->frame_.rd_ptr (), &stamp, sizeof(stamp));
+
+ int result = this->protocol_object_->send_frame (&this->frame_);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Ping_Send_Callback::handle_timeout - send_frame - %p\n",
+ ""),
+ -1);
+
+ if (send_throughput_base == 0)
+ {
+ send_throughput_base = stamp;
+ }
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ send_latency.sample (now - send_throughput_base,
+ now - stamp);
+
+ return 0;
+}
+
+int
+Ping_Send_Callback::handle_end_stream (void)
+{
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/pong.h b/TAO/orbsvcs/tests/AVStreams/Latency/pong.h
new file mode 100644
index 00000000000..92d90adaad4
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/pong.h
@@ -0,0 +1,83 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Latency
+//
+// = FILENAME
+// ping.h
+//
+// = AUTHOR
+// Carlos O'Ryan
+//
+// ============================================================================
+
+#ifndef TAO_PONG_H
+#define TAO_PONG_H
+
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Policy.h"
+#include "orbsvcs/AV/Flows_T.h"
+
+class Pong_Recv_Callback : public TAO_AV_Callback
+{
+public:
+ virtual int handle_stop (void);
+ virtual int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0,
+ const ACE_Addr &peer_address = ACE_Addr::sap_any);
+ virtual int handle_destroy (void);
+};
+
+class Pong_Recv : public TAO_FlowConsumer
+{
+public:
+ Pong_Recv (void);
+
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Pong_Recv_Callback callback_;
+ // The callback object...
+};
+
+class Ping_Send_Callback : public TAO_AV_Callback
+{
+public:
+ Ping_Send_Callback (void);
+
+ virtual int handle_timeout (void *arg);
+ virtual int handle_end_stream (void);
+ virtual void get_timeout (ACE_Time_Value *&tv,
+ void *&arg);
+
+private:
+ ACE_Time_Value timeout_;
+ // the timeout value
+
+ ACE_Message_Block frame_;
+ // Pre-allocate the message block to send...
+ int count_;
+
+};
+
+class Ping_Send : public TAO_FlowProducer
+{
+public:
+ Ping_Send (void);
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Ping_Send_Callback callback_;
+ // The callback object...
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A <TAO_StreamEndPoint_A,TAO_VDev,AV_Null_MediaCtrl> Reactive_Strategy;
+
+typedef TAO_FDev<TAO_FlowProducer,Pong_Recv> Pong_Recv_FDev;
+typedef TAO_FDev<Ping_Send,TAO_FlowConsumer> Ping_Send_FDev;
+
+#endif /* TAO_PONG_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Latency/run_test.pl
new file mode 100755
index 00000000000..7923bb727d8
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+# amount of delay between running the servers
+
+$status = 0;
+
+$pingior = PerlACE::LocalFile ("ping.ior");
+$pongior = PerlACE::LocalFile ("pong.ior");
+
+unlink $pingior, $pongior;
+
+$PING = new PerlACE::Process ("ping", "-o $pingior");
+$PONG = new PerlACE::Process ("pong", "-o $pongior");
+$CTRL = new PerlACE::Process ("control", "-f file://$pingior -g file://$pongior");
+
+print STDERR "Starting Ping\n";
+
+$PING->Spawn ();
+
+if (PerlACE::waitforfile_timed ($pingior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$pingior>\n";
+ $PING->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Pong\n";
+
+$PONG->Spawn ();
+if (PerlACE::waitforfile_timed ($pongior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$pongior>\n";
+ $PING->Kill ();
+ $PONG->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Control\n";
+
+$CTRL->Spawn();
+
+$PING->WaitKill(100);
+
+$PONG->WaitKill(100);
+
+$control = $CTRL->TerminateWaitKill (5);
+
+if ($control != 0) {
+ print STDERR "ERROR: control returned $control\n";
+ $status = 1;
+}
+
+unlink $pingior, $pongior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/svc.conf b/TAO/orbsvcs/tests/AVStreams/Latency/svc.conf
new file mode 100644
index 00000000000..55dab11ac36
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/svc.conf
@@ -0,0 +1,5 @@
+# $Id$
+#
+static Advanced_Resource_Factory "-ORBReactorType select_st -ORBInputCDRAllocator null -ORBConnectionCacheLock null"
+static Server_Strategy_Factory "-ORBPOALock null -ORBAllowReactivationOfSystemids 0"
+static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler ST"
diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/svc.conf.xml b/TAO/orbsvcs/tests/AVStreams/Latency/svc.conf.xml
new file mode 100644
index 00000000000..5f7c667443f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Latency/svc.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/AVStreams/Latency/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <!-- -->
+ <static id="Advanced_Resource_Factory" params="-ORBReactorType select_st -ORBInputCDRAllocator null -ORBConnectionCacheLock null"/>
+ <static id="Server_Strategy_Factory" params="-ORBPOALock null -ORBAllowReactivationOfSystemids 0"/>
+ <static id="Client_Strategy_Factory" params="-ORBProfileLock null -ORBClientConnectionHandler ST"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/AVStreams/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Makefile.am
new file mode 100644
index 00000000000..6f3ac2f1651
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Makefile.am
@@ -0,0 +1,26 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ Asynch_Three_Stage \
+ Bidirectional_Flows \
+ Component_Switching \
+ Full_Profile \
+ Latency \
+ Modify_QoS \
+ Multicast \
+ Multicast_Full_Profile \
+ Multiple_Flows \
+ Pluggable \
+ Pluggable_Flow_Protocol \
+ Simple_Three_Stage \
+ Simple_Two_Stage \
+ Simple_Two_Stage_With_QoS
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/AVS_Modify_QoS.mpc b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/AVS_Modify_QoS.mpc
new file mode 100644
index 00000000000..ff55e80a109
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/AVS_Modify_QoS.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe {
+ exename = sender
+
+ Source_Files {
+ sender.cpp
+ }
+}
+
+project(*recv): avstreamsexe {
+ exename = receiver
+
+ Source_Files {
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/Makefile.am
new file mode 100644
index 00000000000..d4640caa093
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Modify_QoS_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ receiver.cpp \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Modify_QoS_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ sender.cpp \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/README b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/README
new file mode 100644
index 00000000000..51ee6670ddf
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/README
@@ -0,0 +1,52 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a simple test in the form of a sender and a
+receiver. The test has the following features:
+
+1. It tests the AVStreams Pluggable Protocol Framework
+2. Shows a mechanism to pace data.
+3. Shows how we can modify the qos of a flow during run-time.
+
+To demonstrate the qos modification teh receiver calls the modify_qos
+(in this test we are modifying the frame rate of the flow) method after
+receiving 20 frames (a number selected for no good reason!!).
+This call in turn is propagated to the sender. The sender then re-initializes
+the frame rate to the one requested by the receiver.
+
+Running the test
+----------------
+
+receiver
+--------
+
+receiver -f <output_filename>
+
+-f <output_filename> -> The name of the file under which the received stream
+ data has to be stored (defaults to "output")
+
+sender
+------
+
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-d]
+
+
+-f filename --> The file to be streamed to the receiver (defaults to
+ "input").
+
+-p protocol --> The protocol string could be UDP or TCP (defaults to
+ UDP). But with the multicast address it should be UDP.
+
+-r framerate--> The rate at which tha data frames need to be sent
+ (defaults to 30 frames per second).
+
+-d --> Increament the TAO_debug_level for debug messages.
+
+
+The test must be run with the naming service. Check the run_test.pl
+to see how to configure the test case.
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.cpp
new file mode 100644
index 00000000000..f9dc8ccefca
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.cpp
@@ -0,0 +1,335 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+
+static FILE *output_file = 0;
+// File handle of the file into which received data is written.
+
+static const char *output_file_name = "output";
+// File name of the file into which received data is written.
+
+int
+Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = &this->callback_;
+
+
+ // Get the stream controller for this stream.
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Any_ptr streamctrl_any =
+ this->get_property_value ("Related_StreamCtrl"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ AVStreams::StreamCtrl_ptr streamctrl;
+ *streamctrl_any >>= streamctrl;
+
+ // Store the stream control for the stream with the callback.
+ this->callback_.streamctrl (streamctrl);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender_StreamEndPoint::get_callback failed");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (0)
+{
+}
+
+void
+Receiver_Callback::streamctrl (AVStreams::StreamCtrl_ptr streamctrl)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->streamctrl_ = streamctrl;
+}
+
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ ++this->frame_count_));
+
+
+ if (this->streamctrl_ != 0)
+ {
+ // Modify QoS after receiving 20 frames
+ if (frame_count_ == 20)
+ {
+ // Specify the flow for which the qos needs to be changed.
+ TAO_Forward_FlowSpec_Entry entry ("Data_Receiver",
+ "IN",
+ "",
+ "",
+ 0);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ // Initialize the qos parameter(s) that need to be changed
+ // with the corresponding value.
+ AVStreams::streamQoS qos;
+ qos.length (1);
+
+ // The QoS Type that needs to be changed.
+ qos [0].QoSType = CORBA::string_dup ("video_qos");
+
+ qos [0].QoSParams.length (1);
+ qos [0].QoSParams [0].property_name = CORBA::string_dup ("video_frame_rate");
+ qos [0].QoSParams [0].property_value <<= (CORBA::Short) 30;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ // Initiate the modifying of the qos for the flows.
+ this->streamctrl_->modify_QoS (qos, flow_spec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Stream Ctrl available....Modify QoS called\n"));
+ }
+ }
+ else ACE_DEBUG ((LM_DEBUG,
+ "No Stream Ctrl\n"));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ return 0;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::end_stream\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Receiver_Callback::handle_destroy Failed\n");
+ return -1;
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0)
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+
+
+int
+Receiver::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Initialize the naming services
+ if (this->naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the receiver object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+parse_args (int argc,
+ char **argv)
+{
+ // Parse the command line arguments
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ output_file_name = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: receiver -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result =
+ parse_args (argc,
+ argv);
+
+ if (result == -1)
+ return -1;
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ Receiver receiver;
+ result =
+ receiver.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.h b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.h
new file mode 100644
index 00000000000..66ba33d02ed
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/receiver.h
@@ -0,0 +1,90 @@
+/* -*- C++ -*- */
+// $Id$
+
+//=============================================================================
+/**
+ * @file receiver.h
+ *
+ * receiver.h,v 1.1 2001/04/15 02:56:26 yamuna Exp
+ *
+ * @author Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+ */
+//=============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+// = AVStreams calls this class when data shows up from a sender.
+class Receiver_Callback : public TAO_AV_Callback
+{
+public:
+
+ Receiver_Callback (void);
+ /// Constructor.
+
+ /// Method that is called when there is data to be received from a
+ /// sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ /// Called when the sender is done sending data and wants to close
+ /// down the connection.
+ int handle_destroy (void);
+
+ /// Set the related stream control for this flow.
+ void streamctrl (AVStreams::StreamCtrl_ptr streamctrl);
+
+private:
+ int frame_count_;
+ /// Keeping a count of the incoming frames.
+
+ /// Related stream control.
+ AVStreams::StreamCtrl_ptr streamctrl_;
+
+};
+
+// = AVStreams calls this class during connection setup.
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+
+public:
+ /// Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Receiver_Callback callback_;
+ /// Receiver application callback.
+};
+
+// = This class receives data from a AV sender and writes it to a file.
+class Receiver
+{
+public:
+ Receiver (void);
+ /// Constructor
+
+ ~Receiver (void);
+ /// Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Initialize data components.
+
+
+protected:
+ TAO_Naming_Client naming_client_;
+ /// The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ /// The endpoint reactive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ /// Receiver MMDevice.
+};
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl
new file mode 100755
index 00000000000..878bbe54a79
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl
@@ -0,0 +1,71 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$outfile = PerlACE::LocalFile ("output");
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+unlink $nsior;
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+$SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior");
+$CL = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -f $input");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 5) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Receiver\n";
+
+$SV->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender\n";
+
+$sender = $CL->SpawnWaitKill (60);
+
+if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+$receiver = $SV->TerminateWaitKill (5);
+
+if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.cpp
new file mode 100644
index 00000000000..5788046dcb9
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.cpp
@@ -0,0 +1,444 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+
+// The time that should lapse between two consecutive frames sent.
+ACE_Time_Value inter_frame_time;
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ SENDER::instance ()->protocol_object (object);
+ return 0;
+}
+
+CORBA::Boolean
+Sender_StreamEndPoint::modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &/* the_flows */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed ))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender_StreamEndPoint::modify_QoS\n"));
+
+ // Check if the qos for the flow has changed.
+ if (new_qos.length () != 0)
+ {
+ // Check which qos parameter has changed.
+ if (strcmp (new_qos [0].QoSParams [0].property_name, "video_frame_rate") == 0)
+ {
+ // The video frame rate for this flow has changed.
+
+ // Get the new value of the frame rate.
+ CORBA::Any frame_rate_any =
+ new_qos [0].QoSParams [0].property_value;
+
+ CORBA::Short frame_rate;
+ frame_rate_any >>= frame_rate;
+
+ // Calculate the new inter frame time.
+ inter_frame_time.set (1 / (double) frame_rate);
+ }
+ }
+
+ return 1;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ streamctrl_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ protocol_ ("UDP"),
+ frame_rate_ (1),
+ mb_ (BUFSIZ)
+{
+}
+
+void
+Sender::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:p:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'p':
+ this->protocol_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+// Method to get the object reference of the receiver
+int
+Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Resolve the receiver object reference from the Naming Service
+ CORBA::Object_var receiver_mmdevice_obj =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->receiver_mmdevice_ =
+ AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->receiver_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Receiver_MMdevice in Naming service <%s>\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the naming services
+ result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Resolve the object reference of the receiver from the Naming Service.
+ result = this->bind_to_receiver (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry ("Data_Receiver",
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ 0);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->streamctrl_,
+ TAO_StreamCtrl,
+ -1);
+
+ PortableServer::ServantBase_var safe_streamctrl =
+ this->streamctrl_;
+
+ // Bind/Connect the sender and receiver MMDevices.
+ CORBA::Boolean bind_result =
+ this->streamctrl_->bind_devs (mmdevice.in (),
+ this->receiver_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (bind_result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "streamctrl::bind_devs failed\n"),
+ -1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1 / (double) this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %d / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Read from the file into a message block.
+ size_t n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ break;
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ // Send frame.
+ int result =
+ this->protocol_object_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ } // end while
+
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Shut the orb down.
+ TAO_AV_CORE::instance ()->orb ()->shutdown (1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Sender.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::init failed\n"),
+ -1);
+
+ // Start sending data.
+ result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.h b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.h
new file mode 100644
index 00000000000..22483881f89
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Modify_QoS/sender.h
@@ -0,0 +1,125 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file sender.h
+ *
+ * $Id$
+ *
+ * @author Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+ */
+//=============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+// = Defines application specific sender stream endpoint.
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ /// Create the application callback and return its handle to
+ /// AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ /// Set protocol object corresponding to the transport protocol
+ /// chosen.
+
+ CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &flow_spec
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed ));
+
+ /// The over-ridden modify_qos method to change the qos of the
+ /// flows specified in the flow spec to that in the new_qos.
+
+protected:
+ TAO_AV_Callback callback_;
+ /// Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+<Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+SENDER_ENDPOINT_STRATEGY;
+
+/**
+ * @class Sender
+ *
+ * @brief Class is responsible for streaming (and pacing) data to a
+ * receiver.
+ *
+ */
+class Sender
+{
+public:
+ Sender (void);
+ /// Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ /// Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ /// Method to pace and send data from a file.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ /// Set the protocol object corresponding to the transport protocol chosen.
+
+private:
+ int parse_args (int argc, char **argv);
+ /// Method to parse the command line arguments.
+
+ int bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL);
+ /// Method that binds the sender to the receiver.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ /// The endpoint strategy used by the sender.
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ /// The receiver MMDevice that the sender connects to.
+
+ TAO_MMDevice *sender_mmdevice_;
+ /// The sender MMDevice.
+
+ TAO_StreamCtrl *streamctrl_;
+ /// Stream controller
+
+ int frame_count_;
+ /// Number of frames sent.
+
+ ACE_CString filename_;
+ /// File from which data is read.
+
+ TAO_Naming_Client naming_client_;
+ /// The Naming Service client.
+
+ FILE *input_file_;
+ /// File handle of the file read from.
+
+ ACE_CString protocol_;
+ /// Selected protocol - default is UDP
+
+ int frame_rate_;
+ /// Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ /// Message block into which data is read from a file and then sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ /// Protocol object corresponding to the transport protocol selected.
+};
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/AVS_Multicast.mpc b/TAO/orbsvcs/tests/AVStreams/Multicast/AVS_Multicast.mpc
new file mode 100644
index 00000000000..a8567ba6fe6
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/AVS_Multicast.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(*server): avstreamsexe, strategies {
+ exename = server
+
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*ftp): avstreamsexe, strategies {
+ exename = ftp
+
+ Source_Files {
+ ftp.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Multicast/Makefile.am
new file mode 100644
index 00000000000..5027e738f6f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/Makefile.am
@@ -0,0 +1,88 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Multicast_Ftp.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ftp
+
+ftp_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ftp_SOURCES = \
+ ftp.cpp \
+ ftp.h
+
+ftp_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Multicast_Server.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ server.cpp \
+ server.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/README b/TAO/orbsvcs/tests/AVStreams/Multicast/README
new file mode 100644
index 00000000000..75a2837075e
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/README
@@ -0,0 +1,37 @@
+This directory contains a simple file transfer test program for the
+Multicast in the TAO's Audio/Video Streaming Service. This program can
+be run using UDP by default
+
+Executable Options:
+-------------------
+
+server:
+-------
+
+-f <filename> -> The name of the file under which the received stream
+ data has to be stored.
+
+ftp:
+----
+
+-f <filename> --> The file to be streamed to the server. It is currently
+ streamed at the rate of 0.5kbytes/s.
+
+-s --> flag to use SFP. This option cannot be used with -p
+ TCP since SFP currently runs only over UDP.
+
+Running the Test:
+-----------------
+
+In that order:
+
+Run the Naming Service
+
+server -f <filename1> (machine 1)
+
+server -f <filename2> (machine 2)
+
+ftp -f <filename> (machine 3)
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf b/TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf
new file mode 100644
index 00000000000..4c6d9054999
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf
@@ -0,0 +1,8 @@
+# $Id$
+#
+#static Advanced_Resource_Factory "-ORBresources global -ORBReactorType select_st -ORBInputCDRAllocator null -ORBConnectionCacheLock null"
+#static Server_Strategy_Factory "-ORBPOALock null -ORBAllowReactivationOfSystemids 0"
+#static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler ST"
+
+static Advanced_Resource_Factory "-ORBReactorType select_mt"
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf.xml b/TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf.xml
new file mode 100644
index 00000000000..4ddaaf0c147
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/components_svc.conf.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/AVStreams/Multicast/components_svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <!-- -->
+ <!-- static Advanced_Resource_Factory "-ORBReactorType select_st -ORBInputCDRAllocator null -ORBConnectionCacheLock null" -->
+ <!-- static Server_Strategy_Factory "-ORBPOALock null -ORBAllowReactivationOfSystemids 0" -->
+ <!-- static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler ST" -->
+ <static id="Advanced_Resource_Factory" params="-ORBReactorType select_mt"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp
new file mode 100644
index 00000000000..ee6b23f62df
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp
@@ -0,0 +1,394 @@
+// $Id$
+
+#include "ftp.h"
+
+FTP_Client_Callback::FTP_Client_Callback (void)
+ :count_ (0)
+{
+}
+
+int
+FTP_Client_Callback::handle_end_stream (void)
+{
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+ return 0;
+}
+
+FTP_Client_StreamEndPoint::FTP_Client_StreamEndPoint (void)
+{
+
+}
+
+void
+FTP_Client_Callback::get_timeout (ACE_Time_Value *&tv,
+ void *&)
+{
+ ACE_Time_Value *timeout;
+ ACE_NEW (timeout,
+ ACE_Time_Value(2));
+ tv = timeout;
+}
+
+int
+FTP_Client_Callback::handle_timeout (void *)
+{
+ ACE_Message_Block mb (BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,"FTP_Client_Callback::get_frame\n"));
+ char *buf = mb.rd_ptr ();
+ //cerr << "message block size" << mb.size () << endl;
+ int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ());
+ if (n < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread end of file\n"),-1);
+ }
+ if (n == 0)
+ {
+ if (feof (CLIENT::instance ()->file ()))
+ {
+ // wait for sometime for the data to be flushed to the other side.
+ this->count_++;
+ if (this->count_ == 2)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n"));
+ AVStreams::flowSpec stop_spec (1);
+ //ACE_DECLARE_NEW_CORBA_ENV;
+ CLIENT::instance ()->streamctrl ()->stop (stop_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+// CLIENT::instance ()->streamctrl ()->destroy (stop_spec ACE_ENV_ARG_PARAMETER);
+// ACE_TRY_CHECK;
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0);
+ ACE_TRY_CHECK;
+ return 0;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"FTP_Client_Callback::handle_timeout\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ }
+ else
+ return 0;
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1);
+ }
+ //cerr << "read bytes = " << n << endl;
+ mb.wr_ptr (n);
+ int result = this->protocol_object_->send_frame (&mb);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"send failed:%p","FTP_Client_Flow_Handler::send \n"),-1);
+ ACE_DEBUG ((LM_DEBUG,"handle_timeout::buffer sent succesfully\n"));
+ return 0;
+}
+
+int
+FTP_Client_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_NEW_RETURN (this->callback_,
+ FTP_Client_Callback,
+ -1);
+ callback = this->callback_;
+ return 0;
+}
+
+int
+FTP_Client_StreamEndPoint::set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object)
+{
+ this->callback_->set_protocol_object (object);
+ ACE_CString flow_string (flowname);
+ return 0;
+}
+
+
+Endpoint_Reactive_Strategy::Endpoint_Reactive_Strategy (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ Client *client)
+ : client_ (client)
+{
+ this->init (orb, poa);
+}
+
+int
+Endpoint_Reactive_Strategy::make_stream_endpoint (FTP_Client_StreamEndPoint *&endpoint)
+{
+ ACE_DEBUG ((LM_DEBUG,"Endpoint_Reactive_Strategy::make_stream_endpoint\n"));
+ ACE_NEW_RETURN (endpoint,
+ FTP_Client_StreamEndPoint,
+ -1);
+ return 0;
+}
+
+int
+Client::parse_args (int argc,
+ char **argv)
+{
+ ACE_Get_Opt opts (argc,argv,"f:a:p:s");
+
+ this->use_sfp_ = 0;
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'a':
+ this->address_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'p':
+ this->protocol_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 's':
+ this->use_sfp_ = 1;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG,"Unknown option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+FILE *
+Client::file (void)
+{
+ return this->fp_;
+}
+
+char*
+Client::flowname (void)
+{
+ return this->flowname_;
+}
+
+TAO_StreamCtrl*
+Client::streamctrl (void)
+{
+ return &this->streamctrl_;
+}
+
+Client::Client (void)
+ :endpoint_strategy_ (TAO_AV_CORE::instance ()->orb (), TAO_AV_CORE::instance ()->poa (),this),
+ client_mmdevice_ (&endpoint_strategy_),
+ address_ (ACE_OS::strdup ("224.9.9.2:12345")),
+ fp_ (0),
+ protocol_ (ACE_OS::strdup ("UDP"))
+{
+}
+
+
+int
+Client::bind_to_server (const char *name)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Initialize the naming services
+ CosNaming::Name server_mmdevice_name (1);
+ server_mmdevice_name.length (1);
+ server_mmdevice_name [0].id = name;
+ CORBA::Object_var server_mmdevice_obj =
+ my_naming_client_->resolve (server_mmdevice_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->server_mmdevice_ =
+ AVStreams::MMDevice::_narrow (server_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->server_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve Server_Mmdevice in Naming service <%s>\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client::bind_to_server\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Client::init (int argc,char **argv)
+{
+
+ PortableServer::POAManager_var mgr
+ = TAO_AV_CORE::instance ()->poa ()->the_POAManager ();
+
+ mgr->activate ();
+
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ // Increase the debug_level so that we can see the output
+ this->parse_args (this->argc_, this->argv_);
+
+ if (this->my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ this->fp_ = ACE_OS::fopen (this->filename_,"r");
+ if (this->fp_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,"file opened successfully\n"));
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "ERROR: file %s could not be opened\n",
+ this->filename_), -1);
+ }
+
+ return 0;
+}
+
+int
+Client::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ char flow_protocol_str [BUFSIZ];
+ if (this->use_sfp_)
+ ACE_OS::strcpy (flow_protocol_str,"sfp:1.0");
+ else
+ ACE_OS::strcpy (flow_protocol_str,"");
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+ AVStreams::flowSpec flow_spec (1);
+
+ ACE_TRY_CHECK;
+ ACE_INET_Addr addr (this->address_);
+ ACE_NEW_RETURN (this->flowname_,
+ char [BUFSIZ],
+ 0);
+ ACE_OS::sprintf (this->flowname_,
+ "Data_%s",
+ this->protocol_);
+ TAO_Forward_FlowSpec_Entry entry (this->flowname_,
+ "IN",
+ "USER_DEFINED",
+ flow_protocol_str,
+ this->protocol_,
+ &addr);
+ flow_spec.length (1);
+ flow_spec [0] = entry.entry_to_string ();
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) Flowspec: %s\n", entry.entry_to_string() ));
+
+ AVStreams::MMDevice_var client_mmdevice
+ = this->client_mmdevice_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Boolean result =
+ this->streamctrl_.bind_devs (client_mmdevice.in (),
+ AVStreams::MMDevice::_nil (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (this->bind_to_server ("Server_MMDevice1") == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+ result = this->streamctrl_.bind_devs (AVStreams::MMDevice::_nil (),
+ this->server_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (this->bind_to_server ("Server_MMDevice2") == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+ result = this->streamctrl_.bind_devs (AVStreams::MMDevice::_nil (),
+ this->server_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"streamctrl::bind_devs failed\n"),-1);
+ AVStreams::flowSpec start_spec (1);
+ start_spec.length (1);
+ start_spec [0] = CORBA::string_dup (this->flowname_);
+ this->streamctrl_.start (start_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // Schedule a timer for the for the flow handler.
+ //TAO_AV_CORE::instance ()->run ();
+ ACE_Time_Value tv (10000,0);
+
+ TAO_AV_CORE::instance ()->orb ()->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "Exited the TAO_AV_Core::run\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client::run");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+ 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 ());
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result = 0;
+ result = CLIENT::instance ()->init (argc,argv);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"client::init failed\n"),1);
+ result = CLIENT::instance ()->run ();
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"client::run failed\n"),1);
+ }
+ ACE_CATCHANY
+
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ CLIENT::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h
new file mode 100644
index 00000000000..9cd6cc7e47f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h
@@ -0,0 +1,101 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TAO_AV_FTP_H
+#define TAO_AV_FTP_H
+
+#include "ace/Get_Opt.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Transport.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+
+class FTP_Client_Callback
+ :public TAO_AV_Callback
+{
+public:
+ FTP_Client_Callback (void);
+ virtual int handle_end_stream (void);
+ void set_protocol_object (TAO_AV_Protocol_Object *protocol_object) {this->protocol_object_ = protocol_object;}
+ virtual int handle_timeout (void *arg);
+ virtual void get_timeout (ACE_Time_Value *&tv,
+ void *&arg);
+
+protected:
+ int count_;
+ TAO_AV_Protocol_Object *protocol_object_;
+};
+
+class FTP_Client_StreamEndPoint
+ :public TAO_Client_StreamEndPoint
+{
+public:
+ FTP_Client_StreamEndPoint (void);
+
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+ virtual int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+protected:
+ // FTP_Client_Flow_Handler *handler_;
+ FTP_Client_Callback *callback_;
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A<FTP_Client_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> ENDPOINT_STRATEGY;
+
+class Client;
+class Endpoint_Reactive_Strategy
+ : public ENDPOINT_STRATEGY
+{
+public:
+ Endpoint_Reactive_Strategy (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ Client *client_ptr);
+ // constructor . The orb manager is needed for the TAO_AV_Endpoint_Reactive_Strategy_A.
+
+ virtual int make_stream_endpoint (FTP_Client_StreamEndPoint *& endpoint);
+ // hook to make our streamendpoint taking a Client pointer
+private:
+ Client *client_;
+ // pointer to command handler object
+};
+
+
+class Client
+{
+public:
+ Client (void);
+ int init (int argc, char **argv);
+ int run (void);
+ FILE *file (void);
+ char *flowname (void);
+ TAO_StreamCtrl* streamctrl (void);
+private:
+ int parse_args (int argc, char **argv);
+ int bind_to_server (const char *name);
+ Endpoint_Reactive_Strategy endpoint_strategy_;
+ AVStreams::MMDevice_var server_mmdevice_;
+ TAO_MMDevice client_mmdevice_;
+ TAO_StreamCtrl streamctrl_;
+ // Video stream controller
+
+ int argc_;
+ char **argv_;
+ const char *filename_;
+ const char *address_;
+
+ TAO_Naming_Client my_naming_client_;
+ FILE *fp_;
+ char *protocol_;
+ char *flowname_;
+ int use_sfp_;
+};
+
+typedef ACE_Unmanaged_Singleton<Client,ACE_Null_Mutex> CLIENT;
+
+#endif /* TAO_AV_FTP_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl
new file mode 100755
index 00000000000..c75e1347c78
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl
@@ -0,0 +1,90 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 6;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$test1 = PerlACE::LocalFile ("test1");
+$test2 = PerlACE::LocalFile ("test2");
+$input = PerlACE::LocalFile ("test_input");
+
+unlink $nsior, $test1, $test2, $input;
+
+# generate test stream data
+# the size of this file is limited by the maximum packet size
+# windows has a maximum size of 8KB
+$input = PerlACE::generate_test_file("test_input", 32000);
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+$SV1 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test1");
+$SV2 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test2");
+$CL = new PerlACE::Process ("ftp", "-ORBSvcConf components_svc$PerlACE::svcconf_ext -ORBInitRef NameService=file://$nsior -f $input");
+
+print STDERR "Starting Naming Service\n";
+
+if ($NS->Spawn () == -1) {
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ($nsior, 15) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Server 1\n";
+
+$SV1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Server 2\n";
+
+$SV2->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Client\n";
+
+$client = $CL->SpawnWaitKill (200);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV1->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server 1 returned $server\n";
+ $status = 1;
+}
+
+$server = $SV2->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server 2 returned $server\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior, $test1, $test2, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp
new file mode 100644
index 00000000000..343079ff7dd
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp
@@ -0,0 +1,244 @@
+// $Id$
+
+#include "server.h"
+
+int done = 0;
+
+FTP_Server_StreamEndPoint::FTP_Server_StreamEndPoint (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_StreamEndPoint::FTP_Server_StreamEndPoint\n"));
+}
+
+int
+FTP_Server_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_StreamEndPoint::get_callback\n"));
+ ACE_NEW_RETURN (callback,
+ FTP_Server_Callback,
+ -1);
+ return 0;
+}
+
+int
+FTP_Server_Callback::handle_stop (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::stop\n"));
+ ACE_OS::fclose (FTP_SERVER::instance ()->file ());
+ done = 1;
+ return 0;
+}
+
+int
+FTP_Server_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::receive_frame\n"));
+ while (frame != 0)
+ {
+ int result = ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ FTP_SERVER::instance ()->file ());
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Server_Flow_Handler::fwrite failed\n"),-1);
+ frame = frame->cont ();
+ }
+ return 0;
+}
+
+int
+FTP_Server_Callback::handle_end_stream (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::end_stream\n"));
+ done = 1;
+ return 0;
+}
+
+Server::Server (void)
+{
+ reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+}
+
+int
+Server::init (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ PortableServer::POAManager_var mgr
+ = TAO_AV_CORE::instance ()->poa ()->the_POAManager ();
+
+ mgr->activate ();
+
+ int result = this->parse_args (argc,argv);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"parse args failed\n"),-1);
+ // Initialize the naming services
+
+ if (my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ // Register the video mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name server_mmdevice_name (1);
+ server_mmdevice_name.length (1);
+ server_mmdevice_name [0].id = CORBA::string_dup ("Server_MMDevice1");
+ AVStreams::MMDevice_var mmdevice = this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (bind)
+ {
+ // Register the video control object with the naming server.
+ this->my_naming_client_->bind (server_mmdevice_name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (bind);
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound,al_ex)
+ {
+ server_mmdevice_name [0].id = CORBA::string_dup ("Server_MMDevice2");
+ this->my_naming_client_->bind (server_mmdevice_name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Server::run (void)
+{
+ CORBA::ORB_ptr orb = TAO_AV_CORE::instance ()->orb();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ while( !done )
+ {
+ CORBA::Boolean wp = orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (wp)
+ {
+ orb->perform_work( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_TRY_CHECK;
+
+ orb->shutdown( 1 ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Server::parse_args (int argc,char **argv)
+{
+ ACE_Get_Opt opts (argc,argv,"f:p:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->fp_ = ACE_OS::fopen (opts.opt_arg (),"w");
+ if (this->fp_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,"file opened successfully\n"));
+ }
+ break;
+ case 'p':
+ this->protocol_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,"Usage: server -f filename"),-1);
+ }
+ }
+ return 0;
+}
+
+FILE*
+Server::file (void)
+{
+ return this->fp_;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ int result = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ 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 ());
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ result = FTP_SERVER::instance ()->init (argc,argv);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_SERVER::init failed\n"),1);
+ result = FTP_SERVER::instance ()->run ();
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_SERVER::run failed\n"),1);
+
+ FTP_SERVER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return result;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Server, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Server, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/server.h b/TAO/orbsvcs/tests/AVStreams/Multicast/server.h
new file mode 100644
index 00000000000..a92714819df
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast/server.h
@@ -0,0 +1,52 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Transport.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/Policy.h"
+
+class FTP_Server_StreamEndPoint
+ :public TAO_Server_StreamEndPoint
+{
+public:
+ FTP_Server_StreamEndPoint (void);
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+};
+
+class FTP_Server_Callback
+ :public TAO_AV_Callback
+{
+public:
+ virtual int handle_stop (void);
+ virtual int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &);
+ virtual int handle_end_stream (void);
+};
+
+class Server
+{
+public:
+ Server (void);
+ int init (int argc,
+ char **argv);
+ int run (void);
+ FILE *file (void);
+protected:
+ int parse_args (int argc,char **argv);
+ TAO_Naming_Client my_naming_client_;
+ TAO_AV_Endpoint_Reactive_Strategy_B <FTP_Server_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ TAO_MMDevice *mmdevice_;
+ FILE *fp_;
+ char *protocol_;
+};
+
+typedef ACE_Unmanaged_Singleton<Server,ACE_Null_Mutex> FTP_SERVER;
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/AVS_Multicast_Full_Profile.mpc b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/AVS_Multicast_Full_Profile.mpc
new file mode 100644
index 00000000000..f18041d3f25
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/AVS_Multicast_Full_Profile.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(*server): avstreamsexe {
+ exename = server
+
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*ftp): avstreamsexe {
+ exename = ftp
+
+ Source_Files {
+ ftp.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/Makefile.am
new file mode 100644
index 00000000000..96a3601c4ce
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Multicast_Full_Profile_Ftp.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ftp
+
+ftp_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ftp_SOURCES = \
+ ftp.cpp \
+ ftp.h
+
+ftp_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Multicast_Full_Profile_Server.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ server.cpp \
+ server.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/README b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/README
new file mode 100644
index 00000000000..dc6b2b16ea5
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/README
@@ -0,0 +1,38 @@
+
+This directory contains a simple file transfer test program for the
+Full Profile & Multicast in the TAO's Audio/Video Streaming
+Service. This program can be run using UDP by default
+
+Executable Options:
+-------------------
+
+server:
+-------
+
+-f <filename> -> The name of the file under which the received stream
+ data has to be stored.
+
+ftp:
+----
+
+-f <filename> --> The file to be streamed to the server. It is currently
+ streamed at the rate of 0.5kbytes/s.
+
+-s --> flag to use SFP. This option cannot be used with -p
+ TCP since SFP currently runs only over UDP.
+
+Running the Test:
+-----------------
+
+In that order:
+
+Run the Naming Service
+
+server -f <filename1> (machine 1)
+
+server -f <filename2> (machine 2)
+
+ftp -f <filename> (machine 3)
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp
new file mode 100644
index 00000000000..11a0624b3f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp
@@ -0,0 +1,431 @@
+// $Id$
+
+#include "ftp.h"
+#include "tao/debug.h"
+
+FTP_Client_Callback::FTP_Client_Callback (void)
+ :count_ (0)
+{
+}
+
+int
+FTP_Client_Callback::handle_end_stream (void)
+{
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+ return 0;
+}
+
+void
+FTP_Client_Callback::get_timeout (ACE_Time_Value *&tv,
+ void *&)
+{
+ ACE_Time_Value *timeout;
+ ACE_NEW (timeout,
+ ACE_Time_Value(2));
+ tv = timeout;
+}
+
+int
+FTP_Client_Callback::handle_timeout (void *)
+{
+ ACE_Message_Block mb (BUFSIZ);
+ ACE_DEBUG ((LM_DEBUG,"FTP_Client_Callback::get_frame\n"));
+ char *buf = mb.rd_ptr ();
+
+ int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ());
+ if (n < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread end of file\n"),-1);
+ }
+ if (n == 0)
+ {
+ if (feof (CLIENT::instance ()->file ()))
+ {
+ // wait for sometime for the data to be flushed to the other side.
+ this->count_++;
+ if (this->count_ == 2)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n"));
+ AVStreams::flowSpec stop_spec (1);
+ ACE_DEBUG ((LM_DEBUG, "Just before Orb Shutdown\n"));
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0);
+ ACE_TRY_CHECK;
+ return 0;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"FTP_Client_Callback::handle_timeout\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ }
+ else
+ return 0;
+ }
+ else
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1);
+ }
+ mb.wr_ptr (n);
+ int result = this->protocol_object_->send_frame (&mb);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"send failed:%p","FTP_Client_Flow_Handler::send \n"),-1);
+ ACE_DEBUG ((LM_DEBUG,"handle_timeout::buffer sent succesfully\n"));
+ return 0;
+}
+
+FTP_Client_Producer::FTP_Client_Producer (void)
+ :TAO_FlowProducer ("Data",CLIENT::instance ()->protocols (),CLIENT::instance ()->format ())
+{
+}
+
+int
+FTP_Client_Producer::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ this->callback_->set_protocol_object (object);
+ return 0;
+}
+
+int
+FTP_Client_Producer::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_NEW_RETURN (this->callback_,
+ FTP_Client_Callback,
+ -1);
+ callback = this->callback_;
+ return 0;
+}
+
+int
+Client::parse_args (int argc,
+ char **argv)
+{
+ ACE_Get_Opt opts (argc,argv,"f:a:p:sd");
+
+ this->use_sfp_ = 0;
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'a':
+ this->address_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'p':
+ this->protocol_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 's':
+ this->use_sfp_ = 1;
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG,"Unknown option\n"));
+ return -1;
+
+ }
+ }
+ return 0;
+}
+
+FILE *
+Client::file (void)
+{
+ return this->fp_;
+}
+
+char*
+Client::flowname (void)
+{
+ return this->flowname_;
+}
+
+AVStreams::protocolSpec
+Client::protocols (void)
+{
+ AVStreams::protocolSpec protocols (1);
+ protocols.length (1);
+ char buf [BUFSIZ];
+ ACE_OS::sprintf (buf,"%s=%s",this->protocol_,this->address_);
+ protocols [0] = CORBA::string_dup (buf);
+ return protocols;
+}
+
+const char *
+Client::format (void)
+{
+ return "UNS:ftp";
+}
+
+const char *
+Client::address (void)
+
+{
+ return this->address_;
+}
+
+TAO_StreamCtrl*
+Client::streamctrl (void)
+{
+ return &this->streamctrl_;
+}
+
+Client::Client (void)
+ : client_mmdevice_ (&endpoint_strategy_),
+ fdev_ (0),
+ address_ (ACE_OS::strdup ("224.9.9.2:10002")),
+ fp_ (0),
+ protocol_ (ACE_OS::strdup ("UDP"))
+{
+ endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (), TAO_AV_CORE::instance ()->poa ());
+
+}
+
+
+int
+Client::bind_to_server (const char *name)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Initialize the naming services
+ if (my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ CosNaming::Name server_mmdevice_name (1);
+ server_mmdevice_name.length (1);
+ server_mmdevice_name [0].id = name;
+ CORBA::Object_var server_mmdevice_obj =
+ my_naming_client_->resolve (server_mmdevice_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->server_mmdevice_ =
+ AVStreams::MMDevice::_narrow (server_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->server_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve Server_Mmdevice in Naming service <%s>\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Command_Handler::resolve_reference");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Client::init (int argc,char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ PortableServer::POAManager_var mgr
+ = TAO_AV_CORE::instance ()->poa ()->the_POAManager ();
+
+ mgr->activate ();
+
+ this->parse_args (this->argc_, this->argv_);
+
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) Parsed Address %s\n", this->address_));
+
+ ACE_NEW_RETURN (this->fdev_,
+ FTP_Client_FDev,
+ -1);
+
+ ACE_NEW_RETURN (this->flowname_,
+ char [BUFSIZ],
+ 0);
+ ACE_OS::sprintf (this->flowname_,
+ "Data");
+ this->fdev_->flowname (this->flowname ());
+ AVStreams::MMDevice_var mmdevice = this->client_mmdevice_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::FDev_var fdev = this->fdev_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ mmdevice->add_fdev (fdev.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ if (this->my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ this->fp_ = ACE_OS::fopen (this->filename_,"r");
+ if (this->fp_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,"file opened successfully\n"));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Client::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ char flow_protocol_str [BUFSIZ];
+ if (this->use_sfp_)
+ ACE_OS::strcpy (flow_protocol_str,"sfp:1.0");
+ else
+ ACE_OS::strcpy (flow_protocol_str,"");
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+ AVStreams::flowSpec flow_spec (1);
+ // Bind the client and server mmdevices.
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) Parsed Address %s\n", this->address_));
+ ACE_INET_Addr *addr = new ACE_INET_Addr(this->address_);
+ TAO_Forward_FlowSpec_Entry entry (this->flowname_,
+ "IN",
+ "USER_DEFINED",
+ flow_protocol_str,
+ this->protocol_,
+ addr);
+ ACE_DEBUG ((LM_DEBUG, "(%N,%l) flowspec: %s\n", entry.entry_to_string() ));
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ AVStreams::MMDevice_var client_mmdevice =
+ this->client_mmdevice_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Boolean result =
+ this->streamctrl_.bind_devs (client_mmdevice.in (),
+ AVStreams::MMDevice::_nil (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"streamctrl::bind_devs for client_mmdevice failed\n"),-1);
+ if (this->bind_to_server ("Server_MMDevice1") == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+ result = this->streamctrl_.bind_devs (AVStreams::MMDevice::_nil (),
+ this->server_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"(%N,%l) streamctrl::bind_devs for mmdevice 1 failed\n"),-1);
+ ACE_TRY_CHECK;
+ if (this->bind_to_server ("Server_MMDevice2") == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+ result = this->streamctrl_.bind_devs (AVStreams::MMDevice::_nil (),
+ this->server_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"(%N,%l) streamctrl::bind_devs for mmdevice 2 failed\n"),-1);
+ AVStreams::flowSpec start_spec (1);
+ start_spec.length (1);
+ start_spec [0] = CORBA::string_dup (this->flowname_);
+ this->streamctrl_.start (start_spec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // Schedule a timer for the for the flow handler.
+ //TAO_AV_CORE::instance ()->run ();
+
+ ACE_Time_Value tv (10000,0);
+ TAO_AV_CORE::instance ()->orb ()->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "Exited the TAO_AV_Core::run\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client::run");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+main (int argc,
+ char *argv[])
+{
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ 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 ());
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ int result = 0;
+ result = CLIENT::instance ()->init (argc,argv);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"client::init failed\n"),1);
+ result = CLIENT::instance ()->run ();
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"client::run failed\n"),1);
+
+ CLIENT::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return result;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.h b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.h
new file mode 100644
index 00000000000..acb8081d72d
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.h
@@ -0,0 +1,88 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TAO_AV_FTP_H
+#define TAO_AV_FTP_H
+
+#include "ace/Get_Opt.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Flows_T.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+
+class FTP_Client_Callback;
+class FTP_Client_Producer
+ :public virtual TAO_FlowProducer
+{
+public:
+ FTP_Client_Producer (void);
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+protected:
+ FTP_Client_Callback *callback_;
+};
+
+class FTP_Client_Callback
+ :public TAO_AV_Callback
+{
+public:
+ FTP_Client_Callback (void);
+ virtual int handle_timeout (void *arg);
+ virtual int handle_end_stream (void);
+ virtual void get_timeout (ACE_Time_Value *&tv,
+ void *&arg);
+ // virtual int get_frame (ACE_Message_Block *&block,TAO_AV_frame_info *&frame_info);
+ void set_protocol_object (TAO_AV_Protocol_Object *protocol_object) {this->protocol_object_ = protocol_object;}
+
+protected:
+ // FTP_Client_Flow_Handler *handler_;
+ int count_;
+ TAO_AV_Protocol_Object *protocol_object_;
+};
+
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A<TAO_StreamEndPoint_A,TAO_VDev,AV_Null_MediaCtrl> ENDPOINT_STRATEGY;
+
+typedef TAO_FDev <FTP_Client_Producer,TAO_FlowConsumer> FTP_Client_FDev;
+class Client
+{
+public:
+ Client (void);
+ int init (int argc, char **argv);
+ int run (void);
+ FILE *file (void);
+ char *flowname (void);
+ TAO_StreamCtrl* streamctrl (void);
+ AVStreams::protocolSpec protocols (void);
+ const char *format (void);
+ const char *address (void);
+private:
+ int parse_args (int argc, char **argv);
+ int bind_to_server (const char *name);
+ ENDPOINT_STRATEGY endpoint_strategy_;
+ AVStreams::MMDevice_var server_mmdevice_;
+ TAO_MMDevice client_mmdevice_;
+ FTP_Client_FDev *fdev_;
+ TAO_StreamCtrl streamctrl_;
+ // Video stream controller
+
+ int argc_;
+ char **argv_;
+ const char *filename_;
+ const char *address_;
+
+ TAO_Naming_Client my_naming_client_;
+ FILE *fp_;
+ char *protocol_;
+ char *flowname_;
+ int use_sfp_;
+};
+
+typedef ACE_Unmanaged_Singleton<Client,ACE_Null_Mutex> CLIENT;
+
+#endif /* TAO_AV_FTP_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl
new file mode 100755
index 00000000000..73fcc6e8f30
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl
@@ -0,0 +1,87 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 6;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$test1 = PerlACE::LocalFile ("test1");
+$test2 = PerlACE::LocalFile ("test2");
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+unlink $nsior, $test1, $test2;
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+$SV1 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test1");
+$SV2 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test2");
+$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f $input");
+
+print STDERR "Starting Naming Service\n";
+
+if ($NS->Spawn () == -1) {
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ($nsior, 5) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Server 1\n";
+
+$SV1->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Server 2\n";
+
+$SV2->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Client\n";
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV1->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server 1 returned $server\n";
+ $status = 1;
+}
+
+$server = $SV2->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server 2 returned $server\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior, $test1, $test2, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp
new file mode 100644
index 00000000000..a83a5b623da
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp
@@ -0,0 +1,291 @@
+// $Id$
+
+#include "server.h"
+
+FTP_Server_FlowEndPoint::FTP_Server_FlowEndPoint (void)
+ :TAO_FlowConsumer ("Data",FTP_SERVER::instance ()->protocols (),FTP_SERVER::instance ()->format ())
+{
+ AVStreams::protocolSpec protocols (2);
+ protocols.length (2);
+ protocols [0] = CORBA::string_dup ("TCP");
+ protocols [1] = CORBA::string_dup ("UDP");
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->set_protocol_restriction (protocols
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"FTP_Server_FlowEndPoint::FTP_Server_FlowEndPoint");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+int
+FTP_Server_FlowEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_StreamEndPoint::get_sfp_callback\n"));
+ ACE_NEW_RETURN (callback,
+ FTP_Server_Callback,
+ -1);
+ return 0;
+}
+
+int
+FTP_Server_Callback::handle_stop (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::stop\n"));
+ ACE_OS::fclose (FTP_SERVER::instance ()->file ());
+ TAO_AV_CORE::instance ()->orb ()->shutdown ();
+ return 0;
+}
+
+int
+FTP_Server_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::receive_frame\n"));
+ while (frame != 0)
+ {
+ int result = ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ FTP_SERVER::instance ()->file ());
+ if (result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_Server_Flow_Handler::fwrite failed\n"),-1);
+ frame = frame->cont ();
+ }
+ return 0;
+}
+
+int
+FTP_Server_Callback::handle_end_stream (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"FTP_SFP_Callback::end_stream\n"));
+ CORBA::ORB_var orb = TAO_AV_CORE::instance ()->orb ();
+ orb->shutdown ();
+ return 0;
+}
+
+// FTP_Server_FDev::FTP_Server_FDev (void)
+// :TAO_FDev ("Data")
+// {
+// }
+
+// AVStreams::FlowConsumer_ptr
+// FTP_Server_FDev::make_consumer (AVStreams::FlowConnection_ptr the_requester,
+// AVStreams::QoS & the_qos,
+// CORBA::Boolean_out met_qos,
+// char *& named_fdev,
+// ACE_ENV_SINGLE_ARG_DECL)
+// {
+// ACE_DEBUG ((LM_DEBUG,"FTP_Server_FDev::make_consumer"));
+// FTP_Server_FlowEndPoint *endpoint;
+// ACE_NEW_RETURN (endpoint,
+// FTP_Server_FlowEndPoint,
+// 0);
+// return endpoint->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+// ACE_CHECK_RETURN (0);
+// }
+
+Server::Server (void)
+{
+ reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+}
+
+AVStreams::protocolSpec
+Server::protocols (void)
+{
+ AVStreams::protocolSpec protocols (2);
+ protocols.length (2);
+ protocols [0] = CORBA::string_dup ("TCP");
+ protocols [1] = CORBA::string_dup ("UDP");
+ return protocols;
+}
+
+const char*
+Server::format (void)
+{
+ return "UNS:ftp";
+}
+
+int
+Server::init (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ PortableServer::POAManager_var mgr
+ = TAO_AV_CORE::instance ()->poa ()->the_POAManager ();
+
+ mgr->activate ();
+
+ int result = this->parse_args (argc,argv);
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"parse args failed\n"),-1);
+ // Initialize the naming services
+
+ if (my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ // Register the video mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ ACE_NEW_RETURN (this->fdev_,
+ FTP_Server_FDev,
+ -1);
+ this->fdev_->flowname ("Data");
+ AVStreams::MMDevice_var mmdevice = this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ AVStreams::FDev_var fdev = this->fdev_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ mmdevice->add_fdev (fdev.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name server_mmdevice_name (1);
+ server_mmdevice_name.length (1);
+ server_mmdevice_name [0].id = CORBA::string_dup ("Server_MMDevice1");
+ ACE_TRY_EX (bind)
+ {
+ // Register the video control object with the naming server.
+ this->my_naming_client_->bind (server_mmdevice_name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (bind);
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound,al_ex)
+ {
+ server_mmdevice_name [0].id = CORBA::string_dup ("Server_MMDevice2");
+ this->my_naming_client_->bind (server_mmdevice_name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Server::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ TAO_AV_CORE::instance ()->orb ()->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+Server::parse_args (int argc,char **argv)
+{
+ ACE_Get_Opt opts (argc,argv,"f:p:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->fp_ = ACE_OS::fopen (opts.opt_arg (),"w");
+ if (this->fp_ != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,"file opened successfully\n"));
+ }
+ break;
+ case 'p':
+ this->protocol_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,"Usage: server -f filename"),-1);
+
+ }
+ }
+ return 0;
+}
+
+FILE*
+Server::file (void)
+{
+ return this->fp_;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv);
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ 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 ());
+
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ int result = 0;
+ result = FTP_SERVER::instance ()->init (argc,argv);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_SERVER::init failed\n"),1);
+ result = FTP_SERVER::instance ()->run ();
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"FTP_SERVER::run failed\n"),1);
+
+ FTP_SERVER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return result;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Server, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Server, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.h b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.h
new file mode 100644
index 00000000000..bdd2957c2ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.h
@@ -0,0 +1,70 @@
+/* -*- C++ -*- */
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Flows_T.h"
+#include "orbsvcs/AV/sfp.h"
+#include "orbsvcs/AV/MCast.h"
+#include "orbsvcs/AV/Policy.h"
+
+class FTP_Server_Callback
+ :public TAO_AV_Callback
+{
+public:
+ virtual int handle_stop (void);
+ virtual int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &);
+ virtual int handle_end_stream (void);
+};
+
+class FTP_Server_FlowEndPoint
+ :public TAO_FlowConsumer
+{
+public:
+ FTP_Server_FlowEndPoint (void);
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+};
+
+// class FTP_Server_FDev
+// :public TAO_FDev
+// {
+// public:
+// FTP_Server_FDev (void);
+// virtual AVStreams::FlowConsumer_ptr make_consumer (AVStreams::FlowConnection_ptr the_requester,
+// AVStreams::QoS & the_qos,
+// CORBA::Boolean_out met_qos,
+// char *& named_fdev,
+// ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+// // bridge method for the application to override the consumer object
+// // creation. Default implementation creates a TAO_FlowConsumer.
+
+// };
+
+typedef TAO_FDev <TAO_FlowProducer, FTP_Server_FlowEndPoint> FTP_Server_FDev;
+
+class Server
+{
+public:
+ Server (void);
+ int init (int argc,
+ char **argv);
+ int run (void);
+ FILE *file (void);
+ AVStreams::protocolSpec protocols (void);
+ const char *format (void);
+protected:
+ int parse_args (int argc,char **argv);
+ TAO_Naming_Client my_naming_client_;
+ TAO_AV_Endpoint_Reactive_Strategy_B <TAO_StreamEndPoint_B,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ TAO_MMDevice *mmdevice_;
+ FTP_Server_FDev *fdev_;
+ FILE *fp_;
+ char *protocol_;
+};
+
+typedef ACE_Unmanaged_Singleton<Server,ACE_Null_Mutex> FTP_SERVER;
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/AVS_Multiple_Flows.mpc b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/AVS_Multiple_Flows.mpc
new file mode 100644
index 00000000000..ff55e80a109
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/AVS_Multiple_Flows.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe {
+ exename = sender
+
+ Source_Files {
+ sender.cpp
+ }
+}
+
+project(*recv): avstreamsexe {
+ exename = receiver
+
+ Source_Files {
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/Makefile.am
new file mode 100644
index 00000000000..5db84134548
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Multiple_Flows_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ receiver.cpp \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Multiple_Flows_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ sender.cpp \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/README b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/README
new file mode 100644
index 00000000000..a6deaa1f938
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/README
@@ -0,0 +1,57 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a simple test in the form of a sender and a
+receiver. The test has the following features:
+
+1. It tests the AVStreams Pluggable Protocol Framework
+2. Shows a mechanism to pace data.
+3. Shows how to set up multiple data streams between the same MMDevices.
+
+The sender sets up two data streams:
+1. Data_Receiver_One and
+2. Data_Receiver_Two
+
+and sends the data from the input file on both these streams.
+
+The receiver creates two output files:
+1. Data_Receiver_One and
+2. Data_Receiver_Two
+
+corresponding to the two data streams.
+
+Running the test
+----------------
+
+receiver
+--------
+
+receiver
+
+-f <input_filename> -> The name of the file from which data is sent to the receiver
+
+sender
+------
+
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-d]
+
+
+-f filename --> The file to be streamed to the receiver (defaults to
+ "input").
+
+-p protocol --> The protocol string could be UDP or TCP (defaults to
+ UDP). But with the multicast address it should be UDP.
+
+-r framerate--> The rate at which tha data frames need to be sent
+ (defaults to 30 frames per second).
+
+-d --> Increament the TAO_debug_level for debug messages.
+
+
+The test must be run with the naming service. Check the run_test.pl
+to see how to configure the test case.
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.cpp
new file mode 100644
index 00000000000..ef33207328f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.cpp
@@ -0,0 +1,306 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+int endstream = 0;
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+typedef ACE_Unmanaged_Singleton<Receiver,ACE_Null_Mutex> RECEIVER;
+
+
+int
+Receiver_StreamEndPoint::get_callback (const char *flow_name,
+ TAO_AV_Callback *&callback)
+{
+ Receiver_Callback *callback_;
+ ACE_NEW_RETURN (callback_,
+ Receiver_Callback,
+ -1);
+
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = callback_;
+ callback_->flowname (flow_name);
+ return 0;
+}
+
+
+int
+Receiver_StreamEndPoint::set_protocol_object (const char * flowname,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ if (ACE_OS::strcmp (flowname, "Data_Receiver1") == 0)
+ RECEIVER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (1),
+ mb_ (BUFSIZ)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::Receiver_Callback\n"));
+}
+
+void
+Receiver_Callback::flowname (const char* flow_name)
+{
+ this->flowname_ = flow_name;
+
+ // Make sure we have a valid <output_file>
+ this->output_file_ = ACE_OS::fopen (this->flowname_.c_str (),
+ "w");
+ if (this->output_file_ == 0)
+ ACE_ERROR ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ this->flowname_.c_str ()));
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "%s File Opened Successfully\n",
+ this->flowname_.c_str ()));
+
+
+}
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d for flow %s\n",
+ this->frame_count_++,
+ this->flowname_.c_str ()));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ this->output_file_);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ return 0;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::handle_destroy\n"));
+
+ endstream++;
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0),
+ frame_rate_ (30),
+ frame_count_ (0),
+ filename_ ("input"),
+ mb_ (BUFSIZ)
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+void
+Receiver::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Receiver::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
+Receiver::init (int argc,
+ char ** argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Initialize the naming services
+ if (this->naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the receiver object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+Receiver::protocol_object (void)
+{
+ return this->protocol_object_;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result =
+ RECEIVER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ while (endstream != 2)
+ {
+ orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ RECEIVER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Receiver, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Receiver, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.h b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.h
new file mode 100644
index 00000000000..f5fb5efa767
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/receiver.h
@@ -0,0 +1,144 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+ void flowname (const char*);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ ACE_CString flowname_;
+
+ FILE *output_file_;
+ // File handle of the file into which received data is written.
+
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ // Constructor
+
+ ~Receiver (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ TAO_AV_Protocol_Object * protocol_object (void);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+protected:
+ TAO_Naming_Client naming_client_;
+ // The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reactive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ // Receiver MMDevice.
+
+ int frame_rate_;
+ // Rate at which the data will be sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+};
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl
new file mode 100755
index 00000000000..c04de62dfd6
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl
@@ -0,0 +1,71 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib $ENV{"ACE_ROOT"}.'/bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$outfile = PerlACE::LocalFile ("output");
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+unlink $nsior;
+
+$NS = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/Naming_Service/Naming_Service", "-o $nsior");
+$SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -f output");
+$CL = new PerlACE::Process ("sender", "-ORBDebugLevel 2 -ORBInitRef NameService=file://$nsior -f $input -r 2");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 5) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Receiver\n";
+
+$SV->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender\n";
+
+$sender = $CL->SpawnWaitKill (200);
+
+if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+$receiver = $SV->TerminateWaitKill (5);
+
+if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.cpp
new file mode 100644
index 00000000000..79169527b6d
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.cpp
@@ -0,0 +1,439 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ SENDER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ streamctrl_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ protocol_ ("UDP"),
+ frame_rate_ (30),
+ mb_ (BUFSIZ)
+{
+}
+
+void
+Sender::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_.insert (object);
+}
+
+void
+Sender::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Shut the orb down.
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:p:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'p':
+ this->protocol_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+// Method to get the object reference of the receiver
+int
+Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Resolve the receiver object reference from the Naming Service
+ CORBA::Object_var receiver_mmdevice_obj =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->receiver_mmdevice_ =
+ AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->receiver_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Receiver_MMdevice in Naming service <%s>\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the naming services
+ result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Resolve the object reference of the receiver from the Naming Service.
+ result = this->bind_to_receiver (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry ("Data_Receiver_One",
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ 0);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (2);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry1 ("Data_Receiver_Two",
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ 0);
+
+ flow_spec [1] = CORBA::string_dup (entry1.entry_to_string ());
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->streamctrl_,
+ TAO_StreamCtrl,
+ -1);
+
+ PortableServer::ServantBase_var safe_streamctrl =
+ this->streamctrl_;
+
+ // Bind/Connect the sender and receiver MMDevices.
+ CORBA::Boolean bind_result =
+ this->streamctrl_->bind_devs (mmdevice.in (),
+ this->receiver_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (bind_result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "streamctrl::bind_devs failed\n"),
+ -1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The time that should lapse between two consecutive frames sent.
+ ACE_Time_Value inter_frame_time;
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1 / (double) this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %d / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ break;
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ ProtocolObject_SetItor end = this->protocol_object_.end ();
+ for (ProtocolObject_SetItor begin = this->protocol_object_.begin ();
+ begin != end; ++begin)
+ {
+ // Send frame.
+ int result =
+ (*begin)->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+ }
+
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ } // end while
+
+ this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Sender.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::init failed\n"),
+ -1);
+
+ // Start sending data.
+ result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.h b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.h
new file mode 100644
index 00000000000..d37c46f21b9
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Multiple_Flows/sender.h
@@ -0,0 +1,123 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+typedef ACE_Unbounded_Set<TAO_AV_Protocol_Object*> ProtocolObject_Set;
+typedef ACE_Unbounded_Set_Iterator<TAO_AV_Protocol_Object*> ProtocolObject_SetItor;
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ // = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Method to pace and send data from a file.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ int bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL);
+ // Method that binds the sender to the receiver.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ // The endpoint strategy used by the sender.
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ // The receiver MMDevice that the sender connects to.
+
+ TAO_MMDevice *sender_mmdevice_;
+ // The sender MMDevice.
+
+ TAO_StreamCtrl *streamctrl_;
+ // Stream controller
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ ACE_CString protocol_;
+ // Selected protocol - default is UDP
+
+ int frame_rate_;
+ // Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ ProtocolObject_Set protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/AVS_Pluggable.mpc b/TAO/orbsvcs/tests/AVStreams/Pluggable/AVS_Pluggable.mpc
new file mode 100644
index 00000000000..f18041d3f25
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/AVS_Pluggable.mpc
@@ -0,0 +1,19 @@
+// -*- MPC -*-
+// $Id$
+
+project(*server): avstreamsexe {
+ exename = server
+
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*ftp): avstreamsexe {
+ exename = ftp
+
+ Source_Files {
+ ftp.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Pluggable/Makefile.am
new file mode 100644
index 00000000000..23de00a8320
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Pluggable_Ftp.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ftp
+
+ftp_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ftp_SOURCES = \
+ ftp.cpp \
+ ftp.h
+
+ftp_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Pluggable_Server.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ server.cpp \
+ server.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/README b/TAO/orbsvcs/tests/AVStreams/Pluggable/README
new file mode 100644
index 00000000000..f5d2725204d
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/README
@@ -0,0 +1,45 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a comprehensive test in the form of a ftp client and server.
+The test has the following features.
+
+1. It tests the AVStreams Pluggable Protocol Framework
+2. Shows a mechanism to pace data.
+3. Performs benchmarking.
+
+Running the test
+----------------
+
+server
+------
+
+server -f <output_filename>
+
+-f <output_filename> -> The name of the file under which the received stream
+ data has to be stored.
+
+ftp:
+----
+
+ftp [-f <filename>] [-a <address>] [-p <protocol>] [-s] [-r <frame rate>] [-d]
+
+
+-f filename --> The file to be streamed to the server. It is currently
+ streamed at the rate of 0.5kbytes/s.
+
+-a address --> Multicast address or the host on which the client is running
+ Default is multicast address
+
+-p protocol --> The protocol string could be UDP or TCP. But with the
+ multicast address it should be UDP.
+
+-s --> flag to use SFP. This option cannot be used with -p
+ TCP since SFP currently runs only over UDP.
+
+-r framerate--> The rate at which tha data frames need to be sent.
+
+-d --> Increament the TAO_debug_level for debug messages.
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp
new file mode 100644
index 00000000000..d3519e0114f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp
@@ -0,0 +1,489 @@
+// $Id$
+
+#include "ftp.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+ACE_High_Res_Timer last_frame_sent_time;
+// The time taken for sending a frmae and preparing for the next frame
+
+ACE_Time_Value inter_frame_time;
+// The time that should lapse between two consecutive frames sent.
+
+FTP_Client_Callback::FTP_Client_Callback (void)
+{
+}
+
+FTP_Client_StreamEndPoint::FTP_Client_StreamEndPoint (void)
+{
+}
+
+int
+FTP_Client_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the clienmt application callback and return to the AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+FTP_Client_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the client protocol object corresponding to the transport protocol selected.
+ CLIENT::instance ()->set_protocol_object (object);
+ return 0;
+}
+
+Client::Client (void)
+ :client_mmdevice_ (&endpoint_strategy_),
+ count_ (0),
+ address_ (0),
+ peer_addr_str_ (0),
+ fp_ (0),
+ protocol_ (ACE_OS::strdup ("UDP")),
+ frame_rate_ (30)
+{
+ this->mb.size (BUFSIZ);
+}
+
+void
+Client::set_protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the client protocol object corresponding to the transport protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Client::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc,argv,"f:l:a:p:r:sd");
+
+ this->use_sfp_ = 0;
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'l':
+ this->address_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'a':
+ this->peer_addr_str_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'p':
+ this->protocol_ = ACE_OS::strdup (opts.opt_arg ());
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 's':
+ this->use_sfp_ = 1;
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG,"Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+FILE *
+Client::file (void)
+{
+ return this->fp_;
+}
+
+char*
+Client::flowname (void)
+{
+ return this->flowname_;
+}
+
+TAO_StreamCtrl*
+Client::streamctrl (void)
+{
+ return &this->streamctrl_;
+}
+
+
+int
+Client::frame_rate (void)
+{
+ return this->frame_rate_;
+}
+
+
+// Method to get the object reference of the server
+int
+Client::bind_to_server (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Initialize the naming services
+ if (my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ CosNaming::Name server_mmdevice_name (1);
+ server_mmdevice_name.length (1);
+ server_mmdevice_name [0].id = CORBA::string_dup ("Server_MMDevice");
+
+ // Resolve the server object reference from the Naming Service
+ CORBA::Object_var server_mmdevice_obj =
+ my_naming_client_->resolve (server_mmdevice_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->server_mmdevice_ =
+ AVStreams::MMDevice::_narrow (server_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->server_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Server_MMdevice in Naming service <%s>\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Client::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ CORBA::String_var ior;
+
+ // Initialize the endpoint strategy with the orb and poa.
+ this->endpoint_strategy_.init(TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+
+ // Parse the command line arguments
+ int result = this->parse_args (argc,
+ argv);
+
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->fp_ = ACE_OS::fopen (this->filename_,
+ "r");
+ if (this->fp_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_),
+ -1);
+
+ result
+ = this->bind_to_server (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Resolve the object reference of the server from the Naming Service.
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+
+ // Create the Flow protocol name
+ char flow_protocol_str [BUFSIZ];
+ if (this->use_sfp_)
+ ACE_OS::strcpy (flow_protocol_str,
+ "sfp:1.0");
+ else
+ ACE_OS::strcpy (flow_protocol_str,
+ "");
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Set the address of the ftp client.
+ ACE_INET_Addr* addr;
+ if (this->address_ != 0)
+ ACE_NEW_RETURN (addr,
+ ACE_INET_Addr (this->address_),
+ -1);
+ else
+ {
+ char buf [BUFSIZ];
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ ACE_NEW_RETURN (addr,
+ ACE_INET_Addr ("5000",
+ buf),
+ -1);
+ }
+
+ // Initialize the flowname
+ ACE_NEW_RETURN (this->flowname_,
+ char [BUFSIZ],
+ 0);
+
+ ACE_OS::sprintf (this->flowname_,
+ "Data_%s",
+ this->protocol_);
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry (this->flowname_,
+ "IN",
+ "USER_DEFINED",
+ flow_protocol_str,
+ this->protocol_,
+ addr);
+
+ ACE_INET_Addr* peer_addr;
+ if (this->peer_addr_str_ != 0)
+ ACE_NEW_RETURN (peer_addr,
+ ACE_INET_Addr (this->peer_addr_str_),
+ -1);
+ else
+ {
+ char buf [BUFSIZ];
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ ACE_NEW_RETURN (peer_addr,
+ ACE_INET_Addr ("5050",
+ buf),
+ -1);
+ }
+
+ entry.set_peer_addr (peer_addr);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ AVStreams::MMDevice_var client_mmdevice =
+ this->client_mmdevice_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Bind/Connect the client and server MMDevices.
+ CORBA::Boolean bind_result =
+ this->streamctrl_.bind_devs (client_mmdevice.in (),
+ this->server_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (bind_result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"streamctrl::bind_devs failed\n"),-1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Client::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ // Rate at which frames of data need to be sent.
+ this->frame_rate_ = CLIENT::instance ()->frame_rate ();
+
+ // Time within which a frame should be sent.
+ double frame_time = 1/ (double) this->frame_rate_;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Time ONE = %f\n Frame Rate = %d\n",
+ frame_time,
+ this->frame_rate_));
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (frame_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Inter Frame Time = %d\n",
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Count the frames sent.
+ count_++;
+
+ // Read from the file into a message block.
+ size_t n = ACE_OS::fread(this->mb.rd_ptr (),
+ 1,
+ this->mb.size (),
+ CLIENT::instance ()->file ());
+
+ if (n == 0)
+ {
+ if (feof (CLIENT::instance ()->file ()))
+ {
+ // At end of file break the loop and end the client.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ break;
+ }
+
+ }
+
+ this->mb.wr_ptr (n);
+
+ if ( this->count_ > 1)
+ {
+ // Greater than the first frame.
+
+ // Stop the timer that was started just before the previous frame was sent.
+ last_frame_sent_time.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value tv;
+ last_frame_sent_time.elapsed_time (tv);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ tv.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (tv < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Claculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - tv);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // run the orb for the wait time so the client can continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ last_frame_sent_time.start ();
+
+ // Send frame.
+ int result = this->protocol_object_->send_frame (&this->mb);
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p","FTP_Client_Flow_Handler::send\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,"Client::pace_data buffer sent succesfully\n"));
+
+ // Reset the mb.
+ this->mb.reset ();
+
+ } // end while
+
+ // Since the file is read stop the stream.
+ AVStreams::flowSpec stop_spec (1);
+ CLIENT::instance ()->streamctrl ()->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Shut the orb down.
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Client::pace_data Failed");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ //Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV STream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // INitialize the Client.
+ int result = 0;
+ result = CLIENT::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "client::init failed\n"),1);
+
+ // Start sending data.
+ result = CLIENT::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ ACE_CATCHANY
+
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Client Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ CLIENT::close ();
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Client, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h
new file mode 100644
index 00000000000..4f405b5a9da
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h
@@ -0,0 +1,173 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Pluggable
+//
+// = FILENAME
+// ftp.h
+//
+// = DESCRIPTION
+// Ftp client to send data
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+
+#ifndef TAO_AV_FTP_H
+#define TAO_AV_FTP_H
+
+#include "ace/Get_Opt.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+
+class FTP_Client_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Defines the client applcation callback.
+ //
+ // = DESCRIPTION
+ // This class can override the methods of
+ // the TAO_AV_Callback to do application
+ // specific processing.
+public:
+ FTP_Client_Callback (void);
+ //Constructor
+};
+
+
+class FTP_Client_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines the client stream endpoint.
+ //
+ // = DESCRIPTION
+ // This class overrides the methods of TAO_ClientStreamendpoint
+ // so the application can perform its processing during post and pre
+ // connection set up.
+
+public:
+ FTP_Client_StreamEndPoint (void);
+ //Contructor
+
+ virtual int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application client callback and return its handle to the
+ // AVSTreams for further application callbacks
+
+ virtual int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol chosen.
+
+protected:
+ FTP_Client_Callback callback_;
+ // reference to the cllient application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A <FTP_Client_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> ENDPOINT_STRATEGY;
+
+
+class Client
+{
+ // = TITLE
+ // Defines the Client Application
+ //
+ // = DESCRIPTION
+ // The actual client program that acts as the ftp client that streams data
+ // to the ftp servers that are waiting for data.
+public:
+ Client (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Method to initialize the various data components.
+
+ void set_protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Method to pace and send data from a file.
+
+ FILE *file (void);
+ // File handle from which data is read to be sent.
+
+ TAO_StreamCtrl* streamctrl (void);
+ // The stream control interface that manages the stream set up
+
+ char *flowname (void);
+ // name of the flow set up.
+
+ int frame_rate (void);
+ // The requested frame rate for sending each frame of data read from the file.
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ int bind_to_server (ACE_ENV_SINGLE_ARG_DECL);
+ // Method that binds the ftp client to the server
+
+ ENDPOINT_STRATEGY endpoint_strategy_;
+ // The reacfive strategy of the client.
+
+ AVStreams::MMDevice_var server_mmdevice_;
+ // The server MMDevice that the ftpo client connects to
+
+ TAO_MMDevice client_mmdevice_;
+ // The ftp client MMDevice.
+
+ TAO_StreamCtrl streamctrl_;
+ // Video stream controller
+
+ int count_;
+ // Number of frames sent.
+
+ int argc_;
+ char **argv_;
+
+ const char *filename_;
+ // File from which data is read.
+
+ const char *address_;
+ // Address of the ftp client host machine or a multicast address - Default is
+ // UDP multicast addess
+ const char *peer_addr_str_;
+
+ TAO_Naming_Client my_naming_client_;
+ // The Naming Service client.
+
+ FILE *fp_;
+ // File handle of the file read from.
+
+ char *protocol_;
+ // Selected protocol - default is UDP
+
+ char *flowname_;
+
+ int use_sfp_;
+ // If set to 1 then use sfp as the flow carrier protocol.
+
+ int frame_rate_;
+
+ ACE_Message_Block mb;
+ // Message block into which data is read from a file and then sent.
+
+ TAO_AV_Protocol_Object* protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+
+};
+
+typedef ACE_Unmanaged_Singleton<Client,ACE_Null_Mutex> CLIENT;
+
+#endif /* TAO_AV_FTP_H */
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl
new file mode 100755
index 00000000000..c0e20575ff7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl
@@ -0,0 +1,123 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$input = PerlACE::LocalFile ("test_input");
+
+$debug = 0;
+
+unlink $nsior, $test_input;
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+for ($i = 0; $i <= $#ARGV; $i++)
+{
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ {
+ print STDERR "\nusage: run_test\n";
+
+ print STDERR "\t-h shows options menu\n";
+
+ print STDERR "\t-p: Transport protocols defaults to (";
+ for $protocol (@protocols)
+ {
+ print STDERR "$protocol, ";
+ }
+ print STDERR ")\n";
+
+ print STDERR "\t-d: Debug Level defaults to 0";
+
+ print STDERR "\n";
+
+ exit;
+ }
+ elsif ($ARGV[$i] eq "-p")
+ {
+ @protocols = split (',', $ARGV[$i + 1]);
+ $i++;
+ }
+ elsif ($ARGV[$i] eq "-d")
+ {
+ $debug = $ARGV[$i + 1];
+ $i++;
+ }
+}
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
+{
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+
+$output_file = "TCP_output";
+
+for $protocol (@protocols)
+{
+
+ $output_file = $protocol."_output";
+
+ if ($protocol eq "RTP_UDP")
+ {
+ $protocol = "RTP/UDP";
+ }
+
+ $SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
+ $CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
+
+ print STDERR "Using ".$protocol."\n";
+ print STDERR "Starting Receiver\n";
+
+ $SV->Spawn ();
+
+ sleep $sleeptime;
+
+ print STDERR "Starting Sender\n";
+
+ $sender = $CL->SpawnWaitKill (200);
+
+ if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+ }
+
+ $receiver = $SV->TerminateWaitKill (200);
+
+ if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+ }
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp
new file mode 100644
index 00000000000..db4658830c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp
@@ -0,0 +1,232 @@
+
+
+// $Id$
+
+#include "server.h"
+#include "ace/Get_Opt.h"
+
+static FILE *output_file = 0;
+// File into which the received data is written.
+
+static const char *output_file_name = "output";
+// File handle of the file into which data is written.
+
+int done = 0;
+
+
+int
+FTP_Server_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the server application callback to the AVStreams for further upcalls,
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+FTP_Server_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ // Upcall from the AVStreams when there is data to be received from the
+ // ftp client.
+
+ ACE_DEBUG ((LM_DEBUG,
+ "FTP_Server_Callback::receive_frame\n"));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result = ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "FTP_Server_Flow_Handler::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+ return 0;
+}
+
+int
+FTP_Server_Callback::handle_destroy (void)
+{
+ // Called when the ftp client requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "FTP_Server_Callback::end_stream\n"));
+ done = 1;
+ return 0;
+}
+
+Server::Server (void)
+ : mmdevice_ (0)
+{
+}
+
+Server::~Server (void)
+{
+ delete this->mmdevice_;
+}
+
+int
+Server::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Register the server mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name server_mmdevice_name (1);
+ server_mmdevice_name.length (1);
+ server_mmdevice_name [0].id = CORBA::string_dup ("Server_MMDevice");
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ // Initialize the naming services
+ if (this->my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the server object with the naming server.
+ this->my_naming_client_->rebind (server_mmdevice_name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+parse_args (int argc,
+ char **argv)
+{
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ output_file_name = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: server -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result =
+ parse_args (argc,
+ argv);
+
+ if (result == -1)
+ return -1;
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Server server;
+ result =
+ server.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ while ( !done )
+ {
+ if ( orb->work_pending( ACE_ENV_SINGLE_ARG_PARAMETER ) )
+ {
+ orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ orb->shutdown( 1 ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"server::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/server.h b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.h
new file mode 100644
index 00000000000..c1c6776efe2
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.h
@@ -0,0 +1,94 @@
+/* -*- C++ -*- */
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Pluggable
+//
+// = FILENAME
+// ftp.h
+//
+// = DESCRIPTION
+// Ftp server to receive data
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+
+class FTP_Server_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Defines a class for the server application callback.
+ //
+ // = DESCRIPTION
+ // This class overides the methods of the TAO_AV_Callback so the
+ // AVStreams can make upcalls to the application.
+
+public:
+
+ // Method that is called when there is data to be received from the ftp client.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the ftp client has finished reading the file and wants
+ // to close4 down the connection.
+ int handle_destroy (void);
+};
+
+class FTP_Server_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Defines the aplication stream endpoint
+ //
+ // = DESCRIPTION
+ // This is the class that overrides the tao_server_enpodint to handle
+ // pre and post connect processing.
+public:
+ // Create the server application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ FTP_Server_Callback callback_;
+ // reference to the server application callback.
+};
+
+class Server
+{
+ // = TITLE
+ // Defines the server application class.
+ //
+ // = DESCRIPOTION
+ // The actual server progarm that acts as the ftp server that receives data
+ // sent by the ftp client.
+public:
+ Server (void);
+ // Constructor
+
+ ~Server (void);
+ // Deestructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+protected:
+ TAO_Naming_Client my_naming_client_;
+ // The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <FTP_Server_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reacxtive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ // The server MMDevice.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/AVS_Pluggable_Flow_Protocol.mpc b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/AVS_Pluggable_Flow_Protocol.mpc
new file mode 100644
index 00000000000..71dc6fc745f
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/AVS_Pluggable_Flow_Protocol.mpc
@@ -0,0 +1,28 @@
+// -*- MPC -*-
+// $Id$
+
+project(*ts) : orbsvcslib, portableserver, avstreams, naming {
+ sharedname = TAO_TS
+ dynamicflags = TAO_TS_BUILD_DLL
+
+ Source_Files {
+ TimeStamp.cpp
+ }
+}
+
+project(*send): avstreamsexe {
+ exename = sender
+
+ Source_Files {
+ sender.cpp
+ }
+}
+
+project(*recv): avstreamsexe {
+ exename = receiver
+
+ Source_Files {
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/Makefile.am
new file mode 100644
index 00000000000..b97da09530e
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/Makefile.am
@@ -0,0 +1,109 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Pluggable_Flow_Protocol_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ receiver.cpp \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Pluggable_Flow_Protocol_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ sender.cpp \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Pluggable_Flow_Protocol_Ts.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_LTLIBRARIES = libTAO_TS.la
+
+libTAO_TS_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_TS_BUILD_DLL
+
+libTAO_TS_la_SOURCES = \
+ TimeStamp.cpp
+
+noinst_HEADERS = \
+ TimeStamp.h
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/README b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/README
new file mode 100644
index 00000000000..20365125206
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/README
@@ -0,0 +1,47 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a simple test in the form of a sender and a
+receiver. The test has the following features:
+
+1. It tests the AVStreams Pluggable Protocol Framework
+2. Shows a mechanism to pace data.
+
+A new flow protocol called Time Stamp Flow Protocol is plugged into the AV Streams Framework
+using the Pluggable Protocol Framework and the ACE Service Configurator. This new protocol
+is compiled into a library and loaded when the AVStreams framework is initialized. When a
+frame is sent this protocol appends a timestamp to the data being sent.
+
+Running the test
+----------------
+
+receiver
+--------
+
+receiver -f <output_filename>
+
+-f <output_filename> -> The name of the file under which the received stream
+ data has to be stored (defaults to "output")
+
+sender
+------
+
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-d]
+
+
+-f filename --> The file to be streamed to the receiver (defaults to
+ "input").
+
+-p protocol --> The protocol string could be UDP or TCP (defaults to
+ UDP). But with the multicast address it should be UDP.
+
+-r framerate--> The rate at which tha data frames need to be sent
+ (defaults to 30 frames per second).
+
+-d --> Increament the TAO_debug_level for debug messages.
+
+
+The test must be run with the naming service. Check the run_test.pl
+to see how to configure the test case.
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.cpp
new file mode 100644
index 00000000000..d5ad5524c69
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.cpp
@@ -0,0 +1,241 @@
+#include "TimeStamp.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "ace/High_Res_Timer.h"
+
+// $Id$
+//TimeStamp Protocol Object
+
+TimeStamp_Protocol_Object::TimeStamp_Protocol_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport)
+ :TAO_AV_Protocol_Object (callback,transport)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "TimeStamp_Protocol_Object::TimeStamp_Protocol_Object\n"));
+ ACE_NEW (this->frame_,
+ ACE_Message_Block);
+
+ this->frame_->size (4 * this->transport_->mtu ());
+}
+
+
+int
+TimeStamp_Protocol_Object::handle_input (void)
+{
+ ssize_t n = this->transport_->recv (this->frame_->rd_ptr (),
+ this->frame_->size ());
+ if (n == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_UDP_Flow_Handler::handle_input recv failed\n"),-1);
+ if (n == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_UDP_Flow_Handler::handle_input connection closed\n"),-1);
+ this->frame_->wr_ptr (this->frame_->rd_ptr () + n);
+
+ return this->callback_->receive_frame (this->frame_);
+}
+
+// int
+// TimeStamp_Protocol_Object::handle_input (void)
+// {
+// iovec iov;
+// int iovcnt;
+// int n = this->transport_->recv (&iov, iovcnt);
+
+// int frame_size = BUFSIZ;
+
+// int begin = 1;
+// ACE_Message_Block* prev;
+// int iov_base = 0;
+// while (n >= frame_size)
+// {
+// ACE_DEBUG ((LM_DEBUG,
+// "(%N|%l) Frame Size %d %d\n",
+// n,
+// frame_size));
+
+// ACE_Message_Block* mb;
+// ACE_NEW_RETURN (mb,
+// ACE_Message_Block(frame_size),
+// -1);
+
+// ACE_OS_String::memmove (mb->rd_ptr (), iov.iov_base, frame_size);
+// mb->wr_ptr (mb->rd_ptr () + frame_size);
+
+// // iov_base += frame_size;
+
+// n -= frame_size;
+
+// if (begin)
+// {
+// prev = mb;
+// this->frame_ = mb;
+// begin = 0;
+// }
+// else
+// {
+// prev->cont (mb);
+// prev = mb;
+
+// }
+// }
+
+// if (n > 0)
+// if (begin)
+// {
+// ACE_DEBUG ((LM_DEBUG,
+// "(%N|%l) Frame Size %d\n",
+// n));
+// ACE_OS_String::memmove (this->frame_->rd_ptr (), iov.iov_base, n);
+// this->frame_->wr_ptr (this->frame_->rd_ptr () + n);
+// }
+// else
+// {
+
+// ACE_DEBUG ((LM_DEBUG,
+// "(%N|%l) Frame Size %d\n",
+// n));
+
+// ACE_Message_Block* mb;
+// ACE_NEW_RETURN (mb,
+// ACE_Message_Block (frame_size),
+// -1);
+
+// ACE_OS_String::memmove (mb->rd_ptr (), iov.iov_base, n);
+// mb->wr_ptr (mb->rd_ptr () + n);
+// prev->cont (mb);
+// }
+
+// ACE_DEBUG ((LM_DEBUG,
+// "IOVEC SIZE %d %d\n",
+// n,
+// iov.iov_len));
+
+// if (n == -1)
+// ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_Flow_Handler::handle_input recv failed\n"),-1);
+// if (n == 0)
+// ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_Flow_Handler::handle_input connection closed\n"),-1);
+
+// return this->callback_->receive_frame (this->frame_);
+// }
+
+/// send a data frame.
+int
+TimeStamp_Protocol_Object::send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "TimeStamp_Protocol_Object::send_frame\n"));
+
+ ACE_Message_Block* timestamp;
+ ACE_NEW_RETURN (timestamp,
+ ACE_Message_Block (BUFSIZ),
+ -1);
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+
+ ACE_UINT64 usec = now;
+ ACE_UINT32 val_1 = ACE_CU64_TO_CU32 (usec);
+ ACE_DEBUG ((LM_DEBUG,
+ "Time Stamp %u usecs\n",
+ val_1));
+
+ ACE_OS_String::memcpy (timestamp->wr_ptr (), &now, sizeof (now));
+ timestamp->wr_ptr (sizeof (now));
+
+ frame->cont (timestamp);
+
+ ssize_t result = this->transport_->send (frame);
+ if (result < 0)
+ return result;
+ return 0;
+}
+
+int
+TimeStamp_Protocol_Object::send_frame (iovec const* iov,
+ int iovcnt,
+ TAO_AV_frame_info *)
+{
+ return this->transport_->send (iov,iovcnt);
+}
+
+int
+TimeStamp_Protocol_Object::send_frame (const char* buf,
+ size_t len)
+{
+ int result = this->transport_->send (buf, len, 0);
+ if (result < 0)
+ return result;
+ return 0;
+}
+
+/// end the stream.
+int
+TimeStamp_Protocol_Object::destroy (void)
+{
+ this->callback_->handle_destroy ();
+ return 0;
+}
+
+
+TimeStamp_Protocol_Factory::TimeStamp_Protocol_Factory (void)
+{
+}
+
+TimeStamp_Protocol_Factory::~TimeStamp_Protocol_Factory (void)
+{
+}
+
+int
+TimeStamp_Protocol_Factory::init (int, char **)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "TimeStamp_Protocol_Factory::init\n"));
+ return 0;
+}
+
+int
+TimeStamp_Protocol_Factory::match_protocol (const char *flow_string)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "TimeStamp_Protocol_Factory::match_protocol\n"));
+ if (ACE_OS::strcasecmp (flow_string,"TS") == 0)
+ return 1;
+ return 0;
+}
+
+TAO_AV_Protocol_Object*
+TimeStamp_Protocol_Factory::make_protocol_object (TAO_FlowSpec_Entry *entry,
+ TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport)
+{
+ TAO_AV_Callback *callback = 0;
+ endpoint->get_callback (entry->flowname (),
+ callback);
+
+
+ TimeStamp_Protocol_Object *object = 0;
+ ACE_NEW_RETURN (object,
+ TimeStamp_Protocol_Object (callback,
+ transport),
+ 0);
+ callback->open (object,
+ handler);
+ endpoint->set_protocol_object (entry->flowname (),
+ object);
+ return object;
+}
+
+ACE_FACTORY_DEFINE (TAO_TS, TimeStamp_Protocol_Factory)
+ACE_STATIC_SVC_DEFINE (TimeStamp_Protocol_Factory,
+ ACE_TEXT ("TimeStamp_Protocol_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TimeStamp_Protocol_Factory),
+ ACE_Service_Type::DELETE_THIS |
+ ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.h b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.h
new file mode 100644
index 00000000000..dcc578e1756
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/TimeStamp.h
@@ -0,0 +1,61 @@
+#ifndef TIMESTAMP_H
+#define TIMESTAMP_H
+#include /**/ "ace/pre.h"
+
+#include "export.h"
+
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+#include "ace/Dynamic_Service.h"
+#include "ace/Service_Config.h"
+
+
+// $Id$
+
+class TAO_TS_Export TimeStamp_Protocol_Object : public TAO_AV_Protocol_Object
+{
+ public:
+ TimeStamp_Protocol_Object (TAO_AV_Callback *callback,
+ TAO_AV_Transport *transport);
+
+ virtual int handle_input (void);
+
+ /// send a data frame.
+ virtual int send_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info = 0);
+
+ virtual int send_frame (iovec const* iov,
+ int iovcnt,
+ TAO_AV_frame_info *frame_info = 0);
+
+ virtual int send_frame (const char*buf,
+ size_t len);
+
+ /// end the stream.
+ virtual int destroy (void);
+
+ private:
+ /// Pre-allocated memory to receive the data...
+ ACE_Message_Block* frame_;
+};
+
+class TAO_TS_Export TimeStamp_Protocol_Factory : public TAO_AV_Flow_Protocol_Factory
+{
+ public:
+ /// Initialization hook.
+ TimeStamp_Protocol_Factory (void);
+ virtual ~TimeStamp_Protocol_Factory (void);
+ virtual int init (int argc, char *argv[]);
+ virtual int match_protocol (const char *flow_string);
+ // Note : Some platforms still don't support Covariant returns
+ virtual TAO_AV_Protocol_Object* make_protocol_object (TAO_FlowSpec_Entry *entry,
+ TAO_Base_StreamEndPoint *endpoint,
+ TAO_AV_Flow_Handler *handler,
+ TAO_AV_Transport *transport);
+};
+
+ACE_STATIC_SVC_DECLARE (TimeStamp_Protocol_Factory)
+ACE_FACTORY_DECLARE (TAO_TS, TimeStamp_Protocol_Factory)
+
+#include /**/ "ace/post.h"
+#endif /*TIMESTAMP_H*/
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/export.h b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/export.h
new file mode 100644
index 00000000000..13156aa6e0a
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef EXPORT_H
+#define EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_TS_HAS_DLL)
+# define TAO_TS_HAS_DLL 0
+# endif /* ! TAO_TS_HAS_DLL */
+#else
+# if !defined (TAO_TS_HAS_DLL)
+# define TAO_TS_HAS_DLL 1
+# endif /* ! TAO_TS_HAS_DLL */
+#endif
+
+#if defined (TAO_TS_HAS_DLL) && (TAO_TS_HAS_DLL == 1)
+# if defined (TAO_TS_BUILD_DLL)
+# define TAO_TS_Export ACE_Proper_Export_Flag
+# define TAO_TS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_TS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_TS_BUILD_DLL */
+# define TAO_TS_Export ACE_Proper_Import_Flag
+# define TAO_TS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_TS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_TS_BUILD_DLL */
+#else /* TAO_TS_HAS_DLL == 1 */
+# define TAO_TS_Export
+# define TAO_TS_SINGLETON_DECLARATION(T)
+# define TAO_TS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_TS_HAS_DLL == 1 */
+
+#endif /* TAO_TS_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.cpp
new file mode 100644
index 00000000000..d24c92414ff
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.cpp
@@ -0,0 +1,261 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_String.h"
+#include "ace/High_Res_Timer.h"
+
+static FILE *output_file = 0;
+// File handle of the file into which received data is written.
+
+static const char *output_file_name = "output";
+// File name of the file into which received data is written.
+
+int endstream = 0;
+
+int
+Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ int frame_size = BUFSIZ;
+
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame_size,
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+ frame->rd_ptr (frame_size);
+
+ ACE_hrtime_t stamp;
+ ACE_OS_String::memcpy (&stamp, frame->rd_ptr (), sizeof (stamp));
+
+ ACE_UINT64 usec = stamp;
+ ACE_UINT32 val_1 = ACE_CU64_TO_CU32 (usec);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Time Stamp %u\n",
+ val_1));
+
+ frame->reset ();
+ return 0;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::end_stream\n"));
+
+ endstream = 1;
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0)
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+int
+Receiver::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Initialize the naming services
+ if (this->naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the receiver object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+parse_args (int argc,
+ char **argv)
+{
+ // Parse the command line arguments
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ output_file_name = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: receiver -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_High_Res_Timer::global_scale_factor ();
+
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result =
+ parse_args (argc,
+ argv);
+
+ if (result == -1)
+ return -1;
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ Receiver receiver;
+ result =
+ receiver.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ while (!endstream)
+ {
+ orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.h b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.h
new file mode 100644
index 00000000000..39c4ac3b39e
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/receiver.h
@@ -0,0 +1,100 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Receiver_Callback callback_;
+ // Receiver application callback.
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ // Constructor
+
+ ~Receiver (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL);
+ // Initialize data components.
+
+protected:
+ TAO_Naming_Client naming_client_;
+ // The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reactive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ // Receiver MMDevice.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl
new file mode 100755
index 00000000000..c04de62dfd6
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl
@@ -0,0 +1,71 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib $ENV{"ACE_ROOT"}.'/bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$outfile = PerlACE::LocalFile ("output");
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+unlink $nsior;
+
+$NS = new PerlACE::Process ($ENV{"TAO_ROOT"}."/orbsvcs/Naming_Service/Naming_Service", "-o $nsior");
+$SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -f output");
+$CL = new PerlACE::Process ("sender", "-ORBDebugLevel 2 -ORBInitRef NameService=file://$nsior -f $input -r 2");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 5) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Receiver\n";
+
+$SV->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender\n";
+
+$sender = $CL->SpawnWaitKill (200);
+
+if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+$receiver = $SV->TerminateWaitKill (5);
+
+if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.cpp
new file mode 100644
index 00000000000..9af1f2ba80b
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.cpp
@@ -0,0 +1,417 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ SENDER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ streamctrl_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ protocol_ ("UDP"),
+ frame_rate_ (30),
+ mb_ (BUFSIZ)
+{
+}
+
+void
+Sender::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:p:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'p':
+ this->protocol_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+// Method to get the object reference of the receiver
+int
+Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Resolve the receiver object reference from the Naming Service
+ CORBA::Object_var receiver_mmdevice_obj =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->receiver_mmdevice_ =
+ AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->receiver_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Receiver_MMdevice in Naming service <%s>\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the naming services
+ result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Resolve the object reference of the receiver from the Naming Service.
+ result = this->bind_to_receiver (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry ("Data_Receiver",
+ "IN",
+ "USER_DEFINED",
+ "TS",
+ this->protocol_.c_str (),
+ 0);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->streamctrl_,
+ TAO_StreamCtrl,
+ -1);
+
+ PortableServer::ServantBase_var safe_streamctrl =
+ this->streamctrl_;
+
+ // Bind/Connect the sender and receiver MMDevices.
+ CORBA::Boolean bind_result =
+ this->streamctrl_->bind_devs (mmdevice.in (),
+ this->receiver_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (bind_result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "streamctrl::bind_devs failed\n"),
+ -1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The time that should lapse between two consecutive frames sent.
+ ACE_Time_Value inter_frame_time;
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1 / (double) this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %d / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ break;
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ // Send frame.
+ int result =
+ this->protocol_object_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ } // end while
+
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Shut the orb down.
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ ACE_High_Res_Timer::global_scale_factor ();
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Sender.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::init failed\n"),
+ -1);
+
+ // Start sending data.
+ result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.h b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.h
new file mode 100644
index 00000000000..20e9dc6ef50
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/sender.h
@@ -0,0 +1,117 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ // = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL);
+ // Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL);
+ // Method to pace and send data from a file.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ int bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL);
+ // Method that binds the sender to the receiver.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ // The endpoint strategy used by the sender.
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ // The receiver MMDevice that the sender connects to.
+
+ TAO_MMDevice *sender_mmdevice_;
+ // The sender MMDevice.
+
+ TAO_StreamCtrl *streamctrl_;
+ // Stream controller
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ ACE_CString protocol_;
+ // Selected protocol - default is UDP
+
+ int frame_rate_;
+ // Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf
new file mode 100644
index 00000000000..d4f2cd01350
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf
@@ -0,0 +1,5 @@
+dynamic AV_Default_Resource_Factory Service_Object * TAO_AV:_make_TAO_AV_Default_Resource_Factory() ""
+dynamic TimeStamp_Protocol_Factory Service_Object * TAO_TS:_make_TimeStamp_Protocol_Factory() ""
+static AV_Default_Resource_Factory "-AVFlowProtocolFactory TimeStamp_Protocol_Factory"
+dynamic UDP_Factory Service_Object * TAO_AV:_make_TAO_AV_UDP_Factory() ""
+static AV_Default_Resource_Factory "-AVTransportFactory UDP_Factory"
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf.xml b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf.xml
new file mode 100644
index 00000000000..ef8e8645e5b
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf.xml
@@ -0,0 +1,15 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="AV_Default_Resource_Factory" type="Service_Object">
+ <initializer path="TAO_AV" init="_make_TAO_AV_Default_Resource_Factory"/>
+ </dynamic>
+ <dynamic id="TimeStamp_Protocol_Factory" type="Service_Object">
+ <initializer path="TAO_TS" init="_make_TimeStamp_Protocol_Factory"/>
+ </dynamic>
+ <static id="AV_Default_Resource_Factory" params="-AVFlowProtocolFactory TimeStamp_Protocol_Factory"/>
+ <dynamic id="UDP_Factory" type="Service_Object">
+ <initializer path="TAO_AV" init="_make_TAO_AV_UDP_Factory"/>
+ </dynamic>
+ <static id="AV_Default_Resource_Factory" params="-AVTransportFactory UDP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/AVStreams/README b/TAO/orbsvcs/tests/AVStreams/README
new file mode 100644
index 00000000000..6a6799b4747
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/README
@@ -0,0 +1,28 @@
+// $Id$
+
+TAO Audio/Video Streaming service
+---------------------------------
+
+This directory contains a complete distributed audio/video streaming
+application. This application uses interfaces and interactions
+defined in the OMG "Control and Management of A/V streams"
+specification, which is available at the OMG web site. An
+implementation of the A/V Streaming specification is available for TAO
+in the following directory.
+
+$TAO_ROOT/orbsvcs/orbsvcs/AV/
+
+Subsequent directories contain README files that describe the
+compilation and installation process of this application.
+
+The TAO application is a modified version of a streaming application
+developed at the Oregon Graduate Institute.
+
+Members of the TAO A/V Streaming team include the following
+
+Yamuna Krishnamurthy <yamuna@oomworks.com>
+Sumedh Mungee <sumedh@cs.wustl.edu>
+Seth Widoff <sbw1@cs.wustl.edu>
+Nagarajan Surendran <naga@cs.wustl.edu>
+Alexander Arulanthu <alex@cs.wustl.edu>
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/AVS_Simple_Three_Stage.mpc b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/AVS_Simple_Three_Stage.mpc
new file mode 100644
index 00000000000..7f39cd838ea
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/AVS_Simple_Three_Stage.mpc
@@ -0,0 +1,27 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe {
+ exename = sender
+
+ Source_Files {
+ sender.cpp
+ }
+}
+
+project(*dist): avstreamsexe {
+ exename = distributer
+
+ Source_Files {
+ distributer.cpp
+ }
+}
+
+project(*recv): avstreamsexe {
+ exename = receiver
+
+ Source_Files {
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/Makefile.am
new file mode 100644
index 00000000000..b3e89ef417b
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/Makefile.am
@@ -0,0 +1,117 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Simple_Three_Stage_Dist.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += distributer
+
+distributer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+distributer_SOURCES = \
+ distributer.cpp \
+ distributer.h
+
+distributer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Simple_Three_Stage_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ receiver.cpp \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Simple_Three_Stage_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ sender.cpp \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/README b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/README
new file mode 100644
index 00000000000..1c589048ae7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/README
@@ -0,0 +1,56 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a simple three stage AV test:
+a. Sender
+b. Distributer
+c. Receiver
+
+The sender reads data read from a file and sends it to the distributer
+process. The distributer acts as a conduit. It receives data from the
+sender and sends it immediately to the receiver process.
+
+The sender and receiver register their references with the Naming
+Service. The distributer gets the sender and receiver references from
+the Naming Service. It then binds to the receiver and sender. When
+the connection between the distributer and sender is set up the sender
+starts sending to the distributer which in turn sends data to the
+receiver. When the sender has finished reading the file it tells the
+ditributer which in turn tells the recveiver to destroy the streams
+set up.
+
+
+Running the test
+----------------
+
+Start the Naming Service
+
+Start the following processes in the same order.
+
+sender
+------
+
+sender [-f <filename>] [-r <data_rate>]
+
+-f filename --> The name of the file from which data needs to be sent
+
+-r data_rate --> The rate at which the data needs to be paced.
+
+
+receiver
+--------
+
+receiver [-f <filename>]
+
+-f filename --> File into which the data received from the distributer is stored.
+
+
+distributer:
+-----------
+
+distributer (no args)
+
+Please see run_test.pl script for the detail of a test run.
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.cpp
new file mode 100644
index 00000000000..dd2c65abfdd
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.cpp
@@ -0,0 +1,377 @@
+// $Id$
+
+#include "distributer.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+
+typedef ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex> DISTRIBUTER;
+
+int
+Distributer_Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Distributer_Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the protocol object corresponding to the transport protocol
+ // selected.
+ DISTRIBUTER::instance ()->sender_protocol_object (object);
+
+ return 0;
+}
+
+int
+Distributer_Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the receiver application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+Distributer_Receiver_Callback::Distributer_Receiver_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+int
+Distributer_Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ // Get the protocol object corresponding to the receiver stream and
+ // send the data received from sender to the receiver.
+ int result =
+ DISTRIBUTER::instance ()->sender_protocol_object ()->send_frame (frame);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Distributer_Callback::receive_frame send failed\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Distributer_Receiver_Callback::handle_destroy (void)
+{
+ // Called when the sender requests the stream to be shutdown.
+ ACE_TRY_NEW_ENV
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Distributer_Callback::end_stream\n"));
+
+ // Destroy the receiver stream
+ AVStreams::flowSpec stop_spec;
+ DISTRIBUTER::instance ()->receiver_streamctrl ()->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We can close down now.
+ DISTRIBUTER::instance ()->done (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Distributer_Callback::handle_destroy Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Distributer::sender_protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the corresponding protocol objects for the different streams created.
+ this->sender_protocol_object_ = object;
+
+ return 0;
+}
+
+TAO_AV_Protocol_Object *
+Distributer::sender_protocol_object (void)
+{
+ return this->sender_protocol_object_;
+}
+
+Distributer::Distributer (void)
+ : distributer_receiver_mmdevice_ (0),
+ distributer_sender_mmdevice_ (0),
+ sender_protocol_object_ (0),
+ receiver_streamctrl_ (0),
+ protocol_ ("UDP"),
+ done_ (0)
+{
+}
+
+Distributer::~Distributer (void)
+{
+}
+
+void
+Distributer::bind_to_mmdevice (AVStreams::MMDevice_ptr &mmdevice,
+ const ACE_CString &mmdevice_name
+ ACE_ENV_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup (mmdevice_name.c_str ());
+
+ // Resolve the mmdevice object reference from the Naming Service
+ CORBA::Object_var mmdevice_obj =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ mmdevice =
+ AVStreams::MMDevice::_narrow (mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Distributer::init (int /*argc*/,
+ char *[] /*argv*/
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the naming services
+ int result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Initialize the endpoint strategy with the orb and poa.
+ result =
+ this->sender_endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ result =
+ this->receiver_endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Bind to the receiver mmdevice
+ ACE_CString mmdevice_name ("Receiver");
+ this->bind_to_mmdevice (this->receiver_mmdevice_.out (),
+ mmdevice_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Bind to the sender mmdevice
+ mmdevice_name = "Sender";
+ this->bind_to_mmdevice (this->sender_mmdevice_.out (),
+ mmdevice_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry receiver_entry ("Data_Receiver",
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ 0);
+
+ // Set the flow specification for the stream between receiver and distributer
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] =
+ CORBA::string_dup (receiver_entry.entry_to_string ());
+
+ ACE_NEW_RETURN (this->distributer_sender_mmdevice_,
+ TAO_MMDevice (&this->sender_endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_sender_mmdevice =
+ this->distributer_sender_mmdevice_;
+
+ AVStreams::MMDevice_var distributer_sender_mmdevice =
+ this->distributer_sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->distributer_receiver_mmdevice_,
+ TAO_MMDevice (&this->receiver_endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_receiver_mmdevice =
+ this->distributer_receiver_mmdevice_;
+
+ AVStreams::MMDevice_var distributer_receiver_mmdevice =
+ this->distributer_receiver_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->receiver_streamctrl_,
+ TAO_StreamCtrl,
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_receiver_streamctrl =
+ this->receiver_streamctrl_;
+
+ // Bind/Connect the distributer and receiver MMDevices.
+ result =
+ this->receiver_streamctrl_->bind_devs (distributer_sender_mmdevice.in (),
+ this->receiver_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry sender_entry ("Data_Sender",
+ "OUT",
+ "USER_DEFINED",
+ "", // Flowname
+ this->protocol_.c_str (),
+ 0);
+
+ TAO_StreamCtrl* sender_streamctrl = 0;
+ // Video stream controller for the stream between sender and distributer
+
+ ACE_NEW_RETURN (sender_streamctrl,
+ TAO_StreamCtrl,
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_sender_streamctrl =
+ sender_streamctrl;
+
+ // Set the flow specification for the stream between sender and distributer
+ flow_spec [0] = CORBA::string_dup (sender_entry.entry_to_string ());
+
+ // Bind/Connect the sender and distributer MMDevices.
+ CORBA::Boolean res =
+ sender_streamctrl->bind_devs (sender_mmdevice_.in (),
+ distributer_receiver_mmdevice.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (res == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,"Streamctrl::bind_devs failed\n"),-1);
+
+ return 0;
+}
+
+TAO_StreamCtrl *
+Distributer::receiver_streamctrl (void)
+{
+ return this->receiver_streamctrl_;
+}
+
+int
+Distributer::done (void) const
+{
+ return this->done_;
+}
+
+void
+Distributer::done (int done)
+{
+ this->done_ = done;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Distributer
+ int result =
+ DISTRIBUTER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ while (!DISTRIBUTER::instance ()->done ())
+ {
+ orb->perform_work (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"main");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ DISTRIBUTER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Distributer, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.h b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.h
new file mode 100644
index 00000000000..8b9f74cdf07
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/distributer.h
@@ -0,0 +1,171 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage
+//
+// = FILENAME
+// distributer.h
+//
+// = DESCRIPTION
+// Process to receive data from the sender and send it to the
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Distributer_Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Distributer_Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Count of the frames passing through us.
+};
+
+class Distributer_Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Distributer_Receiver_Callback callback_;
+ // Receiver application callback.
+};
+
+class Distributer_Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Distributer_Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_B
+ <Distributer_Receiver_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ RECEIVER_ENDPOINT_STRATEGY;
+
+class Distributer
+{
+ // = TITLE
+ // Distributer Application.
+ //
+ // = DESCRIPTION
+ // The distributer is the intermediate receiver that receives
+ // data from the sender and forwards to a receiver.
+public:
+ Distributer (void);
+ // Constructor
+
+ ~Distributer (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+ void bind_to_mmdevice (AVStreams::MMDevice_ptr &mmdevice,
+ const ACE_CString &mmdevice_name
+ ACE_ENV_ARG_DECL);
+ // Resolve the reference of the mmdevice from the naming service.
+
+ TAO_StreamCtrl *receiver_streamctrl (void);
+ // Get the stream control of the receiver
+
+ int sender_protocol_object (TAO_AV_Protocol_Object *object);
+ TAO_AV_Protocol_Object *sender_protocol_object (void);
+ // Accessor methods to set/get our sender protocol object
+
+ // Flag to know when we are done.
+ int done (void) const;
+ void done (int);
+
+protected:
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ SENDER_ENDPOINT_STRATEGY sender_endpoint_strategy_;
+ // The sender endpoint strategy.
+
+ RECEIVER_ENDPOINT_STRATEGY receiver_endpoint_strategy_;
+ // The receiver endpoint strategy.
+
+ TAO_MMDevice* distributer_receiver_mmdevice_;
+ // The distributer receiver multimedia device
+
+ TAO_MMDevice* distributer_sender_mmdevice_;
+ // The distributer receiver multimedia device
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ // The receiver MMDevice.
+
+ AVStreams::MMDevice_var sender_mmdevice_;
+ // The sender MMDevice.
+
+ TAO_AV_Protocol_Object *sender_protocol_object_;
+ // The sender protocol object
+
+ TAO_StreamCtrl* receiver_streamctrl_;
+ // Stream controller for the receivers
+
+ ACE_CString protocol_;
+ // Selected protocol - default is UDP
+
+ int done_;
+ // Flag to know when we are done.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.cpp
new file mode 100644
index 00000000000..7a64da3488c
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.cpp
@@ -0,0 +1,257 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+
+static FILE *output_file = 0;
+// File handle of the file into which received data is written.
+
+static const char *output_file_name = "output";
+// File name of the file into which received data is written.
+
+int
+Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (1)
+{
+}
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ return 0;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::end_stream\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Receiver_Callback::handle_destroy Failed\n");
+ return -1;
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0)
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+int
+Receiver::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Initialize the naming services
+ if (this->naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the receiver object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+parse_args (int argc,
+ char **argv)
+{
+ // Parse the command line arguments
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ output_file_name = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: receiver -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result =
+ parse_args (argc,
+ argv);
+
+ if (result == -1)
+ return -1;
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ Receiver receiver;
+ result =
+ receiver.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.h b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.h
new file mode 100644
index 00000000000..a08f222d24d
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/receiver.h
@@ -0,0 +1,100 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Receiver_Callback callback_;
+ // Receiver application callback.
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ // Constructor
+
+ ~Receiver (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+protected:
+ TAO_Naming_Client naming_client_;
+ // The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reactive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ // Receiver MMDevice.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl
new file mode 100755
index 00000000000..31cfeba9234
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl
@@ -0,0 +1,86 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$testfile = PerlACE::LocalFile ("test");
+$input = PerlACE::LocalFile ("test_input");
+
+unlink $nsior, $testfile, $input;
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+$SV = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -f $input");
+$RE = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -f $testfile");
+$DI = new PerlACE::Process ("distributer", "-ORBInitRef NameService=file://$nsior");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Receiver\n";
+
+$RE->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Sender\n";
+
+$SV->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Distributer\n";
+
+$distributer = $DI->SpawnWaitKill (200);
+
+if ($distributer != 0) {
+ print STDERR "ERROR: distributer returned $distributer\n";
+ $status = 1;
+}
+
+$sender = $SV->TerminateWaitKill (60);
+
+if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+$receiver = $RE->TerminateWaitKill (60);
+
+if ($receiver != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+}
+
+
+$nserver = $NS->TerminateWaitKill (60);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior, $testfile, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp
new file mode 100644
index 00000000000..9e766993cf7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp
@@ -0,0 +1,393 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+
+ // Get the stream controller for this stream.
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Any_ptr streamctrl_any =
+ this->get_property_value ("Related_StreamCtrl"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ AVStreams::StreamCtrl_ptr streamctrl;
+ *streamctrl_any >>= streamctrl;
+
+ // Store reference to the streamctrl
+ SENDER::instance ()->streamctrl (streamctrl);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender_StreamEndPoint::get_callback failed");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ SENDER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ streamctrl_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ frame_rate_ (10.0),
+ mb_ (BUFSIZ),
+ protocol_object_ (0)
+{
+}
+
+void
+Sender::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+void
+Sender::streamctrl (AVStreams::StreamCtrl_ptr streamctrl)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->streamctrl_ = streamctrl;
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:r:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the naming services
+ result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Sender");
+
+ // Register the sender object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The time that should lapse between two consecutive frames sent.
+ ACE_Time_Value inter_frame_time;
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1.0 / this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %f / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ // If we have a receiver, send to it.
+ while (this->protocol_object_ == 0)
+ {
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ ACE_Time_Value wait_time (5);
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ break;
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ // Send frame.
+ int result =
+ this->protocol_object_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ } // end while
+
+ // If a stream was setup, destroy it.
+ if (this->streamctrl_)
+ {
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Sender.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::init failed\n"),
+ -1);
+
+ SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Time_Value tv (10);
+ orb->run (tv);
+ // Hack for now....
+ ACE_OS::sleep (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h
new file mode 100644
index 00000000000..a5e40f9134e
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h
@@ -0,0 +1,113 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ // = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Method to pace and send data from a file.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ void streamctrl (AVStreams::StreamCtrl_ptr streamctrl);
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ // The endpoint strategy used by the sender.
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ // The receiver MMDevice that the sender connects to.
+
+ TAO_MMDevice *sender_mmdevice_;
+ // The sender MMDevice.
+
+ AVStreams::StreamCtrl_ptr streamctrl_;
+ // Stream controller
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ double frame_rate_;
+ // Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/AVS_Simple_Two_Stage.mpc b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/AVS_Simple_Two_Stage.mpc
new file mode 100644
index 00000000000..8e3c9bc31fd
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/AVS_Simple_Two_Stage.mpc
@@ -0,0 +1,20 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe {
+ exename = sender
+
+ Source_Files {
+ sender.cpp
+ }
+}
+
+project(*recv): avstreamsexe {
+ exename = receiver
+
+ Source_Files {
+ Receiver_Stats.cpp
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Makefile.am
new file mode 100644
index 00000000000..e4180cd8e0b
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Makefile.am
@@ -0,0 +1,90 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Simple_Two_Stage_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ Receiver_Stats.cpp \
+ receiver.cpp \
+ Receiver_Stats.h \
+ Receiver_Stats.inl \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Simple_Two_Stage_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ sender.cpp \
+ Receiver_Stats.inl \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README
new file mode 100644
index 00000000000..b1322064a56
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README
@@ -0,0 +1,60 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a simple test in the form of a sender and a
+receiver. The test has the following features:
+
+1. It tests the AVStreams Pluggable Protocol Framework
+2. Shows a mechanism to pace data.
+3. Records the inter-frame arrival time and dumps the results
+in the Stats.dat file.
+
+Running the test
+----------------
+
+The test must be run with the naming service. Check the run_test.pl
+to see how to configure the test case.
+
+receiver
+--------
+
+receiver -f <output_filename> -s <stats_file>
+
+-f <output_filename> -> The name of the file under which the received stream
+ data has to be stored (defaults to "output")
+
+-s <stats_file> -> File in which the frame inter-arrival time is recorded. Default name
+ is Stats.dat
+
+sender
+------
+
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-l <local_address>] [-a <peer_address>] [-s <# of frames sent>] [-b <frame size>] [-d]
+
+-f filename --> The file to be streamed to the receiver (defaults to
+ "input").
+
+-p protocol --> The protocol string could be UDP, TCP, RTP/UDP or SCTP_SEQ (defaults to
+ UDP). But with the multicast address it should be UDP.
+
+-r framerate--> The rate at which tha data frames need to be sent
+ (defaults to 30 frames per second).
+
+-l address --> Local address in the format host:port. If protocol is SCTP_SEQ then specify ","
+ separated secondary addresses.eg. primary_addr:port,sec_addr1,sec_addr2
+
+-a address --> Destination address in the format host:port. If protocol is SCTP_SEQ then specify ","
+ separated secondary addresses.eg. primary_addr:port,sec_addr1,sec_addr2
+
+-s frames --> The number of frames to be sent from the sender to the receiver. The
+ sent max frames that can be sent is 1000000 frames.
+
+-b frame --> The size of each frame sent in bytes.
+ size
+
+-d --> Increment the TAO_debug_level for debug messages.
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.cpp
new file mode 100644
index 00000000000..dc4c20b35e7
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.cpp
@@ -0,0 +1,81 @@
+// $Id$
+
+#include "Receiver_Stats.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_stdio.h"
+
+#if !defined (__ACE_INLINE__)
+#include "Receiver_Stats.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(ace, Receiver_Stats, "$Id$")
+
+void
+Receiver_Stats::accumulate (const Receiver_Stats &rhs)
+{
+ if (rhs.samples_count_ == 0)
+ return;
+
+ if (this->samples_count_ == 0)
+ {
+ this->samples_count_ = rhs.samples_count_;
+
+ this->min_ = rhs.min_;
+ this->max_ = rhs.max_;
+ this->sum_ = rhs.sum_;
+ this->sum2_ = rhs.sum2_;
+
+ return;
+ }
+ this->samples_count_ += rhs.samples_count_;
+
+ if (this->min_ > rhs.min_)
+ this->min_ = rhs.min_;
+ if (this->max_ < rhs.max_)
+ this->max_ = rhs.max_;
+
+ this->sum_ += rhs.sum_;
+ this->sum2_ += rhs.sum2_;
+}
+
+void
+Receiver_Stats::dump_results (const ACE_TCHAR *msg,
+ FILE *file,
+ ACE_UINT32 sf) const
+{
+ if (this->samples_count () == 0u)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("%s : no data collected\n"), msg));
+ return;
+ }
+
+ ACE_UINT64 avg = this->sum_ / this->samples_count_;
+ ACE_UINT64 dev =
+#if defined ACE_LACKS_LONGLONG_T
+ static_cast<ACE_U_LongLong> (this->sum2_ / this->samples_count_)
+ - avg * ACE_U64_TO_U32(avg);
+#else /* ! ACE_LACKS_LONGLONG_T */
+ this->sum2_ / this->samples_count_ - avg * avg;
+#endif /* ! ACE_LACKS_LONGLONG_T */
+
+ double l_min = ACE_CU64_TO_CU32 (this->min_) / sf;
+ double l_max = ACE_CU64_TO_CU32 (this->max_) / sf;
+ double l_avg = ACE_CU64_TO_CU32 (avg) / sf;
+ double l_dev = ACE_CU64_TO_CU32 (dev) / (sf * sf);
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("%s latency : %.2f[%d]/%.2f/%.2f[%d]/%.2f (min/avg/max/var^2)\n"),
+ msg,
+ l_min, this->min_at_,
+ l_avg,
+ l_max, this->max_at_,
+ l_dev));
+
+ ACE_OS::fprintf (file,
+ ACE_TEXT ("Inter Frame Arrival Time Statistics in msecs : %.2f[%d]/%.2f/%.2f[%d]/%.2f (min/avg/max/var^2)\n"),
+ l_min, this->min_at_,
+ l_avg,
+ l_max, this->max_at_,
+ l_dev);
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.h
new file mode 100644
index 00000000000..a06ec05dd90
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.h
@@ -0,0 +1,88 @@
+
+//=============================================================================
+/**
+ * @file Receiver_Stats.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef RECEIVER_STATS_H
+#define RECEIVER_STATS_H
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+#include "ace/Basic_Types.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/// Collect receiver stats about a series of samples
+/**
+ * Compute the average and standard deviation (aka jitter) for an
+ * arbitrary number of samples, using constant space.
+ * Normally used for latency statistics.
+ */
+class Receiver_Stats
+{
+public:
+ /// Constructor
+ /**
+ * The number of samples is pre-allocated, and cannot changes once
+ * the class is initialized.
+ */
+ Receiver_Stats (void);
+
+ /// The number of samples received so far
+ ACE_UINT32 samples_count (void) const;
+
+ /// Record one sample.
+ void sample (ACE_UINT64 value);
+
+ /// Update the values to reflect the stats in @a rhs.
+ void accumulate (const Receiver_Stats &rhs);
+
+ /// Dump all the samples
+ /**
+ * Prints out the results, using @a msg as a prefix for each message and
+ * scaling all the numbers by @a scale_factor. The latter is useful because
+ * high resolution timer samples are acquired in clock ticks, but often
+ * presented in microseconds.
+ */
+ void dump_results (const ACE_TCHAR *msg,
+ FILE *file,
+ ACE_UINT32 scale_factor) const;
+
+private:
+ /// The number of samples
+ ACE_UINT32 samples_count_;
+
+ /// The minimum value
+ ACE_UINT64 min_;
+
+ /// The number of the sample that had the minimum value
+ ACE_UINT32 min_at_;
+
+ /// The maximum value
+ ACE_UINT64 max_;
+
+ /// The number of the sample that had the maximum value
+ ACE_UINT32 max_at_;
+
+ /// The sum of all the values
+ ACE_UINT64 sum_;
+
+ /// The sum of the square of all the values
+ ACE_UINT64 sum2_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "Receiver_Stats.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* RECEIVER_STATS_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.inl b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.inl
new file mode 100644
index 00000000000..b60f22d1dba
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/Receiver_Stats.inl
@@ -0,0 +1,59 @@
+// $Id$
+
+ACE_INLINE
+Receiver_Stats::Receiver_Stats (void)
+ : samples_count_ (0)
+ , min_ (0)
+ , min_at_ (0)
+ , max_ (0)
+ , max_at_ (0)
+ , sum_ (0)
+ , sum2_ (0)
+{
+}
+
+ACE_INLINE ACE_UINT32
+Receiver_Stats::samples_count (void) const
+{
+ return this->samples_count_;
+}
+
+ACE_INLINE void
+Receiver_Stats::sample (ACE_UINT64 value)
+{
+ ++this->samples_count_;
+
+ if (this->samples_count_ == 1u)
+ {
+ this->min_ = value;
+ this->min_at_ = this->samples_count_;
+ this->max_ = value;
+ this->max_at_ = this->samples_count_;
+ this->sum_ = value;
+#if defined ACE_LACKS_LONGLONG_T
+ this->sum2_ = value * ACE_U64_TO_U32 (value);
+#else /* ! ACE_LACKS_LONGLONG_T */
+ this->sum2_ = value * value;
+#endif /* ! ACE_LACKS_LONGLONG_T */
+ }
+ else
+ {
+ if (this->min_ > value)
+ {
+ this->min_ = value;
+ this->min_at_ = this->samples_count_;
+ }
+ if (this->max_ < value)
+ {
+ this->max_ = value;
+ this->max_at_ = this->samples_count_;
+ }
+
+ this->sum_ += value;
+#if defined ACE_LACKS_LONGLONG_T
+ this->sum2_ += value * ACE_U64_TO_U32 (value);
+#else /* ! ACE_LACKS_LONGLONG_T */
+ this->sum2_ += value * value;
+#endif /* ! ACE_LACKS_LONGLONG_T */
+ }
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.cpp
new file mode 100644
index 00000000000..31bdd2c32e2
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.cpp
@@ -0,0 +1,326 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+static FILE *output_file = 0;
+// File handle of the file into which received data is written.
+
+static const char *output_file_name = "output";
+// File name of the file into which received data is written.
+
+static const char* stats_file_name = "Stats.dat";
+
+int stats [1000010];
+long stats_index = 0;
+
+int start = 1;
+ACE_Time_Value start_time;
+
+int
+Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (0)
+{
+}
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ this->frame_count_++));
+
+ if (start)
+ {
+ start_time = ACE_OS::gettimeofday ();
+ start = 0;
+ }
+ else
+ {
+ ACE_Time_Value elapsed_time = ACE_OS::gettimeofday () - start_time;
+ stats [stats_index++] = elapsed_time.msec ();
+ start_time = ACE_OS::gettimeofday ();
+ }
+
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+
+
+ return 0;
+}
+
+void
+Receiver_Callback::dump_samples (const char* file)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Dumping Stats.....\n"));
+
+ FILE* stats_file = ACE_OS::fopen (file, "w");
+
+ if (stats_file == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Stats.dat cannot be opened \n"));
+ }
+
+ int i;
+ for (i = 0; i < stats_index; i++)
+ {
+ stats_.sample ((ACE_UINT64)stats [i]);
+ }
+
+ stats_.dump_results ("Inter Frame Arrival Time Statistics ",
+ stats_file,
+ 1);
+ // ACE_High_Res_Timer::global_scale_factor ());
+
+ for (i = 0; i < stats_index; i++)
+ {
+ ACE_OS::fprintf (stats_file, "%d\n",stats [i]);
+ }
+
+ ACE_OS::fclose (stats_file);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Done\n"));
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::end_stream\n"));
+
+ dump_samples (stats_file_name);
+
+ ACE_TRY_NEW_ENV
+ {
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Receiver_Callback::handle_destroy Failed\n");
+ return -1;
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0)
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+int
+Receiver::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Initialize the naming services
+ if (this->naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the receiver object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+
+int
+parse_args (int argc,
+ char **argv)
+{
+ // Parse the command line arguments
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:s:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ output_file_name = opts.opt_arg ();
+ break;
+ case 's':
+ stats_file_name = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: receiver -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result =
+ parse_args (argc,
+ argv);
+
+ if (result == -1)
+ return -1;
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ Receiver receiver;
+ result =
+ receiver.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.h
new file mode 100644
index 00000000000..718b2deac25
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/receiver.h
@@ -0,0 +1,110 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+#include "Receiver_Stats.h"
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+ void dump_samples (const char* file);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+
+ Receiver_Stats stats_;
+
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Receiver_Callback callback_;
+ // Receiver application callback.
+
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ // Constructor
+
+ ~Receiver (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+
+protected:
+ TAO_Naming_Client naming_client_;
+ // The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reactive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ // Receiver MMDevice.
+
+
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl
new file mode 100755
index 00000000000..bb24ced8125
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl
@@ -0,0 +1,124 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$outfile = PerlACE::LocalFile ("output");
+
+$debug = 0;
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+unlink $nsior;
+
+for ($i = 0; $i <= $#ARGV; $i++)
+{
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ {
+ print STDERR "\nusage: run_test\n";
+
+ print STDERR "\t-h shows options menu\n";
+
+ print STDERR "\t-p: Transport protocols defaults to (";
+ for $protocol (@protocols)
+ {
+ print STDERR "$protocol, ";
+ }
+ print STDERR ")\n";
+
+ print STDERR "\t-d: Debug Level defaults to 0";
+
+ print STDERR "\n";
+
+ exit;
+ }
+ elsif ($ARGV[$i] eq "-p")
+ {
+ @protocols = split (',', $ARGV[$i + 1]);
+ $i++;
+ }
+ elsif ($ARGV[$i] eq "-d")
+ {
+ $debug = $ARGV[$i + 1];
+ $i++;
+ }
+}
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+
+print STDERR "Starting Naming Service\n";
+
+if ($NS->Spawn () == -1) {
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
+{
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$output_file = "TCP_output";
+
+for $protocol (@protocols)
+{
+
+ $output_file = $protocol."_output";
+
+ if ($protocol eq "RTP_UDP")
+ {
+ $protocol = "RTP/UDP";
+ }
+
+ $SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
+ $CL = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
+
+ print STDERR "Using ".$protocol."\n";
+ print STDERR "Starting Receiver\n";
+
+ $SV->Spawn ();
+
+ sleep $sleeptime;
+
+ print STDERR "Starting Sender\n";
+
+ $sender = $CL->SpawnWaitKill (200);
+
+ if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+ }
+
+ $receiver = $SV->TerminateWaitKill (200);
+
+ if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+ }
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
new file mode 100644
index 00000000000..c98b0bed8bb
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
@@ -0,0 +1,505 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+// Create a singleton instance of the Sender.
+
+// An Unmanaged_Singleton is used to avoid static object destruction
+// order related problems since the underlying singleton object
+// contains references to static TypeCodes.
+
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ SENDER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ streamctrl_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ protocol_ ("UDP"),
+ frame_rate_ (30.0),
+ mb_ (1000),
+ address_ (0),
+ peer_address_ (0),
+ local_sec_addrs_ (0),
+ peer_sec_addrs_ (0),
+ num_local_sec_addrs_ (0),
+ num_peer_sec_addrs_ (0),
+ max_frame_count_ (20)
+{
+}
+
+void
+Sender::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:p:r:dl:a:s:b:");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'p':
+ this->protocol_ = opts.opt_arg ();
+ break;
+ case 'r':
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ case 'b':
+ mb_.size (ACE_OS::atoi (opts.opt_arg ()));
+ break;
+ case 's':
+ {
+ max_frame_count_ = (long) ACE_OS::atoi (opts.opt_arg ());
+ if (max_frame_count_ > 1000000)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Max Frame Count should be < 10^6 \n"),
+ -1);
+ break;
+ }
+ case 'l':
+ {
+ TAO_Tokenizer addr_token (opts.opt_arg (), ',');
+ this->address_ = CORBA::string_dup (addr_token [0]);
+ num_local_sec_addrs_ = addr_token.num_tokens () - 1;
+ if (num_local_sec_addrs_ != 0)
+ ACE_NEW_RETURN (local_sec_addrs_, char* [num_local_sec_addrs_], -1);
+ for (int j = 1; j <= num_local_sec_addrs_; j++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "adding addresses to sequence %s\n",
+ addr_token [j]));
+
+ local_sec_addrs_ [j-1] = CORBA::string_dup (addr_token [j]);
+ }
+ }
+ break;
+ case 'a':
+ {
+ TAO_Tokenizer addr_token (opts.opt_arg (), ',');
+ this->peer_address_ = CORBA::string_dup (addr_token [0]);
+ num_peer_sec_addrs_ = addr_token.num_tokens () - 1;
+ if (num_peer_sec_addrs_ != 0)
+ ACE_NEW_RETURN (peer_sec_addrs_, char* [num_peer_sec_addrs_], -1);
+ for (int j = 1; j <= num_peer_sec_addrs_; j++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "adding addresses to sequence %s\n",
+ addr_token [j]));
+
+ peer_sec_addrs_ [j-1] = CORBA::string_dup (addr_token [j]);
+ }
+ }
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+// Method to get the object reference of the receiver
+int
+Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Resolve the receiver object reference from the Naming Service
+ CORBA::Object_var receiver_mmdevice_obj =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->receiver_mmdevice_ =
+ AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->receiver_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Receiver_MMdevice in Naming service <%s>\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the naming services
+ result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Resolve the object reference of the receiver from the Naming Service.
+ result = this->bind_to_receiver (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+
+
+ // Initialize the QoS
+ AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
+
+ // Set the address of the ftp client.
+ ACE_INET_Addr addr;
+ char buf [BUFSIZ];
+
+ if (address_ != 0)
+ addr.set (address_);
+ else
+ {
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ addr.set (8000,
+ buf);
+ }
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry ("Data_Receiver",
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ &addr);
+
+ ACE_INET_Addr peer_addr;
+ if (peer_address_ != 0)
+ peer_addr.set (peer_address_);
+ else
+ {
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ peer_addr.set (8050,
+ buf);
+ }
+
+ entry.set_peer_addr (&peer_addr);
+
+ entry.set_local_sec_addr (local_sec_addrs_, num_local_sec_addrs_);
+
+ entry.set_peer_sec_addr (peer_sec_addrs_, num_peer_sec_addrs_);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->streamctrl_,
+ TAO_StreamCtrl,
+ -1);
+
+ PortableServer::ServantBase_var safe_streamctrl =
+ this->streamctrl_;
+
+ // Bind/Connect the sender and receiver MMDevices.
+ CORBA::Boolean bind_result =
+ this->streamctrl_->bind_devs (mmdevice.in (),
+ this->receiver_mmdevice_.in (),
+ the_qos.inout (),
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (bind_result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "streamctrl::bind_devs failed\n"),
+ -1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // The time that should lapse between two consecutive frames sent.
+ ACE_Time_Value inter_frame_time;
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1.0 / this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %f / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ int buffer_size = mb_.size ();
+
+ // Continue to send data till the file is read to the end.
+ while (frame_count_ < max_frame_count_)
+ {
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"End of file - Rewinding\n"));
+
+ ACE_OS::rewind (this->input_file_);
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 0)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ // Send frame.
+ int result =
+ this->protocol_object_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::pace_data frame %d was sent succesfully %d\n",
+ ++this->frame_count_,
+ buffer_size));
+
+ ++this->frame_count_;
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ } // end while
+
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Shut the orb down.
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Sender.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::init failed\n"),
+ -1);
+
+ // Start sending data.
+ result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
new file mode 100644
index 00000000000..32cbf2856c9
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
@@ -0,0 +1,135 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ // = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Method to pace and send data from a file.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ int bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL);
+ // Method that binds the sender to the receiver.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ // The endpoint strategy used by the sender.
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ // The receiver MMDevice that the sender connects to.
+
+ TAO_MMDevice *sender_mmdevice_;
+ // The sender MMDevice.
+
+ TAO_StreamCtrl *streamctrl_;
+ // Stream controller
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ ACE_CString protocol_;
+ // Selected protocol - default is UDP
+
+ double frame_rate_;
+ // Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+
+ char* address_;
+ // Destination Address.
+
+ char* peer_address_;
+ // Destination Address.
+
+ char** local_sec_addrs_;
+ // Local secondary addresses
+
+ char** peer_sec_addrs_;
+ // Peer secondary addresses
+
+ int num_local_sec_addrs_;
+ int num_peer_sec_addrs_;
+
+ long max_frame_count_;
+
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/AVS_Simple_Two_Stage_With_QoS.mpc b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/AVS_Simple_Two_Stage_With_QoS.mpc
new file mode 100644
index 00000000000..56c33140d0e
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/AVS_Simple_Two_Stage_With_QoS.mpc
@@ -0,0 +1,17 @@
+// -*- MPC -*-
+// $Id$
+
+project(*send): avstreamsexe, qos {
+ exename = sender
+ Source_Files {
+ sender.cpp
+ }
+}
+
+project(*recv): avstreamsexe, qos {
+ exename = receiver
+ Source_Files {
+ receiver.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/Makefile.am b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/Makefile.am
new file mode 100644
index 00000000000..0f573502d0c
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.AVS_Simple_Two_Stage_With_QoS_Recv.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += receiver
+
+receiver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+receiver_SOURCES = \
+ receiver.cpp \
+ receiver.h
+
+receiver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.AVS_Simple_Two_Stage_With_QoS_Send.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += sender
+
+sender_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+sender_SOURCES = \
+ sender.cpp \
+ sender.h
+
+sender_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_AV.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README
new file mode 100644
index 00000000000..34e15063ddd
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README
@@ -0,0 +1,57 @@
+// $Id$
+
+Description
+-----------
+
+This directory contains a simple test in the form of a sender and a
+receiver. The test has the following features:
+
+1.It tests the AVStreams Integration with the AQoSA API when compiled
+and run with rapi=1. The test initiates an RSVP session between the
+sender and receiver.
+
+2.When rapi=0, that is, intserv is not used then it sets the diffserv
+codepoint to 0x3f.
+
+3. Shows a mechanism to pace data.
+
+Running the test
+----------------
+
+If running with rapi=1 start the RSVP daemon(s).
+
+The following is common irrespective of the rapi flag value.
+
+The test must be run with the naming service. Check the run_test.pl
+to see how to configure the test case.
+
+receiver
+--------
+
+receiver -f <output_filename>
+
+-f <output_filename> -> The name of the file under which the received stream
+ data has to be stored (defaults to "output")
+
+sender
+------
+
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-l <local_address>] [-a <peer_address>] [-d]
+
+
+-f filename --> The file to be streamed to the receiver (defaults to
+ "input").
+
+-p protocol --> The protocol string sould be QoS_UDP if rapi=1 else it
+ should be UDP,RTP/UDP, SCTP_SEQ (defaults to UDP).
+
+-r framerate--> The rate at which tha data frames need to be sent
+ (defaults to 30 frames per second).
+
+-l address --> Local address in the format host:port.
+
+-a address --> Destination address in the format host:port.
+
+-d --> Increament the TAO_debug_level for debug messages.
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.cpp
new file mode 100644
index 00000000000..527be2f6f10
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.cpp
@@ -0,0 +1,262 @@
+// $Id$
+
+#include "receiver.h"
+#include "ace/Get_Opt.h"
+
+static FILE *output_file = 0;
+// File handle of the file into which received data is written.
+
+static const char *output_file_name = "output";
+// File name of the file into which received data is written.
+
+int
+Receiver_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ // Return the receiver application callback to the AVStreams for
+ // future upcalls.
+ callback = &this->callback_;
+
+ return 0;
+}
+
+Receiver_Callback::Receiver_Callback (void)
+ : frame_count_ (0)
+{
+}
+
+int
+Receiver_Callback::receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *,
+ const ACE_Addr &)
+{
+ //
+ // Upcall from the AVStreams when there is data to be received from
+ // the sender.
+ //
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::receive_frame for frame %d\n",
+ ++this->frame_count_));
+
+ while (frame != 0)
+ {
+ // Write the received data to the file.
+ size_t result =
+ ACE_OS::fwrite (frame->rd_ptr (),
+ frame->length (),
+ 1,
+ output_file);
+
+ if (result == frame->length ())
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Receiver_Callback::fwrite failed\n"),
+ -1);
+
+ frame = frame->cont ();
+ }
+
+ return 0;
+}
+
+int
+Receiver_Callback::handle_destroy (void)
+{
+ // Called when the distributer requests the stream to be shutdown.
+ ACE_DEBUG ((LM_DEBUG,
+ "Receiver_Callback::end_stream\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Receiver_Callback::handle_destroy Failed\n");
+ return -1;
+
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Receiver::Receiver (void)
+ : mmdevice_ (0)
+{
+}
+
+Receiver::~Receiver (void)
+{
+}
+
+
+
+int
+Receiver::init (int,
+ char **
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->reactive_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Register the receiver mmdevice object with the ORB
+ ACE_NEW_RETURN (this->mmdevice_,
+ TAO_MMDevice (&this->reactive_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->mmdevice_;
+
+ CORBA::Object_var mmdevice =
+ this->mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register the mmdevice with the naming service.
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Initialize the naming services
+ if (this->naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to initialize "
+ "the TAO_Naming_Client\n"),
+ -1);
+
+ // Register the receiver object with the naming server.
+ this->naming_client_->rebind (name,
+ mmdevice.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+parse_args (int argc,
+ char **argv)
+{
+ // Parse the command line arguments
+ ACE_Get_Opt opts (argc,
+ argv,
+ "f:");
+
+ int c;
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ output_file_name = opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: receiver -f filename"),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AVStreams components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int result =
+ parse_args (argc,
+ argv);
+
+ if (result == -1)
+ return -1;
+
+ // Make sure we have a valid <output_file>
+ output_file = ACE_OS::fopen (output_file_name,
+ "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open output file %s\n",
+ output_file_name),
+ -1);
+
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File Opened Successfully\n"));
+
+ Receiver receiver;
+ result =
+ receiver.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result != 0)
+ return result;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Hack for now....
+ ACE_OS::sleep (1);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"receiver::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_OS::fclose (output_file);
+
+
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.h
new file mode 100644
index 00000000000..91af15eaa33
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/receiver.h
@@ -0,0 +1,104 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple
+//
+// = FILENAME
+// receiver.h
+//
+// = DESCRIPTION
+// This application receives data from a AV sender and writes it to
+// a file.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Policy.h"
+
+
+class Receiver_Callback : public TAO_AV_Callback
+{
+ // = TITLE
+ // Application defined callback object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class when data shows up from a sender.
+public:
+
+ Receiver_Callback (void);
+ // Constructor.
+
+ // Method that is called when there is data to be received from a
+ // sender.
+ int receive_frame (ACE_Message_Block *frame,
+ TAO_AV_frame_info *frame_info,
+ const ACE_Addr &peer_address);
+
+ // Called when the sender is done sending data and wants to close
+ // down the connection.
+ int handle_destroy (void);
+
+private:
+ int frame_count_;
+ // Keeping a count of the incoming frames.
+};
+
+class Receiver_StreamEndPoint : public TAO_Server_StreamEndPoint
+{
+ // = TITLE
+ // Application defined stream endpoint object.
+ //
+ // = DESCRIPTION
+ // AVStreams calls this class during connection setup.
+public:
+ // Create a receiver application callback.
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+
+private:
+ Receiver_Callback callback_;
+ // Receiver application callback.
+};
+
+class Receiver
+{
+ // = TITLE
+ // Receiver application class.
+ //
+ // = DESCRIPTION
+ // This class receives data from a AV sender and writes it to
+ // a file.
+public:
+ Receiver (void);
+ // Constructor
+
+ ~Receiver (void);
+ // Destructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Initialize data components.
+
+protected:
+ TAO_Naming_Client naming_client_;
+ // The Naming Service Client.
+
+ TAO_AV_Endpoint_Reactive_Strategy_B
+ <Receiver_StreamEndPoint,TAO_VDev,AV_Null_MediaCtrl> reactive_strategy_;
+ // The endpoint reactive strategy.
+
+ TAO_MMDevice *mmdevice_;
+ // Receiver MMDevice.
+};
+
+
+
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl
new file mode 100755
index 00000000000..d8bde72c0f5
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl
@@ -0,0 +1,122 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+use File::stat;
+
+# amount of delay between running the servers
+
+$sleeptime = 2;
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+$outfile = PerlACE::LocalFile ("output");
+
+$debug = 0;
+
+# generate test stream data
+$input = PerlACE::generate_test_file("test_input", 102400);
+
+unlink $nsior;
+
+for ($i = 0; $i <= $#ARGV; $i++)
+{
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
+ {
+ print STDERR "\nusage: run_test\n";
+
+ print STDERR "\t-h shows options menu\n";
+
+ print STDERR "\t-p: Transport protocols defaults to (";
+ for $protocol (@protocols)
+ {
+ print STDERR "$protocol, ";
+ }
+ print STDERR ")\n";
+
+ print STDERR "\t-d: Debug Level defaults to 0";
+
+ print STDERR "\n";
+
+ exit;
+ }
+ elsif ($ARGV[$i] eq "-p")
+ {
+ @protocols = split (',', $ARGV[$i + 1]);
+ $i++;
+ }
+ elsif ($ARGV[$i] eq "-d")
+ {
+ $debug = $ARGV[$i + 1];
+ $i++;
+ }
+}
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 100) == -1)
+{
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$output_file = "TCP_output";
+
+for $protocol (@protocols)
+{
+
+ $output_file = $protocol."_output";
+
+ if ($protocol eq "RTP_UDP")
+ {
+ $protocol = "RTP/UDP";
+ }
+
+ $SV = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -f ".$output_file);
+ $CL = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -ORBDebugLevel ".$debug." -p ".$protocol." -f $input");
+
+ print STDERR "Using ".$protocol."\n";
+ print STDERR "Starting Receiver\n";
+
+ $SV->Spawn ();
+
+ sleep $sleeptime;
+
+ print STDERR "Starting Sender\n";
+
+ $sender = $CL->SpawnWaitKill (200);
+
+ if ($sender != 0) {
+ print STDERR "ERROR: sender returned $sender\n";
+ $status = 1;
+ }
+
+ $receiver = $SV->TerminateWaitKill (200);
+
+ if ($receiver != 0) {
+ print STDERR "ERROR: receiver returned $receiver\n";
+ $status = 1;
+ }
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: Naming Service returned $nserver\n";
+ $status = 1;
+}
+
+unlink $nsior;
+unlink $output, $input;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp
new file mode 100644
index 00000000000..05bc380156d
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp
@@ -0,0 +1,576 @@
+// $Id$
+
+#include "sender.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+static u_long peak_bandwidth = 18400;
+
+typedef ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> SENDER;
+// Create a singleton instance of the Sender.
+
+// The time that should lapse between two consecutive frames sent.
+ACE_Time_Value inter_frame_time;
+
+CORBA::Boolean
+Sender_StreamEndPoint::modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_flows
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC (( CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed ))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender_StreamEndPoint::modify_QoS\n"));
+
+ int result = this->change_qos (new_qos, the_flows ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (result != 0)
+ return 0;
+
+ return 1;
+}
+
+int
+Sender_StreamEndPoint::get_callback (const char *,
+ TAO_AV_Callback *&callback)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ // Create and return the sender application callback to AVStreams
+ // for further upcalls.
+ callback = &this->callback_;
+
+ TAO_Negotiator *negotiator;
+ ACE_NEW_RETURN (negotiator,
+ TAO_Negotiator,
+ -1);
+ AVStreams::Negotiator_var negotiator_obj =
+ negotiator->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->set_negotiator (negotiator_obj.in ());
+
+ return 0;
+}
+
+int
+Sender_StreamEndPoint::set_protocol_object (const char *,
+ TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ SENDER::instance ()->protocol_object (object);
+ return 0;
+}
+
+Sender::Sender (void)
+ : sender_mmdevice_ (0),
+ streamctrl_ (0),
+ frame_count_ (0),
+ filename_ ("input"),
+ input_file_ (0),
+ protocol_ ("UDP"),
+ frame_rate_ (1.0),
+ mb_ (BUFSIZ),
+ address_ (0),
+ peer_addr_ (0)
+{
+}
+
+void
+Sender::protocol_object (TAO_AV_Protocol_Object *object)
+{
+ // Set the sender protocol object corresponding to the transport
+ // protocol selected.
+ this->protocol_object_ = object;
+}
+
+int
+Sender::parse_args (int argc,
+ char **argv)
+{
+ // Parse command line arguments
+ ACE_Get_Opt opts (argc, argv, "f:p:r:l:a:d");
+
+ int c;
+ while ((c= opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'f':
+ this->filename_ = opts.opt_arg ();
+ break;
+ case 'p':
+ this->protocol_ = opts.opt_arg ();
+#ifdef ACE_HAS_RAPI
+ if (this->protocol_ != ACE_CString ("QoS_UDP"))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "When rapi=1 protocol must be QoS_UDP\n"),
+ -1);
+#else
+ if (this->protocol_ == ACE_CString ("QoS_UDP"))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "When rapi=0 protocol must not be QoS_UDP\n"),
+ -1);
+#endif //ACE_HAS_RAPI
+ break;
+ case 'r':
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ case 'l':
+ this->address_ = opts.opt_arg ();
+ break;
+ case 'a':
+ this->peer_addr_ = opts.opt_arg ();
+ break;
+ default:
+ ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
+ return -1;
+ }
+ }
+ return 0;
+}
+
+void
+Sender::fill_qos (AVStreams::streamQoS &qos)
+{
+ peak_bandwidth += 100;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sender::fill_qos %d\n",
+ peak_bandwidth));
+
+ qos.length (1);
+ qos [0].QoSType = CORBA::string_dup ("Data_Receiver");
+
+#ifdef ACE_HAS_RAPI
+ qos [0].QoSParams.length (10);
+
+ qos [0].QoSParams [0].property_name = CORBA::string_dup ("Service_Type");
+ qos [0].QoSParams [0].property_value <<= (CORBA::Short) 1;//ACE_SERVICETYPE_CONTROLLEDLOAD;
+
+ qos [0].QoSParams [1].property_name = CORBA::string_dup ("Token_Rate");
+ qos [0].QoSParams [1].property_value <<= (CORBA::ULong) 9200 ;
+
+ qos [0].QoSParams [2].property_name = CORBA::string_dup ("Token_Bucket_Size");
+ qos [0].QoSParams [2].property_value <<= (CORBA::ULong) 708;
+
+ qos [0].QoSParams [3].property_name = CORBA::string_dup ("Peak_Bandwidth");
+ qos [0].QoSParams [3].property_value <<= (CORBA::ULong) peak_bandwidth;
+
+
+ qos [0].QoSParams [4].property_name = CORBA::string_dup ("Latency");
+ qos [0].QoSParams [4].property_value <<= (CORBA::ULong) 0;
+
+ qos [0].QoSParams [5].property_name = CORBA::string_dup ("Delay_Variation");
+ qos [0].QoSParams [5].property_value <<= (CORBA::ULong) 0;
+
+ qos [0].QoSParams [6].property_name = CORBA::string_dup ("Max_SDU_Size");
+ qos [0].QoSParams [6].property_value <<= (CORBA::ULong) 368;
+
+ qos [0].QoSParams [7].property_name = CORBA::string_dup ("Minimum_Policed_Size");
+ qos [0].QoSParams [7].property_value <<= (CORBA::ULong) 368;
+
+ qos [0].QoSParams [8].property_name = CORBA::string_dup ("TTL");
+ qos [0].QoSParams [8].property_value <<= (CORBA::ULong) 25;
+
+ qos [0].QoSParams [9].property_name = CORBA::string_dup ("Priority");
+ qos [0].QoSParams [9].property_value <<= (CORBA::ULong) 1;
+#else
+ qos [0].QoSParams.length (1);
+ qos [0].QoSParams [0].property_name = CORBA::string_dup ("Diffserv_Codepoint");
+ qos [0].QoSParams [0].property_value <<= (CORBA::Long) 63;
+#endif //ACE_HAS_RAPI
+
+
+}
+
+// Method to get the object reference of the receiver
+int
+Sender::bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name [0].id =
+ CORBA::string_dup ("Receiver");
+
+ // Resolve the receiver object reference from the Naming Service
+ CORBA::Object_var receiver_mmdevice_obj =
+ this->naming_client_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->receiver_mmdevice_ =
+ AVStreams::MMDevice::_narrow (receiver_mmdevice_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->receiver_mmdevice_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Receiver_MMdevice in Naming service <%s>\n"),
+ -1);
+
+ return 0;
+}
+
+int
+Sender::init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the endpoint strategy with the orb and poa.
+ int result =
+ this->endpoint_strategy_.init (TAO_AV_CORE::instance ()->orb (),
+ TAO_AV_CORE::instance ()->poa ());
+ if (result != 0)
+ return result;
+
+ // Initialize the naming services
+ result =
+ this->naming_client_.init (TAO_AV_CORE::instance ()->orb ());
+ if (result != 0)
+ return result;
+
+ // Parse the command line arguments
+ result =
+ this->parse_args (argc,
+ argv);
+ if (result != 0)
+ return result;
+
+ // Open file to read.
+ this->input_file_ =
+ ACE_OS::fopen (this->filename_.c_str (),
+ "r");
+
+ if (this->input_file_ == 0)
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Cannot open input file %s\n",
+ this->filename_.c_str ()),
+ -1);
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "File opened successfully\n"));
+
+ // Resolve the object reference of the receiver from the Naming Service.
+ result = this->bind_to_receiver (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Error binding to the naming service\n"),
+ -1);
+
+ this->flowname_ = "Data_Receiver";
+
+ // Set the address of the ftp client.
+ ACE_INET_Addr* addr;
+ if (this->address_ != 0)
+ ACE_NEW_RETURN (addr,
+ ACE_INET_Addr (this->address_),
+ -1);
+ else
+ {
+ char buf [BUFSIZ];
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ ACE_NEW_RETURN (addr,
+ ACE_INET_Addr ("5000",
+ buf),
+ -1);
+ }
+
+ // Create the forward flow specification to describe the flow.
+ TAO_Forward_FlowSpec_Entry entry (this->flowname_.c_str (),
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ addr);
+
+ ACE_INET_Addr* peer_addr;
+ if (this->peer_addr_ != 0)
+ ACE_NEW_RETURN (peer_addr,
+ ACE_INET_Addr (this->peer_addr_),
+ -1);
+ else
+ {
+ char buf [BUFSIZ];
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ ACE_NEW_RETURN (peer_addr,
+ ACE_INET_Addr ("5050",
+ buf),
+ -1);
+ }
+
+ entry.set_peer_addr (peer_addr);
+
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ // Register the sender mmdevice object with the ORB
+ ACE_NEW_RETURN (this->sender_mmdevice_,
+ TAO_MMDevice (&this->endpoint_strategy_),
+ -1);
+
+ // Servant Reference Counting to manage lifetime
+ PortableServer::ServantBase_var safe_mmdevice =
+ this->sender_mmdevice_;
+
+ AVStreams::MMDevice_var mmdevice =
+ this->sender_mmdevice_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->streamctrl_,
+ TAO_StreamCtrl,
+ -1);
+
+ PortableServer::ServantBase_var safe_streamctrl =
+ this->streamctrl_;
+
+ AVStreams::streamQoS qos;
+
+ //this->fill_qos (qos);
+
+ // Bind/Connect the sender and receiver MMDevices.
+ CORBA::Boolean bind_result =
+ this->streamctrl_->bind_devs (mmdevice.in (),
+ this->receiver_mmdevice_.in (),
+ qos,
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (bind_result == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "streamctrl::bind_devs failed\n"),
+ -1);
+
+ return 0;
+}
+
+// Method to send data at the specified rate
+int
+Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+
+ // The time between two consecutive frames.
+ inter_frame_time.set (1.0 / this->frame_rate_);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Frame Rate = %f / second\n"
+ "Inter Frame Time = %d (msec)\n",
+ this->frame_rate_,
+ inter_frame_time.msec ()));
+
+ ACE_TRY
+ {
+ // The time taken for sending a frame and preparing for the next frame
+ ACE_High_Res_Timer elapsed_timer;
+
+ // Continue to send data till the file is read to the end.
+ while (1)
+ {
+ // Read from the file into a message block.
+ int n = ACE_OS::fread (this->mb_.wr_ptr (),
+ 1,
+ this->mb_.size (),
+ this->input_file_);
+
+ if (n < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::pace_data fread failed\n"),
+ -1);
+
+ if (n == 0)
+ {
+ // At end of file break the loop and end the sender.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"Handle_Start:End of file\n"));
+ break;
+ }
+
+ this->mb_.wr_ptr (n);
+
+ if (this->frame_count_ > 1)
+ {
+ //
+ // Second frame and beyond
+ //
+
+ // Stop the timer that was started just before the previous frame was sent.
+ elapsed_timer.stop ();
+
+ // Get the time elapsed after sending the previous frame.
+ ACE_Time_Value elapsed_time;
+ elapsed_timer.elapsed_time (elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Elapsed Time = %d\n",
+ elapsed_time.msec ()));
+
+ // Check to see if the inter frame time has elapsed.
+ if (elapsed_time < inter_frame_time)
+ {
+ // Inter frame time has not elapsed.
+
+ // Calculate the time to wait before the next frame needs to be sent.
+ ACE_Time_Value wait_time (inter_frame_time - elapsed_time);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Wait Time = %d\n",
+ wait_time.msec ()));
+
+ // Run the orb for the wait time so the sender can
+ // continue other orb requests.
+ TAO_AV_CORE::instance ()->orb ()->run (wait_time
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ // Start timer before sending the frame.
+ elapsed_timer.start ();
+
+ // Send frame.
+ int result =
+ this->protocol_object_->send_frame (&this->mb_);
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "send failed:%p",
+ "Sender::pace_data send\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ " Sender::pace_data frame %d was sent succesfully\n",
+ ++this->frame_count_));
+
+ // Reset the message block.
+ this->mb_.reset ();
+
+ if (this->frame_count_ == 2)
+ {
+ TAO_Forward_FlowSpec_Entry entry (this->flowname_.c_str (),
+ "IN",
+ "USER_DEFINED",
+ "",
+ this->protocol_.c_str (),
+ 0);
+ AVStreams::flowSpec flow_spec (1);
+ flow_spec.length (1);
+ flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
+
+ AVStreams::streamQoS qos;
+ this->fill_qos (qos);
+ this->streamctrl_->modify_QoS (qos,
+ flow_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ } // end while
+
+ // File reading is complete, destroy the stream.
+ AVStreams::flowSpec stop_spec;
+ this->streamctrl_->destroy (stop_spec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Shut the orb down.
+ TAO_AV_CORE::instance ()->orb ()->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender::pace_data Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+main (int argc,
+ char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+
+ CORBA::Object_var obj
+ = orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_var object from Object_var
+ PortableServer::POA_var root_poa
+ = PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var mgr
+ = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the AV Stream components.
+ TAO_AV_CORE::instance ()->init (orb.in (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the Sender.
+ int result = 0;
+ result = SENDER::instance ()->init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Sender::init failed\n"),
+ -1);
+
+ // Start sending data.
+ result = SENDER::instance ()->pace_data (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Sender Failed\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ SENDER::close (); // Explicitly finalize the Unmanaged_Singleton.
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex> *ACE_Unmanaged_Singleton<Sender, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h
new file mode 100644
index 00000000000..a314624ed28
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h
@@ -0,0 +1,134 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS
+//
+// = FILENAME
+// sender.h
+//
+// = DESCRIPTION
+// This application reads data from a file and sends it to s
+// receiver through an RSVP enabled stream.
+//
+// = AUTHOR
+// Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/AV/AVStreams_i.h"
+#include "orbsvcs/AV/Endpoint_Strategy.h"
+#include "orbsvcs/AV/Protocol_Factory.h"
+
+class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
+{
+ // = TITLE
+ // Defines a sender stream endpoint.
+public:
+ int get_callback (const char *flowname,
+ TAO_AV_Callback *&callback);
+ // Create the application callback and return its handle to
+ // AVStreams for further application callbacks.
+
+ int set_protocol_object (const char *flowname,
+ TAO_AV_Protocol_Object *object);
+ // Set protocol object corresponding to the transport protocol
+ // chosen.
+
+ CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &/* the_flows */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC(( CORBA::SystemException,
+ AVStreams::noSuchFlow,
+ AVStreams::QoSRequestFailed ));
+protected:
+ TAO_AV_Callback callback_;
+ // Application callback.
+};
+
+typedef TAO_AV_Endpoint_Reactive_Strategy_A
+ <Sender_StreamEndPoint,
+ TAO_VDev,
+ AV_Null_MediaCtrl>
+ SENDER_ENDPOINT_STRATEGY;
+
+class Sender
+{
+ // = TITLE
+ // Sender Application.
+ //
+ // = DESCRIPTION
+ // Class is responsible for streaming (and pacing) data to a
+ // receiver.
+public:
+ Sender (void);
+ // Constructor
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Method to initialize the various data components.
+
+ int pace_data (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Method to pace and send data from a file.
+
+ void protocol_object (TAO_AV_Protocol_Object *protocol_object);
+ // Set the protocol object corresponding to the transport protocol chosen.
+
+ void fill_qos (AVStreams::streamQoS &);
+ // Method to populate the required qos.
+
+private:
+ int parse_args (int argc, char **argv);
+ // Method to parse the command line arguments.
+
+ int bind_to_receiver (ACE_ENV_SINGLE_ARG_DECL);
+ // Method that binds the sender to the receiver.
+
+ SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
+ // The endpoint strategy used by the sender.
+
+ AVStreams::MMDevice_var receiver_mmdevice_;
+ // The receiver MMDevice that the sender connects to.
+
+ TAO_MMDevice *sender_mmdevice_;
+ // The sender MMDevice.
+
+ TAO_StreamCtrl *streamctrl_;
+ // Stream controller
+
+ int frame_count_;
+ // Number of frames sent.
+
+ ACE_CString filename_;
+ // File from which data is read.
+
+ TAO_Naming_Client naming_client_;
+ // The Naming Service client.
+
+ FILE *input_file_;
+ // File handle of the file read from.
+
+ ACE_CString protocol_;
+ // Selected protocol - default is UDP
+
+ double frame_rate_;
+ // Rate at which the data will be sent.
+
+ ACE_Message_Block mb_;
+ // Message block into which data is read from a file and then sent.
+
+ TAO_AV_Protocol_Object *protocol_object_;
+ // Protocol object corresponding to the transport protocol selected.
+
+ char* address_;
+ // Destination Address.
+
+ char* peer_addr_;
+ // Destination Address.
+
+ ACE_CString flowname_;
+};
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/README.uav b/TAO/orbsvcs/tests/AVStreams/mpeg/README.uav
new file mode 100644
index 00000000000..c3f7f0135a6
--- /dev/null
+++ b/TAO/orbsvcs/tests/AVStreams/mpeg/README.uav
@@ -0,0 +1,14 @@
+// $Id$
+
+The original MPEG player in this directory has been removed,
+since it has been superceded by a better example, developed
+jointly by BBN Technologies and OOMWorks.
+
+The example is available here:
+http://www.dist-systems.bbn.com/projects/AIRES/UAV/index.shtml
+
+The members of the team which developed this software were:
+
+Yamuna Krishnamurthy <yamuna@cs.wustl.edu>, OOMWorks
+Irfan Pyarali <irfan@cs.wustl.edu>, OOMWorks
+Craig Rodrigues <crodrigu@bbn.com>, BBN
diff --git a/TAO/orbsvcs/tests/BiDir_CORBALOC/BiDirCORBALOC.mpc b/TAO/orbsvcs/tests/BiDir_CORBALOC/BiDirCORBALOC.mpc
new file mode 100644
index 00000000000..1201bb99646
--- /dev/null
+++ b/TAO/orbsvcs/tests/BiDir_CORBALOC/BiDirCORBALOC.mpc
@@ -0,0 +1,10 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Server): namingexe, portableserver, bidir_giop, utils {
+ Source_Files {
+ TimeServer.cpp
+ }
+}
+
+
diff --git a/TAO/orbsvcs/tests/BiDir_CORBALOC/Makefile.am b/TAO/orbsvcs/tests/BiDir_CORBALOC/Makefile.am
new file mode 100644
index 00000000000..7ebd7213a8c
--- /dev/null
+++ b/TAO/orbsvcs/tests/BiDir_CORBALOC/Makefile.am
@@ -0,0 +1,88 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.BiDirCORBALOC_Server.am
+
+BUILT_SOURCES = \
+ TimeModuleC.cpp \
+ TimeModuleC.h \
+ TimeModuleC.inl \
+ TimeModuleS.cpp \
+ TimeModuleS.h \
+ TimeModuleS.inl \
+ TimeModuleS_T.cpp \
+ TimeModuleS_T.h \
+ TimeModuleS_T.inl
+
+CLEANFILES = \
+ TimeModule-stamp \
+ TimeModuleC.cpp \
+ TimeModuleC.h \
+ TimeModuleC.inl \
+ TimeModuleS.cpp \
+ TimeModuleS.h \
+ TimeModuleS.inl \
+ TimeModuleS_T.cpp \
+ TimeModuleS_T.h \
+ TimeModuleS_T.inl
+
+TimeModuleC.cpp TimeModuleC.h TimeModuleC.inl TimeModuleS.cpp TimeModuleS.h TimeModuleS.inl TimeModuleS_T.cpp TimeModuleS_T.h TimeModuleS_T.inl: TimeModule-stamp
+
+TimeModule-stamp: $(srcdir)/TimeModule.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/TimeModule.idl
+ @touch $@
+
+noinst_PROGRAMS = TimeServer
+
+TimeServer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+TimeServer_SOURCES = \
+ TimeModuleC.cpp \
+ TimeModuleS.cpp \
+ TimeServer.cpp \
+ TimeModuleC.h \
+ TimeModuleC.inl \
+ TimeModuleS.h \
+ TimeModuleS.inl \
+ TimeModuleS_T.h \
+ TimeModuleS_T.inl
+
+TimeServer_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_BiDirGIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/BiDir_CORBALOC/README b/TAO/orbsvcs/tests/BiDir_CORBALOC/README
new file mode 100644
index 00000000000..20bf8b3126c
--- /dev/null
+++ b/TAO/orbsvcs/tests/BiDir_CORBALOC/README
@@ -0,0 +1,14 @@
+/**
+
+@page BiDir_CORBALOC README File
+
+ This is a simple test to use BiDirGIOP to work with any corbaloc
+URL's, such as the naming service. The test is ultra simple trying to
+set BiDir policies and exporting a reference to an object to the name
+service. The fun part is trying to contact the name service using
+corbaloc URL's.
+
+ The test is in the orbsvcs directory because the test uses the
+NameService.
+*/
+ \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/BiDir_CORBALOC/TimeModule.idl b/TAO/orbsvcs/tests/BiDir_CORBALOC/TimeModule.idl
new file mode 100644
index 00000000000..f0a87b1dc8c
--- /dev/null
+++ b/TAO/orbsvcs/tests/BiDir_CORBALOC/TimeModule.idl
@@ -0,0 +1,18 @@
+// $Id$
+module TimeModule {
+
+ struct TimeOfDay {
+ short hour; // 0 - 23
+ short minute; // 0 - 59
+ short second; // 0 - 59
+ };
+
+ interface Time {
+ TimeOfDay get_gmt();
+
+ // Make this a oneway call to allow
+ // the server to shut down immediately.
+ oneway void Shutdown();
+ };
+
+};
diff --git a/TAO/orbsvcs/tests/BiDir_CORBALOC/TimeServer.cpp b/TAO/orbsvcs/tests/BiDir_CORBALOC/TimeServer.cpp
new file mode 100644
index 00000000000..23f3ff6baf8
--- /dev/null
+++ b/TAO/orbsvcs/tests/BiDir_CORBALOC/TimeServer.cpp
@@ -0,0 +1,174 @@
+//$Id$
+#include "TimeModuleS.h"
+#include "tao/BiDir_GIOP/BiDirGIOP.h"
+#include "tao/AnyTypeCode/Any.h"
+#include "tao/Utils/PolicyList_Destroyer.h"
+#include "orbsvcs/CosNamingC.h"
+#include "tao/AnyTypeCode/Any.h"
+
+class Time_impl :
+ public POA_TimeModule::Time
+{
+public:
+ virtual TimeModule::TimeOfDay
+ get_gmt (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void Shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+
+TimeModule::TimeOfDay Time_impl::get_gmt (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ time_t time_now = time(0);
+ struct tm *time_p = gmtime(&time_now);
+
+ TimeModule::TimeOfDay tod;
+
+ tod.hour = time_p->tm_hour;
+ tod.minute = time_p->tm_min;
+ tod.second = time_p->tm_sec;
+
+ return tod;
+}
+
+void
+Time_impl::Shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ exit(0);
+}
+
+int
+main(int argc, char * argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Initialize orb
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get reference to Root POA.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var rootpoa =
+ PortableServer::POA::_narrow (obj.in ());
+
+ // Activate POA manager
+ PortableServer::POAManager_var mgr =
+ rootpoa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var poa;
+
+ TAO::Utils::PolicyList_Destroyer PolicyList (3);
+ PolicyList.length (3);
+
+ PolicyList [0] =
+ rootpoa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PolicyList [1] =
+ rootpoa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any CallbackPolicy;
+ CallbackPolicy <<= BiDirPolicy::BOTH;
+ const char* sServerPoaName = "TelemetryServer";
+
+ PolicyList [2] =
+ orb->create_policy (BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE,
+ CallbackPolicy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa = rootpoa->create_POA (sServerPoaName,
+ mgr.in(),
+ PolicyList
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ PortableServer::ObjectId_var ServerId =
+ PortableServer::string_to_ObjectId ("TimeServer");
+
+ // Create an object
+ Time_impl *time_servant = new Time_impl;
+ PortableServer::ServantBase_var self_manage (time_servant);
+
+ poa->activate_object_with_id (ServerId.in (),
+ time_servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get a reference after activating the object
+ TimeModule::Time_var tm = time_servant->_this();
+
+ // Get reference to initial naming context
+ CORBA::Object_var name_obj =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var inc =
+ CosNaming::NamingContext::_narrow (name_obj.in ());
+
+ if (CORBA::is_nil (inc.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Error fetching naming context \n"));
+ }
+
+ CosNaming::Name service_name;
+ service_name.length(1);
+ service_name[0].id =
+ CORBA::string_dup ("Time");
+
+ inc->rebind (service_name,
+ tm.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the event loop for fun
+ ACE_Time_Value tv (3, 0);
+
+ // Accept requests
+ orb->run (&tv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ rootpoa->destroy (0 , 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught an exception\n");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/BiDir_CORBALOC/run_test.pl b/TAO/orbsvcs/tests/BiDir_CORBALOC/run_test.pl
new file mode 100755
index 00000000000..720926ed809
--- /dev/null
+++ b/TAO/orbsvcs/tests/BiDir_CORBALOC/run_test.pl
@@ -0,0 +1,59 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs some Naming Service tests.
+# It runs all the tests that will run with min CORBA.
+# It starts all the servers and clients as necessary.
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+
+# Variables for command-line arguments to client and server
+# executables.
+$ns_orb_port = 12002 + PerlACE::uniqueid ();
+
+$ior_file = "test.ior";
+
+
+$status = 0;
+
+my $args = "-ORBEndpoint iiop://127.0.0.1:$ns_orb_port -o $ior_file";
+my $prog = "../../Naming_Service/Naming_Service";
+$NS = new PerlACE::Process ($prog, $args);
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ior_file,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$ior_file>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+
+my $new_args = "-ORBInitRef NameService=corbaloc:iiop:127.0.0.1:$ns_orb_port/NameService";
+my $new_prog = "TimeServer";
+
+print " ARGS are == $new_args \n";
+
+$CL = new PerlACE::Process ($new_prog, $new_args);
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+
+$NS->Kill ();
+unlink $ior_file;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_1334_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_1334_Regression/Makefile.am
new file mode 100644
index 00000000000..e583ef1d567
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1334_Regression/Makefile.am
@@ -0,0 +1,43 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Bug_1334_client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_1334_Regression/README b/TAO/orbsvcs/tests/Bug_1334_Regression/README
new file mode 100644
index 00000000000..8a0897a9fce
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1334_Regression/README
@@ -0,0 +1,5 @@
+This test provides regression for Bug 1334.
+
+It tests that a service initial ref IOR can be specified as an environment property in the form <ServiceName>IOR (in this case it is the NameService) and that the value set has correct precedence vis a vis -ORBInitRef values.
+
+See Bug #1334 for more. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_1334_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_1334_Regression/client.cpp
new file mode 100644
index 00000000000..52e3543d1ee
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1334_Regression/client.cpp
@@ -0,0 +1,44 @@
+//
+// $Id$
+//
+#include "tao/corba.h"
+
+// Attempts to resolve the NameService.
+// Returns:
+// 0 if the NameService was resolved
+// 1 if the NameService could not be resolved
+// 2 if something else went wrong
+//
+int main( int argc, char *argv[] )
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, 0 ACE_ENV_ARG_PARAMETER ) ;
+ ACE_TRY_CHECK;
+
+ ACE_TRY_EX (nested)
+ {
+ CORBA::Object_var naming =
+ orb->resolve_initial_references( "NameService" ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK_EX (nested);
+ if( CORBA::is_nil( naming.in() ) )
+ {
+ return 1 ;
+ }
+ }
+ ACE_CATCH (CORBA::Exception, ex)
+ {
+ ACE_UNUSED_ARG (ex);
+ return 1 ;
+ }
+ ACE_ENDTRY;
+ }
+ ACE_CATCH ( CORBA::Exception, ex )
+ {
+ ACE_UNUSED_ARG (ex);
+ return 2 ;
+ }
+ ACE_ENDTRY;
+
+ return 0 ;
+}
diff --git a/TAO/orbsvcs/tests/Bug_1334_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1334_Regression/run_test.pl
new file mode 100755
index 00000000000..7c0ccf966d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1334_Regression/run_test.pl
@@ -0,0 +1,101 @@
+
+# $Id$
+
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# The NameService IOR file
+#
+$nsiorfile = PerlACE::LocalFile("ns.ior");
+unlink $nsiorfile;
+
+# The client process
+#
+$CLIENT = new PerlACE::Process(PerlACE::LocalFile("client"));
+
+# Fire up the Name Service
+#
+$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o $nsiorfile");
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsiorfile, 10) == -1)
+{
+ print STDERR "ERROR: cannot find Name Service IOR file <$nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+
+
+# Try the client with the name service ior in an environment variable of
+# the form <service name>IOR.
+# Expect it to succeed.
+#
+$ENV {'NameServiceIOR'} = "file://$nsiorfile";
+$CLIENT->Arguments("");
+if ($CLIENT->SpawnWaitKill (30) != 0)
+{
+ print STDERR "ERROR: Name Service not resolved by environment variable\n";
+ $server = $NS->TerminateWaitKill (5);
+ if ($server != 0)
+ {
+ print STDERR "ERROR: Closing Name Service returned $server\n";
+ $status = 1;
+ }
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# Now try it with a duff ior in the environment variable.
+# Expect it to fail.
+#
+$ENV {'NameServiceIOR'} = "Banana";
+$CLIENT->Arguments("");
+if ($CLIENT->SpawnWaitKill (30) != 1)
+{
+ print STDERR "ERROR: Name Service resolved with duff environment\n";
+ $server = $NS->TerminateWaitKill (5);
+ if ($server != 0)
+ {
+ print STDERR "ERROR: Closing Name Service returned $server\n";
+ $status = 1;
+ }
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# Now try with a duff ior in the environment variable but overridden by
+# a command line parameter.
+# Expect it to succeed.
+#
+$ENV {'NameServiceIOR'} = "Custard";
+$CLIENT->Arguments("-ORBInitRef NameService=file://$nsiorfile");
+if ($CLIENT->SpawnWaitKill (30) != 0)
+{
+ print STDERR "ERROR: Name Service not resolved by command line override\n";
+ $server = $NS->TerminateWaitKill (5);
+ if ($server != 0)
+ {
+ print STDERR "ERROR: Closing Name Service returned $server\n";
+ $status = 1;
+ }
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# Clean up and return
+#
+$server = $NS->TerminateWaitKill (5);
+if ($server != 0)
+{
+ print STDERR "ERROR: Closing Name Service returned $server\n";
+ $status = 1;
+}
+unlink $nsiorfile;
+
+exit 0;
diff --git a/TAO/orbsvcs/tests/Bug_1334_Regression/test.mpc b/TAO/orbsvcs/tests/Bug_1334_Regression/test.mpc
new file mode 100644
index 00000000000..f256645266b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1334_Regression/test.mpc
@@ -0,0 +1,9 @@
+// -*- MPC -*-
+// $Id$
+
+project(Bug_1334_client) : namingexe {
+ exename = client
+ Source_Files {
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_1393_Regression/Bug_1393_Regression.mpc b/TAO/orbsvcs/tests/Bug_1393_Regression/Bug_1393_Regression.mpc
new file mode 100644
index 00000000000..ecf5bd1deb9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1393_Regression/Bug_1393_Regression.mpc
@@ -0,0 +1,12 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client): taoclient, ifr_client {
+ exename = client
+ IDL_Files {
+ }
+
+ Source_Files {
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_1393_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_1393_Regression/Makefile.am
new file mode 100644
index 00000000000..b0af6b32252
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1393_Regression/Makefile.am
@@ -0,0 +1,41 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Bug_1393_Regression_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ client.cpp
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_1393_Regression/README b/TAO/orbsvcs/tests/Bug_1393_Regression/README
new file mode 100644
index 00000000000..1f95f0d4850
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1393_Regression/README
@@ -0,0 +1,3 @@
+This is the regression test for the fix to Bug #1393.
+
+sm@prismtechnologies.com
diff --git a/TAO/orbsvcs/tests/Bug_1393_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_1393_Regression/client.cpp
new file mode 100644
index 00000000000..bb7e3d1142d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1393_Regression/client.cpp
@@ -0,0 +1,64 @@
+// $Id$
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/ORB.h"
+#include "ace/OS_NS_string.h"
+#include "ace/Log_Msg.h"
+
+int main(int argc, char** argv)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb_ = CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb_->resolve_initial_references ("InterfaceRepository" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Repository_var repo_ = CORBA::Repository::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::ContainedSeq_var interfaces =
+ repo_->contents (CORBA::dk_Interface, // Any type of contained object.
+ 1 // Exclude parents of interfaces.
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong length = interfaces->length ();
+
+ if (length != 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "CLIENT (%P): Incorrect number of elements in IFR - length is %d\n", length));
+ return -1;
+ }
+
+ CORBA::ULong first_one = 0;
+
+ CORBA::InterfaceDef_var the_interface =
+ CORBA::InterfaceDef::_narrow (interfaces[first_one]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var name = the_interface->name();
+
+ if (ACE_OS::strcmp (name.in(), "int"))
+ {
+ ACE_DEBUG ((LM_DEBUG, "CLIENT (%P): Interface name has been munged - it is now %s\n",
+ name.in()));
+ return -1;
+ }
+
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception ...");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl
new file mode 100755
index 00000000000..aefa2879889
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl
@@ -0,0 +1,110 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+# The location of the IFR_Service binary
+$ifr_service_bin = "../../IFR_Service";
+
+# The location of the tao_ifr utility binary
+$tao_ifr_bin = "../../../../bin";
+
+# The location of the tao_idl utility binary
+$tao_idl_bin = "../../../../bin";
+
+# The idl file to be used for the test
+$test_idl = PerlACE::LocalFile("test.idl");
+
+# Create an idl file contaning an interface with a C++ reserved word name
+open(HANDLE, ">$test_idl");
+print HANDLE <<_EOF_
+interface int
+{
+};
+_EOF_
+;
+close(HANDLE);
+
+$TAO_IDL = new PerlACE::Process("$tao_idl_bin/tao_idl");
+$TAO_IDL->Arguments("-Sc $test_idl");
+$result = $TAO_IDL->SpawnWaitKill (30);
+
+# Search one of the stub files for the munged for of the interface name
+if ($result == 0)
+{
+ $result = 1;
+ open (HANDLE, "<testC.h");
+ while (<HANDLE>)
+ {
+ if (/^class\s+_cxx_int/)
+ {
+ $result = 0;
+ last;
+ }
+ }
+ close(HANDLE);
+}
+
+# Check result of idl compiler test
+if ($result != 0)
+{
+ print STDERR "ERROR: Bug #1393 Idl compiler test failed\n";
+ $status = 1;
+}
+
+# Delete files created during IDL compilation
+unlink <test*.h>;
+unlink <test*.cpp>;
+unlink <test*.inl>;
+
+# The file name for the IFR service IOR
+$ifr_service_ior_file = PerlACE::LocalFile("ifr.ior");
+unlink $ifr_service_ior_file;
+
+# Start the IFR service
+$IFR_SERVICE = new PerlACE::Process("$ifr_service_bin/IFR_Service");
+$IFR_SERVICE->Arguments("-o $ifr_service_ior_file");
+$IFR_SERVICE->Spawn();
+
+if (PerlACE::waitforfile_timed ($ifr_service_ior_file, 10) == -1)
+{
+ print STDERR "ERROR: cannot find $ifr_service_ior_file\n";
+ $IFR_SERVICE->Kill ();
+ $status = 1;
+}
+
+# Use the iao_ifr utility to add our test IDL
+$TAO_IFR = new PerlACE::Process("$tao_ifr_bin/tao_ifr");
+$TAO_IFR->Arguments("-ORBInitRef InterfaceRepository=file://$ifr_service_ior_file $test_idl");
+$result = $TAO_IFR->SpawnWaitKill (30);
+
+if ($result != 0)
+{
+ print STDERR "ERROR: Failed to add IDL to interface repository\n";
+ $status = 1;
+}
+
+# Invoke the client code that retrieves the interface and checks it's not munged
+$CLIENT = new PerlACE::Process("client");
+$CLIENT->Arguments("-ORBInitRef InterfaceRepository=file://$ifr_service_ior_file");
+$result = $CLIENT->SpawnWaitKill (30);
+
+if ($result != 0)
+{
+ print STDERR "ERROR: Interface definition incorrect in IFR\n";
+ $status = 1;
+}
+
+# Tidy up
+$IFR_SERVICE->TerminateWaitKill (10);
+unlink $test_idl;
+unlink $ifr_service_ior_file;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/Bug_1395_Regression.mpc b/TAO/orbsvcs/tests/Bug_1395_Regression/Bug_1395_Regression.mpc
new file mode 100644
index 00000000000..91115978acd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/Bug_1395_Regression.mpc
@@ -0,0 +1,37 @@
+// -*- MPC -*-
+// $Id$
+
+project(*IDL): taoidldefaults {
+
+ IDL_Files {
+ Test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*Server): taoserver, imr_client {
+ after += *IDL
+
+ Source_Files {
+ server.cpp
+ Test_i.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, anytypecode {
+ after += *IDL
+
+ Source_Files {
+ client.cpp
+ TestC.cpp
+ }
+
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_1395_Regression/Makefile.am
new file mode 100644
index 00000000000..6057ce638b5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/Makefile.am
@@ -0,0 +1,98 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Bug_1395_Regression_IDL.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.Bug_1395_Regression_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ TestC.cpp \
+ client.cpp \
+ Test_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.Bug_1395_Regression_Server.am
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+server_SOURCES = \
+ TestC.cpp \
+ TestS.cpp \
+ Test_i.cpp \
+ server.cpp \
+ Test_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/README b/TAO/orbsvcs/tests/Bug_1395_Regression/README
new file mode 100644
index 00000000000..d1f531018e3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/README
@@ -0,0 +1,3 @@
+This test contains regression tests for fixes to bugs #1394 and #1395.
+
+See the bugzilla records for these bugs for details. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/Test.idl b/TAO/orbsvcs/tests/Bug_1395_Regression/Test.idl
new file mode 100644
index 00000000000..fff2e17959a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/Test.idl
@@ -0,0 +1,7 @@
+// $Id$
+
+interface Test
+{
+ long try_and_create_POA ();
+ void shutdown();
+};
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp b/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp
new file mode 100644
index 00000000000..dbfcefcb23b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp
@@ -0,0 +1,86 @@
+// $Id$
+
+#include "Test_i.h"
+
+// In case this is a static build we have to force
+// the ImR_Client to be linked.
+#include "tao/ImR_Client/ImR_Client.h"
+
+Test_i::Test_i (CORBA::ORB_ptr orb) :
+ orb_ (CORBA::ORB::_duplicate(orb)),
+ policies_ (1)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Object_var obj =
+ orb_->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->root_poa_ =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policies_.length(1);
+ policies_[0] =
+ root_poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->poa_mgr_ =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception");
+
+ ACE_ASSERT (0); // Force termination!
+ }
+ ACE_ENDTRY;
+}
+
+Test_i::~Test_i (void)
+{
+ this->policies_[0]->destroy ();
+}
+
+int
+Test_i::try_and_create_POA (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableServer::POA_var persistent_poa =
+ root_poa_->create_POA ("MyPoa",
+ poa_mgr_.in (),
+ this->policies_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ // A transient exception exception may be expected,
+ // so we won't print out the word exception but we
+ // will let the user know that a transient exception occurred
+ ACE_DEBUG ((LM_DEBUG,
+ "CORBA::TRANSIENT in Test_i::try_and_create_POA\n"));
+ return 1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "try_and_create_POA Exception ...");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.h b/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.h
new file mode 100644
index 00000000000..6e548f96463
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.h
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+// $Id$
+
+#if !defined BUG_1395_REGRESSION_TEST_I_H
+ #define BUG_1395_REGRESSION_TEST_I_H
+
+#include "tao/PortableServer/PortableServer.h"
+
+#include "TestS.h"
+
+class Test_i: public POA_Test
+{
+public:
+ /// Constructor
+ Test_i (CORBA::ORB_ptr orb);
+
+ /// Destructor
+ ~Test_i (void);
+
+ /// Try and create a persistant POA
+ int try_and_create_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+ PortableServer::POAManager_var poa_mgr_;
+ CORBA::PolicyList policies_;
+};
+
+#endif /* ! BUG_1395_REGRESSION_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_1395_Regression/client.cpp
new file mode 100644
index 00000000000..69909f4e3d5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/client.cpp
@@ -0,0 +1,89 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+
+const char *ior = "file://test.ior";
+int shutdown_server = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ case 's':
+ shutdown_server = 1;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test_var server =
+ Test::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Server reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ if (shutdown_server)
+ {
+ server->shutdown(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ result = server->try_and_create_POA(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ result =1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
new file mode 100755
index 00000000000..75d817be671
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
@@ -0,0 +1,195 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# The location of the implementation repository binaries
+$imr_bin_path = "../../ImplRepo_Service";
+
+# The location of the tao_imr IMR utility
+$tao_imr_bin_path = "../../../../bin";
+
+# IOR file names
+$imr_ior_file = PerlACE::LocalFile("impl.ior");
+$activator_ior_file = PerlACE::LocalFile("activator.ior");
+$server_ior_file = PerlACE::LocalFile("server.ior");
+
+# The players in our little drama.
+$LOCATOR = new PerlACE::Process("$imr_bin_path/ImplRepo_Service");
+$ACTIVATOR = new PerlACE::Process("$imr_bin_path/ImR_Activator");
+$SERVER = new PerlACE::Process(PerlACE::LocalFile("server"));
+$CLIENT = new PerlACE::Process(PerlACE::LocalFile("client"));
+$TAO_IMR = new PerlACE::Process("$tao_imr_bin_path/tao_imr");
+
+# Run the IMR locator on a fixed port
+$port = PerlACE::uniqueid () + 10001; # This can't be 10000 for Chorus 4.0
+
+sub test_body
+{
+ unlink $imr_ior_file;
+ unlink $activator_ior_file;
+ unlink $server_ior_file;
+
+ # Start the IMR locator to generate an IOR file for the server to use...
+ $LOCATOR->Arguments("-o $imr_ior_file -ORBEndpoint iiop://:$port");
+ $LOCATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $imr_ior_file\n";
+ $LOCATOR->Kill ();
+ return 1;
+ }
+
+ # ...then shut it down so that the server will not be able to contact it
+ $LOCATOR->TerminateWaitKill (5);
+
+ if ($imr_locator != 0)
+ {
+ print STDERR "ERROR: IMR returned $imr_locator\n";
+ $status = 1;
+ }
+
+ # Start our server
+ $SERVER->Arguments("-o $server_ior_file -ORBInitRef ImplRepoService=file://$imr_ior_file -ORBUseIMR 1");
+ $SERVER->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($server_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $server_ior_file\n";
+ $ACTIVATOR->Kill ();
+ $LOCATOR->Kill ();
+ $SERVER->Kill ();
+ return 1;
+ }
+
+ # Use the client to ask the server to try and create a persitent POA
+ # We expect this to 'fail' as the IMR is dead
+ $CLIENT->Arguments("-k file://$server_ior_file");
+ $result = $CLIENT->SpawnWaitKill (30);
+
+ if ($result == 0)
+ {
+ print STDERR "ERROR: First create POA attempt succeeded when it shouldn't have done\n";
+ $SERVER->Kill ();
+ return 1;
+ }
+
+ # Now we restart the IMR locator
+ unlink $imr_ior_file;
+ $LOCATOR->Arguments("-o $imr_ior_file -ORBEndpoint iiop://:$port");
+ $LOCATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $imr_ior_file\n";
+ $LOCATOR->Kill ();
+ return 1;
+ }
+
+ # Work out the IMR activator command line.
+ # Use the '-a' switch if this is a regression for bug #1394, else not
+ if ($use_tao_imr_util != 0)
+ {
+ $activator_arguments = "-o $activator_ior_file -ORBInitRef ImplRepoService=file://$imr_ior_file";
+ }
+ else
+ {
+ $activator_arguments = "-o $activator_ior_file -a -ORBInitRef ImplRepoService=file://$imr_ior_file";
+ }
+
+ # Start up the activator
+ $ACTIVATOR->Arguments ($activator_arguments);
+ $ACTIVATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($activator_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $activator_ior_file\n";
+ $ACTIVATOR->Kill ();
+ $LOCATOR->Kill ();
+ return 1;
+ }
+
+ ## Since we have restarted the locator, we need to restart
+ ## the server so that it can pick up the new locator IOR
+ unlink($server_ior_file);
+ $SERVER->Kill ();
+ $SERVER->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($server_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $server_ior_file\n";
+ $ACTIVATOR->Kill ();
+ $LOCATOR->Kill ();
+ $SERVER->Kill ();
+ return 1;
+ }
+
+ # If this is just a regression for bug #1395 we need to register the POA
+ # If it is a regression for enhancement bug #1394, we don't need to.
+ if ($use_tao_imr_util != 0)
+ {
+ # Add the persistent POA name to the IMR
+ $TAO_IMR->Arguments("add MyPoa -ORBInitRef ImplRepoService=file://$imr_ior_file");
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0)
+ {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $ACTIVATOR->Kill ();
+ $LOCATOR->Kill ();
+ return 1;
+ }
+ }
+
+ # Use the client to tell the server to attempt to create the POA again
+ $CLIENT->Arguments("-k file://$server_ior_file");
+ $result = $CLIENT->SpawnWaitKill (30);
+
+ if ($result != 0)
+ {
+ print STDERR "ERROR: Second create POA attempt failed when it should have succeeded\n";
+ $SERVER->Kill ();
+ $ACTIVATOR->Kill ();
+ $LOCATOR->Kill ();
+ return 1;
+ }
+
+ # Tidy up
+ $SERVER->TerminateWaitKill (5);
+ $ACTIVATOR->TerminateWaitKill (5);
+ $LOCATOR->TerminateWaitKill (5);
+ return 0;
+}
+
+# Run regression for bug #1395
+$use_tao_imr_util = 1;
+$test_result = test_body();
+if ($test_result != 0)
+{
+ print STDERR "ERROR: Regression test for Bug #1395 failed\n";
+ unlink $imr_ior_file;
+ unlink $activator_ior_file;
+ unlink $server_ior_file;
+ exit $test_result;
+}
+
+# Bug 1394 is an enhancement so will not be submitted until after TAO1.3.1
+# Uncomment the following to activate regression after submission and ..
+# Run regression for bug #1394
+#$use_tao_imr_util = 0;
+#$test_result = test_body();
+#if ($test_result != 0)
+#{
+# print STDERR "ERROR: Regression test for Bug #1394 failed\n";
+#}
+
+unlink $imr_ior_file;
+unlink $activator_ior_file;
+unlink $server_ior_file;
+exit $test_result;
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_1395_Regression/server.cpp
new file mode 100644
index 00000000000..65c1f4c8a2b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/server.cpp
@@ -0,0 +1,120 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "Test_i.h"
+#include "ace/OS_NS_stdio.h"
+
+const char *ior_output_file = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "SERVER (%P): usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "SERVER (%P): Unable to initialize the POA.\n"),
+ 1);
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Test_i server_impl (orb.in ());
+
+ root_poa->activate_object (&server_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::Object_var server = server_impl._this();
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "SERVER (%P): Cannot open output file "
+ "for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "SERVER (%P): Activated as file://%s\n",
+ ior_output_file));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "SERVER (%P): Activated as <%s>\n",
+ ior.in ()));
+ }
+
+ poa_manager->activate();
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "SERVER (%P): Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_1436_Regression/README b/TAO/orbsvcs/tests/Bug_1436_Regression/README
new file mode 100644
index 00000000000..c0dbdd71810
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1436_Regression/README
@@ -0,0 +1,5 @@
+This test contains regression tests for fixes to bugs #1436
+
+See the bugzilla records for these bugs for details.
+
+gv@prismtechnologies.com
diff --git a/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
new file mode 100755
index 00000000000..a14f27a1a35
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
@@ -0,0 +1,89 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# The location of the implementation repository binaries
+$ifr_bin_path = "../../IFR_Service";
+
+# The location of the tao_ifr IFR utility
+$tao_ifr_bin_path = "../../../../bin";
+
+# IOR file names
+$ifr_ior_file = PerlACE::LocalFile("ifr.ior");
+
+# IDL File
+$idl_file = PerlACE::LocalFile("test.idl");
+
+#Log file
+$result_file = PerlACE::LocalFile("test_result.log");
+
+$IFRSERVICE = new PerlACE::Process("$ifr_bin_path/IFR_Service");
+$TAO_IFR = new PerlACE::Process("$tao_ifr_bin_path/tao_ifr");
+
+sub test_body
+{
+ unlink $ifr_ior_file;
+
+ # Start the IFR Service to generate an IOR file for the tao_ifr to use...
+ $IFRSERVICE->Arguments("-o $ifr_ior_file ");
+ $IFRSERVICE->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($ifr_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $ifr_ior_file\n";
+ $IFRSERVICE->Kill ();
+ return 1;
+ }
+
+ # Redirect STDERR to a log file so that
+ # we can make sure that we got a warning
+ open(SAVEERR, ">&STDERR");
+ open(STDERR, ">$result_file");
+
+ $TAO_IFR->Arguments("-ORBInitRef InterfaceRepository=file://$ifr_ior_file -Cw $idl_file");
+ $TAO_IFR->SpawnWaitKill (30);
+
+ # Close the log file and restore STDERR
+ close(STDERR);
+ open(STDERR, ">&SAVEERR");
+
+ if (! -r $result_file) {
+ print STDERR "ERROR: cannot find $result_file\n";
+ $IFRSERVICE->Kill ();
+ $TAO_IFR->Kill ();
+ return 1;
+ }
+
+ $match = 0;
+ open (FILE, $result_file) or return -1;
+ while (<FILE>) {
+ $match = /Warning - identifier spellings differ only in case:/;
+ last if $match;
+ }
+ close FILE;
+ # Tidy up
+ $IFRSERVICE->TerminateWaitKill (5);
+ return $match ? 0 : -1;
+}
+
+# Run regression for bug #1436
+$test_result = test_body();
+
+if ($test_result != 0)
+{
+ print STDERR "ERROR: Regression test for Bug #1436 failed\n";
+}
+else
+{
+ print "Regression test for Bug #1436 passed.\n";
+}
+
+unlink $ifr_ior_file;
+unlink $result_file;
+exit $test_result;
diff --git a/TAO/orbsvcs/tests/Bug_1436_Regression/test.idl b/TAO/orbsvcs/tests/Bug_1436_Regression/test.idl
new file mode 100644
index 00000000000..28796f76c3c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1436_Regression/test.idl
@@ -0,0 +1,7 @@
+// $Id$
+
+interface test
+{
+ void testme ();
+ void TESTME ();
+};
diff --git a/TAO/orbsvcs/tests/Bug_1437_Regression/README b/TAO/orbsvcs/tests/Bug_1437_Regression/README
new file mode 100644
index 00000000000..69f8256d38c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1437_Regression/README
@@ -0,0 +1,5 @@
+This is the regression test for Bug #1437
+
+Please see Bug Tracker for details on this test.
+
+gv@prismtechnologies.com
diff --git a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
new file mode 100755
index 00000000000..536258b9a52
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
@@ -0,0 +1,107 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# The location of the implementation repository binaries
+$imr_bin_path = "../../ImplRepo_Service";
+
+# The location of the tao_imr IMR utility
+$tao_imr_bin_path = "../../../../bin";
+
+# IOR file names
+$imr_ior_file = PerlACE::LocalFile("impl.ior");
+$activator_ior_file = PerlACE::LocalFile("activator.ior");
+
+# Log file
+$log_file = PerlACE::LocalFile("test_result.log");
+
+# The players in our little drama.
+$LOCATOR = new PerlACE::Process("$imr_bin_path/ImplRepo_Service");
+$ACTIVATOR = new PerlACE::Process("$imr_bin_path/ImR_Activator");
+$TAO_IMR = new PerlACE::Process("$tao_imr_bin_path/tao_imr");
+
+# Run the IMR locator on a fixed port
+$port = PerlACE::uniqueid () + 10001; # This can't be 10000 for Chorus 4.0
+
+sub test_body
+{
+ unlink $imr_ior_file;
+ unlink $activator_ior_file;
+ unlink $log_file;
+
+ # Start the IMR locator to generate an IOR file for the server to use...
+ $LOCATOR->Arguments("-o $imr_ior_file -ORBEndpoint iiop://:$port");
+ $LOCATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $imr_ior_file\n";
+ $LOCATOR->Kill ();
+ return 1;
+ }
+
+ # Set the activator arguments
+ $activator_arguments = "-o $activator_ior_file -ORBInitRef ImplRepoService=file://$imr_ior_file";
+
+ # Start up the activator
+ $ACTIVATOR->Arguments ($activator_arguments);
+ $ACTIVATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($activator_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $activator_ior_file\n";
+ $ACTIVATOR->Kill ();
+ $LOCATOR->Kill ();
+ return 1;
+ }
+
+ # Redirect STDERR to a log file so that the ERROR
+ # message does not get printed to the terminal
+ open(SAVEERR, ">&STDERR");
+ open(STDERR, ">$log_file");
+
+ # Add the illegal persistent POA name to the IMR
+ $TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_ior_file add \"\"");
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ # Close the log file and restore STDERR
+ close(STDERR);
+ open(STDERR, ">&SAVEERR");
+
+ # If the add of an empty string failed, then
+ # the test of the tao_imr succeeded.
+ if ($result != 0) {
+ $result = 0;
+ }
+ else {
+ $result = -1;
+ }
+
+ # Tidy up
+ $ACTIVATOR->TerminateWaitKill (5);
+ $LOCATOR->TerminateWaitKill (5);
+ return $result;
+}
+
+# Run regression for bug #1437
+$test_result = test_body();
+
+if ($test_result != 0)
+{
+ print STDERR "ERROR: Regression test for Bug #1437 failed\n";
+}
+else
+{
+ print "Regression test for Bug #1437 passed.\n";
+}
+unlink $log_file;
+unlink $imr_ior_file;
+unlink $activator_ior_file;
+
+exit $test_result;
diff --git a/TAO/orbsvcs/tests/Bug_1630_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_1630_Regression/Makefile.am
new file mode 100644
index 00000000000..a896cd99666
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1630_Regression/Makefile.am
@@ -0,0 +1,46 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Bug_1630_testclient.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = testclient
+
+testclient_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+testclient_SOURCES = \
+ testclient.cpp
+
+testclient_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_1630_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1630_Regression/run_test.pl
new file mode 100755
index 00000000000..0fa33437ade
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1630_Regression/run_test.pl
@@ -0,0 +1,60 @@
+
+# $Id$
+
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# The IFRService IOR file
+#
+$ifriorfile = PerlACE::LocalFile("ifr.ior");
+unlink $ifriorfile;
+
+# The client process
+#
+$CLIENT = new PerlACE::Process(PerlACE::LocalFile("testclient"));
+
+# Fire up the IFR Service
+#
+$IFR = new PerlACE::Process ("../../IFR_Service/IFR_Service", "-o $ifriorfile");
+$IFR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ifriorfile, 10) == -1)
+{
+ print STDERR "ERROR: cannot find IFR Service IOR file <$ifriorfile>\n";
+ $IFR->Kill (); $IFR->TimedWait (1);
+ exit 1;
+}
+
+
+# Run the client, it should return 0 for success.
+$CLIENT->Arguments("-ORBInitRef InterfaceRepository=file://$ifriorfile");
+if ($CLIENT->SpawnWaitKill (30) != 0)
+{
+ print STDERR "ERROR: test failed\n";
+ $server = $IFR->TerminateWaitKill (5);
+ if ($server != 0)
+ {
+ print STDERR "ERROR: Closing IFR Service returned $server\n";
+ $status = 1;
+ }
+ unlink $ifriorfile;
+ exit 1;
+}
+
+# Clean up and return
+#
+$server = $IFR->TerminateWaitKill (5);
+if ($server != 0)
+{
+ print STDERR "ERROR: Closing IFR Service returned $server\n";
+ $status = 1;
+}
+unlink $ifriorfile;
+
+exit 0;
diff --git a/TAO/orbsvcs/tests/Bug_1630_Regression/test.mpc b/TAO/orbsvcs/tests/Bug_1630_Regression/test.mpc
new file mode 100644
index 00000000000..bb3c6ac0488
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1630_Regression/test.mpc
@@ -0,0 +1,10 @@
+// -*- MPC -*-
+// $Id$
+
+project(Bug_1630_testclient ) : taoclient, anytypecode, minimum_corba, ifr_client {
+ exename = testclient
+
+ Source_Files {
+ testclient.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_1630_Regression/testclient.cpp b/TAO/orbsvcs/tests/Bug_1630_Regression/testclient.cpp
new file mode 100644
index 00000000000..360999cdb28
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_1630_Regression/testclient.cpp
@@ -0,0 +1,240 @@
+//
+// $Id$
+//
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/IFR_Client/IFR_Client_Adapter_Impl.h"
+#include "tao/AnyTypeCode/NVList.h"
+#include "tao/ORB.h"
+#include "ace/OS_NS_string.h"
+
+int main (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_NEW_ENV
+ {
+ int failed = 0;
+
+ // Initialise ORB.
+ //
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Find the Interface Repository.
+ //
+ CORBA::Object_var ifr_obj = orb->resolve_initial_references( "InterfaceRepository" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Repository_var ifr = CORBA::Repository::_narrow( ifr_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if( CORBA::is_nil( ifr.in() ) )
+ {
+ ACE_DEBUG((LM_DEBUG, "Nil IFR reference\n"));
+ return 1;
+ }
+
+ // Add an interface to the repository.
+ //
+ CORBA::InterfaceDefSeq baseInterfaces(1) ;
+ baseInterfaces.length(0) ;
+ CORBA::InterfaceDef_var interface =
+ ifr->create_interface( "IDL:interface865:1.0",
+ "interface865",
+ "1.0",
+ baseInterfaces ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK;
+
+ // Add an operation to the interface.
+ // First get some useful things.
+ //
+ CORBA::PrimitiveDef_var voidPrimitive =
+ ifr->get_primitive( CORBA::pk_void ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK;
+ CORBA::PrimitiveDef_var charPrimitive =
+ ifr->get_primitive( CORBA::pk_char ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK;
+ CORBA::PrimitiveDef_var longPrimitive =
+ ifr->get_primitive( CORBA::pk_long ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK;
+ CORBA::PrimitiveDef_var shortPrimitive =
+ ifr->get_primitive( CORBA::pk_short ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK;
+
+ // The operation has three parameters...
+ //
+ CORBA::ULong numParams = 3 ;
+ CORBA::ParDescriptionSeq parameters( numParams ) ;
+ parameters.length( numParams ) ;
+
+ // ... which are: in char p1...
+ //
+ parameters[0].name = CORBA::string_dup("p1") ;
+ parameters[0].type_def =
+ CORBA::PrimitiveDef::_duplicate( charPrimitive.in() ) ;
+ parameters[0].type = charPrimitive->type() ;
+ parameters[0].mode = CORBA::PARAM_IN ;
+
+ // ...out long p2...
+ //
+ parameters[1].name = CORBA::string_dup("p2") ;
+ parameters[1].type_def =
+ CORBA::PrimitiveDef::_duplicate( longPrimitive.in() ) ;
+ parameters[1].type = longPrimitive->type() ;
+ parameters[1].mode = CORBA::PARAM_OUT ;
+
+ // ...and inout short p3
+ //
+ parameters[2].name = CORBA::string_dup("p3") ;
+ parameters[2].type_def =
+ CORBA::PrimitiveDef::_duplicate( shortPrimitive.in() ) ;
+ parameters[2].type = shortPrimitive->type() ;
+ parameters[2].mode = CORBA::PARAM_INOUT ;
+
+ // ...and no exceptions...
+ //
+ CORBA::ExceptionDefSeq exceptions( 1 ) ;
+ exceptions.length( 0 ) ;
+
+ // ...and no context ids
+ //
+ CORBA::ContextIdSeq contextIds( 1 ) ;
+ contextIds.length( 0 ) ;
+
+ // Create the operation, called "f".
+ //
+ CORBA::OperationDef_var operation =
+ interface->create_operation( "IDL:interface865/f:1.0",
+ "f",
+ "1.0",
+ voidPrimitive.in(),
+ CORBA::OP_NORMAL,
+ parameters,
+ exceptions,
+ contextIds ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK;
+
+
+
+ // Create operation list.
+ //
+ CORBA::NVList_var opList ;
+
+ ACE_DEBUG((LM_DEBUG, "About to call create_operation_list\n"));
+
+ orb->create_operation_list(operation.in (),
+ opList.out()
+ ACE_ENV_ARG_PARAMETER) ;
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Call to create_operation_list succeeded\n"));
+
+ CORBA::ULong count = opList->count() ;
+ ACE_TRY_CHECK;
+
+ if( count != numParams )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed - wrong number of elements n list\n")) ;
+ failed = 1 ;
+ }
+
+ CORBA::NamedValue_ptr nv = opList->item( 0 ) ;
+ if(ACE_OS::strcmp( nv->name(), "p1") != 0 )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 1 wrong name\n"));
+ failed = 1 ;
+ };
+
+ CORBA::Boolean const eq_char =
+ nv->value()->type()->equal (CORBA::_tc_char
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if( !eq_char )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 1 wrong type\n"));
+ failed = 1 ;
+ };
+ if( nv->flags() != CORBA::ARG_IN )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 1 wrong mode\n"));
+ failed = 1 ;
+ };
+
+ nv = opList->item( 1 ) ;
+ if(ACE_OS::strcmp( nv->name(), "p2") != 0 )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 2 wrong name\n"));
+ failed = 1 ;
+ };
+
+ CORBA::Boolean const eq_long =
+ nv->value()->type()->equal (CORBA::_tc_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if( !eq_long )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 2 wrong type\n"));
+ failed = 1 ;
+ };
+ if( nv->flags() != CORBA::ARG_OUT )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 2 wrong mode\n"));
+ failed = 1 ;
+ };
+
+ nv = opList->item( 2 ) ;
+ if(ACE_OS::strcmp( nv->name(), "p3") != 0 )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 3 wrong name\n"));
+ failed = 1 ;
+ };
+
+ CORBA::Boolean const eq_short =
+ nv->value()->type()->equal (CORBA::_tc_short
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if( !eq_short )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 3 wrong type\n"));
+ failed = 1 ;
+ };
+ if( nv->flags() != CORBA::ARG_INOUT )
+ {
+ ACE_DEBUG((LM_DEBUG, "Test failed: param 3 wrong mode\n"));
+ failed = 1 ;
+ };
+
+
+ // opList->free();
+ //operation->destroy();
+
+ // Finally destroy the interface.
+ //
+ interface->destroy(ACE_ENV_SINGLE_ARG_PARAMETER) ;
+
+ //orb->destroy();
+
+ if( failed == 1 )
+ {
+ return 1 ;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception - test failed:\n");
+ return 1;
+ }
+ ACE_CATCHALL
+ {
+ ACE_DEBUG((LM_DEBUG, "An unknown exception occured - test failed\n"));
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN(1);
+
+ return 0 ;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc b/TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc
new file mode 100644
index 00000000000..8bc20a15371
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/Bug_2074_Regression.mpc
@@ -0,0 +1,10 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Test): taoclient, messaging, naming, minimum_corba {
+ exename = test
+ Source_Files {
+ test.cpp
+ ORB_Task.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2074_Regression/Makefile.am
new file mode 100644
index 00000000000..02fa11fa326
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/Makefile.am
@@ -0,0 +1,57 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Bug_2074_Regression_Test.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = test
+
+test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+test_SOURCES = \
+ ORB_Task.cpp \
+ test.cpp \
+ ORB_Task.h
+
+test_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp
new file mode 100644
index 00000000000..41e64a4dd51
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.cpp
@@ -0,0 +1,64 @@
+/**
+ * @file ORB_Task.cpp
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan <coryan@atdesk.com>
+ *
+ */
+#include "ORB_Task.h"
+#include "tao/Messaging/Messaging.h"
+#include "orbsvcs/CosNamingC.h"
+
+ACE_RCSID(Bug_2074_Regression, ORB_Task, "$Id$")
+
+ORB_Task::ORB_Task (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+int
+ORB_Task::svc (void)
+{
+ try
+ {
+ CORBA::Object_var ncRef =
+ orb_->string_to_object(
+ "corbaloc:iiop:10.175.12.99:15025/NameService" );
+
+ CORBA::PolicyList policies;
+
+ TimeBase::TimeT timeout = 5000 * 10000;
+
+ CORBA::Any timeoutAny;
+ timeoutAny <<= timeout;
+
+ policies.length(1);
+ policies[0] = orb_->create_policy(
+ Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
+ timeoutAny );
+
+ CORBA::Object_var object = ncRef->_set_policy_overrides(
+ policies, CORBA::SET_OVERRIDE );
+
+ policies[0]->destroy();
+
+ CosNaming::NamingContext_var namingContext =
+ CosNaming::NamingContext::_narrow( object.in() );
+ namingContext->_non_existent();
+ }
+ catch ( const CORBA::TRANSIENT&)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Caught transient\n"));
+ }
+ catch ( const CORBA::TIMEOUT&)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Caught timeout\n"));
+ }
+ catch ( const CORBA::Exception& e )
+ {
+ ACE_PRINT_EXCEPTION (e, "Exception caught");
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h
new file mode 100644
index 00000000000..cae39cbce9f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/ORB_Task.h
@@ -0,0 +1,25 @@
+#ifndef ORB_Task__h_
+#define ORB_Task__h_
+/**
+ * @file ORB_Task.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen <jwillemsen@remedy.nl>
+ *
+ */
+#include "tao/ORB.h"
+#include "ace/Task.h"
+
+class ORB_Task : public ACE_Task_Base
+{
+public:
+ ORB_Task(CORBA::ORB_ptr orb);
+
+ virtual int svc (void);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif /* ORB_Task__h_ */
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl
new file mode 100755
index 00000000000..dc046a8ace8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl
@@ -0,0 +1,27 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+if (PerlACE::is_vxworks_test()) {
+ $SV = new PerlACE::ProcessVX ("test", "");
+}
+else {
+ $SV = new PerlACE::Process ("test", "");
+}
+
+$SV->Spawn ();
+
+$server = $SV->WaitKill (120);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp b/TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp
new file mode 100644
index 00000000000..915e7419e76
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2074_Regression/test.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "tao/corba.h"
+#include "ORB_Task.h"
+
+int main( int argc, char* argv[] )
+{
+ CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+
+ ORB_Task worker (orb.in ());
+ worker.activate (THR_NEW_LWP | THR_JOINABLE,
+ 10);
+
+ ACE_Time_Value tv (20, 0);
+ orb->run(tv);
+
+ orb->destroy ();
+
+ worker.thr_mgr ()->wait ();
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/Bug_2137_Regression.mpc b/TAO/orbsvcs/tests/Bug_2137_Regression/Bug_2137_Regression.mpc
new file mode 100755
index 00000000000..b357718f9d3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/Bug_2137_Regression.mpc
@@ -0,0 +1,8 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client): taoclient, ftclientorb {
+ Source_Files {
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2137_Regression/Makefile.am
new file mode 100644
index 00000000000..2d5d4b4e89f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/Makefile.am
@@ -0,0 +1,65 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Bug_2137_Regression_Client.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/README b/TAO/orbsvcs/tests/Bug_2137_Regression/README
new file mode 100755
index 00000000000..67181578d9e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/README
@@ -0,0 +1,15 @@
+// $Id$
+
+This test proves that TAOs Fault Tolerant object group equivalence comparison is according to the spec. Any error (assuming the Fault Tolerance orbsvcs library, and all its prerequisites, is available on the test platform) will indicate a regression or some sort of IOR demarshalling problem.
+
+client.cpp ::string_to_object's the pair combinations of the IORs in this directory in a reasonably exhaustive manner and checks that the result of ::is_equivalent matches the expected result as per the spec. All the IORs have a single profile.
+
+Ep1 and Ep2 have an IIOP profile for differing endpoints (same host but port differs) and are not IOGRs (i.e. they have no FT tagged components).
+
+All other IORs are IOGRs, having an IIOP profile corresponding to the endpoint of either Ep1.ior or Ep2.ior, as indicated by the first part of the file name. This profile is set to be the primary and additionally the profile has an FT group tagged component (FT::TagFTGroupTaggedComponent) that contains values as indicated by the following IOR file name values:
+
+d1 / d2 -> group_domain_id == "Domain_1" / group_domain_id == "Domain_2"
+g1 / g2 -> object_group_id == 1 / object_group_id == 2
+v1 / v2 -> object_group_ref_version == 1 / object_group_ref_version == 2
+
+See Bugzilla #2137 for more.
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_2137_Regression/client.cpp
new file mode 100755
index 00000000000..46148e21dee
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/client.cpp
@@ -0,0 +1,312 @@
+// -*- C++ -*-
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+#include "tao/corba.h"
+#include "tao/PI/PI.h"
+
+CORBA::ORB_var orb = CORBA::ORB::_nil ();
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+// Returns false if calling is_equivalent in both directions on the two supplied
+// IORs does not produce expected result.
+CORBA::Boolean
+check_is_equivalent (const char* ior1, const char * ior2, CORBA::Boolean expected_result)
+{
+ CORBA::Boolean result = 1;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var object1 =
+ orb->string_to_object(ior1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object2 =
+ orb->string_to_object (ior2 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const char* expected_result_string = (expected_result ? "true" : "false");
+
+ if ((object1->_is_equivalent (object2.in ())) != expected_result)
+ {
+ ACE_DEBUG ((LM_ERROR, "Error: Result of <%s>->_is_equivalent (<%s>) is not %s when it should be...\n",
+ ior1, ior2, expected_result_string));
+ result = 0;
+ }
+
+ if ((object2->_is_equivalent (object1.in ())) != expected_result)
+ {
+ ACE_DEBUG ((LM_ERROR, "Error: Result of <%s>->_is_equivalent (<%s>) is not %s when it should be...\n",
+ ior2, ior1, expected_result_string));
+ result = 0;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_ERROR, "Vastly unexpected exception comparing %s and %s:\n", ior1, ior2));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception:");
+ result = 0;
+ }
+ ACE_ENDTRY;
+ return result;
+}
+
+int
+main (int argc, char *argv[])
+{
+ CORBA::Boolean result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // ep1 is equivalent to no other IORs - it is not an IOGR, and ep2 is a different endpoint.
+ // The next nine should all be false.
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep1_d1_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep1_d1_g1_v2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep1_d1_g2_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep1_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because these are IORs with different endpoints.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep2_d1_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep2_d1_g1_v2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep1_d1_g2_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1.ior", "file://ep1_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep1_d1_g1_v2.ior", 1))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be true because both are IOGRs and the domain and group ids match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep1_d1_g2_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep1_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep2_d1_g1_v1.ior", 1))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be true because both are IOGRs and the domain and group ids match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep2_d1_g1_v2.ior", 1))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be true because both are IOGRs and the domain and group ids match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep2_d1_g2_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v1.ior", "file://ep2_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v2.ior", "file://ep1_d1_g2_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v2.ior", "file://ep1_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v2.ior", "file://ep2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v2.ior", "file://ep2_d1_g1_v1.ior", 1))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be true because both are IOGRs and the domain and group ids match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v2.ior", "file://ep2_d1_g1_v2.ior", 1))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be true because both are IOGRs and the domain and group ids match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v2.ior", "file://ep2_d1_g2_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g1_v2.ior", "file://ep2_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g2_v1.ior", "file://ep1_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g2_v1.ior", "file://ep2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g2_v1.ior", "file://ep2_d1_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g2_v1.ior", "file://ep2_d1_g1_v2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g2_v1.ior", "file://ep2_d1_g2_v1.ior", 1))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be true because both are IOGRs and the domain and group ids match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d1_g2_v1.ior", "file://ep2_d2_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d2_g1_v1.ior", "file://ep2.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because an IOR is never equivalent to an IOGR\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d2_g1_v1.ior", "file://ep2_d1_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d2_g1_v1.ior", "file://ep2_d1_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d2_g1_v1.ior", "file://ep2_d1_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ if (! check_is_equivalent ("file://ep1_d2_g1_v1.ior", "file://ep2_d1_g1_v1.ior", 0))
+ {
+ ACE_DEBUG ((LM_ERROR, "... it should be false because both are IOGRs but the domain and group ids don't match.\n\n"));
+ result = 1;
+ }
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep1.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1.ior
new file mode 100755
index 00000000000..c5cef0a821a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e300000010000000000000080000000010102cd0d0000003231332e34382e39312e343500cd30083300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd02000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd01000100000000000901010000000000 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v1.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v1.ior
new file mode 100755
index 00000000000..61b660bd170
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v1.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cd30083300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3100cdcdcdcdcdcdcd0100000000000000010000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v2.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v2.ior
new file mode 100755
index 00000000000..67ac3da96f9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g1_v2.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cd30083300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3100cdcdcdcdcdcdcd0100000000000000020000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g2_v1.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g2_v1.ior
new file mode 100755
index 00000000000..8c81850cfad
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d1_g2_v1.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cd30083300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3100cdcdcdcdcdcdcd0200000000000000010000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d2_g1_v1.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d2_g1_v1.ior
new file mode 100755
index 00000000000..e8768bfcbaa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep1_d2_g1_v1.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cd30083300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3200cdcdcdcdcdcdcd0100000000000000010000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep2.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2.ior
new file mode 100755
index 00000000000..e6aaf10387d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e300000010000000000000080000000010102cd0d0000003231332e34382e39312e343500cde7063300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd02000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd01000100000000000901010000000000 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v1.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v1.ior
new file mode 100755
index 00000000000..5df5438dedc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v1.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cde7063300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3100cdcdcdcdcdcdcd0100000000000000010000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v2.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v2.ior
new file mode 100755
index 00000000000..a1c3e447fcd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g1_v2.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cde7063300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3100cdcdcdcdcdcdcd0100000000000000020000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g2_v1.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g2_v1.ior
new file mode 100755
index 00000000000..6ec08959fb1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d1_g2_v1.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cde7063300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3100cdcdcdcdcdcdcd0200000000000000010000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d2_g1_v1.ior b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d2_g1_v1.ior
new file mode 100755
index 00000000000..7e16895b241
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/ep2_d2_g1_v1.ior
@@ -0,0 +1 @@
+IOR:010000001300000049444c3a546573742f48656c6c6f3a312e3000000100000000000000b6000000010102cd0d0000003231332e34382e39312e343500cde7063300000014010f004e5550000000170000000001000000526f6f74504f41006d795f706f610000000000010000007365727665725f6964cd04000000000000000800000001cdcdcd004f4154010000001400000001cdcdcd010001000000000009010100000000001b00000024000000010100cd09000000446f6d61696e5f3200cdcdcdcdcdcdcd0100000000000000010000001c000000020000000101 \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Bug_2137_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2137_Regression/run_test.pl
new file mode 100755
index 00000000000..78eb7b2641e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2137_Regression/run_test.pl
@@ -0,0 +1,34 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+print STDERR "\n\n==== Running Bug_2137_Regression (FT ::is_equivalent) test\n";
+
+if (PerlACE::is_vxworks_test())
+{
+ $T = new PerlACE::ProcessVX ("client");
+}
+else
+{
+ $T = new PerlACE::Process ("client");
+}
+
+$test = $T->SpawnWaitKill (15);
+
+if ($test != 0)
+{
+ print STDERR "ERROR: Bug_2137_Regression test returned $test\n";
+ exit 1;
+}
+else
+{
+ print STDERR "SUCCESS: Bug_2137_Regression test returned $test\n";
+}
+
+exit 0;
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/Bug_2247_Regression.mpc b/TAO/orbsvcs/tests/Bug_2247_Regression/Bug_2247_Regression.mpc
new file mode 100755
index 00000000000..cfeafb2ed12
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/Bug_2247_Regression.mpc
@@ -0,0 +1,32 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*server): portableserver, orbsvcsexe, iormanip, messaging, minimum_corba {
+ after += *idl
+ Source_Files {
+ test_i.cpp
+ testS.cpp
+ testC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Manager): portableserver, orbsvcsexe, iormanip, ftorb, minimum_corba {
+ after += *idl
+ Source_Files {
+ testC.cpp
+ Manager.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/Client_i.h b/TAO/orbsvcs/tests/Bug_2247_Regression/Client_i.h
new file mode 100755
index 00000000000..50efe0c1099
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/Client_i.h
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef BUG_2247_REGRESSION_CLIENT_I_H
+#define BUG_2247_REGRESSION_CLIENT_I_H
+
+#include /**/ "ace/pre.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Client_i
+{
+public:
+ Client_i (CORBA::ORB_ptr orb);
+ // Our constructor
+
+ int init (ACE_ENV_SINGLE_ARG_DECL);
+ // Initialize the ORB etc.
+
+private:
+ CORBA::ORB_var orb_;
+
+};
+
+#include /**/ "ace/post.h"
+#endif /* BUG_2247_REGRESSION_CLIENT_I_H */
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2247_Regression/Makefile.am
new file mode 100644
index 00000000000..c495afa40c1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/Makefile.am
@@ -0,0 +1,136 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Bug_2247_Regression_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.Bug_2247_Regression_Manager.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Manager
+
+Manager_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Manager_SOURCES = \
+ Manager.cpp \
+ testC.cpp \
+ Manager.h
+
+Manager_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.Bug_2247_Regression_Server.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+server_SOURCES = \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ test_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/Manager.cpp b/TAO/orbsvcs/tests/Bug_2247_Regression/Manager.cpp
new file mode 100755
index 00000000000..74d54ebda92
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/Manager.cpp
@@ -0,0 +1,629 @@
+// $Id$
+#include "Manager.h"
+#include "Client_i.h"
+#include "testC.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_fcntl.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "ace/OS_NS_stdio.h"
+
+// Files which have the IOR
+const char *first_ior = 0;
+const char *first_key = 0;
+const char *second_ior = 0;
+const char *second_key = 0;
+const char *ior_output_file = 0;
+int shutdown_test = 0;
+int merged_test = 0;
+
+// Objects
+CORBA::Object_var object_primary = 0;
+CORBA::Object_var object_secondary = 0;
+
+// Reference to the IOR manipulator
+TAO_IOP::TAO_IOR_Manipulation_var iorm = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "a:k:b:l:c:sm");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'a':
+ first_ior = get_opts.opt_arg ();
+ break;
+ case 'k':
+ first_key = get_opts.opt_arg ();
+ break;
+ case 'b':
+ second_ior = get_opts.opt_arg ();
+ break;
+ case 'l':
+ second_key = get_opts.opt_arg ();
+ break;
+ case 'c':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 's':
+ shutdown_test = 1;
+ break;
+ case 'm':
+ merged_test = 1;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-a <iorfile1> -k <key1> "
+ "-b <iorfile2> -l <key2> "
+ "-c <output ior file>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+int
+main (int argc,
+ char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ Manager manager;
+
+ ACE_TRY
+ {
+ // Initilaize the ORB, POA etc.
+ manager.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // the command line arguments
+ if (parse_args (argc, argv) == -1)
+ return -1;
+
+ // Merge the different IORS
+ manager.make_merged_iors (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (merged_test)
+ {
+ // Set properties. This is the most important portion of the
+ // test
+ manager.set_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Write IOR to file
+ manager.write_to_file ();
+
+ // Client, who is going to use the merged IOR
+ // Construct that with the managers ORB
+ Client_i client_imp (manager.orb ());
+ return client_imp.init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Manager::Manager (void)
+ :orb_ (0),
+ merged_set_ (0)
+{
+ //no-op
+}
+
+void
+Manager::init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain the RootPOA.
+ CORBA::Object_var obj_var =
+ this->orb_->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa_var =
+ PortableServer::POA::_narrow (obj_var.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get the POAManager of the RootPOA.
+ PortableServer::POAManager_var poa_manager_var =
+ root_poa_var->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager_var->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Manager::make_merged_iors (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // First server
+ object_primary =
+ this->orb_->string_to_object (first_ior
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (merged_test)
+ {
+ //Second server
+ object_secondary =
+ this->orb_->string_to_object (second_ior
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Get an object reference for the ORBs IORManipultion object!
+ CORBA::Object_var IORM =
+ this->orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (2);
+ iors.length(2);
+ iors [0] = CORBA::Object::_duplicate (object_primary.in ());
+ iors [1] = CORBA::Object::_duplicate (object_secondary.in ());
+
+ // Create a merged set 1;
+ merged_set_ =
+ iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ merged_set_ = object_primary;
+ }
+
+ return 0;
+}
+
+int
+Manager::set_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ const char *id = "iogr_testing";
+ ft_tag_component.group_domain_id = id;
+
+ // Object group id
+ ft_tag_component.object_group_id =
+ (CORBA::ULongLong) 10;
+
+ // Version
+ ft_tag_component.object_group_ref_version =
+ (CORBA::ULong) 5;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property
+ CORBA::Boolean retval = iorm->set_primary (&iogr_prop,
+ object_secondary.in (),
+ this->merged_set_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Set the primary
+ // See we are setting the second ior as the primary
+ if (retval != 0)
+ {
+ retval = iorm->set_property (&iogr_prop,
+ this->merged_set_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+int
+Manager::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Error in run \n"),
+ -1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Manager::write_to_file (void)
+{
+ //
+ CORBA::String_var iorref =
+ this->orb_->object_to_string (this->merged_set_.in ());
+
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", iorref.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ return 0;
+}
+
+CORBA::ORB_ptr
+Manager::orb (void)
+{
+ return this->orb_.in ();
+}
+
+Client_i::Client_i (CORBA::ORB_ptr orb)
+ :orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+int run_remote_test (Simple_Server_ptr server, const char* execute_key)
+{
+ char expected[1024], received[1024];
+ if (execute_key)
+ {
+ ACE_OS::sprintf (expected,
+ "remote_call() completed by %s", execute_key);
+ }
+ else if (shutdown_test && !merged_test)
+ {
+ ACE_OS::strcpy (expected, "CORBA::COMM_FAILURE");
+ }
+ else
+ {
+ ACE_OS::strcpy (expected, "CORBA::TRANSIENT");
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ // Make a remote call
+ CORBA::String_var s =
+ server->remote_call (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!s.in())
+ {
+ ACE_OS::strcpy (received, "(null)");
+ }
+ else
+ {
+ ACE_OS::strcpy (received, s.in());
+ }
+ }
+ ACE_CATCH (CORBA::TRANSIENT, et)
+ {
+ ACE_OS::strcpy (received, "CORBA::TRANSIENT");
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, ec)
+ {
+ ACE_OS::strcpy (received, "CORBA::COMM_FAILURE");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("CLIENT> REMOTE expected: '%s'"),
+ expected));
+
+ if (ACE_OS::strcmp (expected, received))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("... FAIL\n"
+ "CLIENT> received: '%s'\n"),
+ received));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("... OK\n")));
+ return 0;
+}
+
+int run_abort_test (Simple_Server_ptr server,
+ const char* request_key, const char* execute_key)
+{
+ char expected[1024], received[1024];
+ if (execute_key)
+ {
+ ACE_OS::sprintf (expected,
+ "abort() completed by %s, still_alive=1",
+ execute_key);
+ }
+ else if (merged_test)
+ {
+ ACE_OS::strcpy (expected, "CORBA::TRANSIENT");
+ }
+ else
+ {
+ ACE_OS::strcpy (expected, "CORBA::COMM_FAILURE");
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::String_var s = server->abort (request_key);
+ ACE_TRY_CHECK;
+
+ if (!s.in())
+ {
+ ACE_OS::strcpy (received, "(null)");
+ }
+ else
+ {
+ ACE_OS::strcpy (received, s.in());
+ }
+ }
+ ACE_CATCH (CORBA::TRANSIENT, et)
+ {
+ ACE_OS::strcpy (received, "CORBA::TRANSIENT");
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, ec)
+ {
+ ACE_OS::strcpy (received, "CORBA::COMM_FAILURE");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("CLIENT> ABORT expected: '%s'"),
+ expected));
+ if (ACE_OS::strcmp (expected, received))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("... FAIL\n"
+ "CLIENT> received: '%s'\n"),
+ received));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("... OK\n")));
+ return 0;
+}
+
+int run_shutdown_test (Simple_Server_ptr server,
+ const char* request_key, const char* execute_key)
+{
+ char expected[1024], received[1024];
+ if (execute_key)
+ {
+ ACE_OS::sprintf (expected,
+ "shutdown() completed by %s, still_alive=0",
+ execute_key);
+ }
+ else
+ {
+ ACE_OS::strcpy (expected, "CORBA::TRANSIENT");
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::String_var s = server->shutdown (request_key);
+ ACE_TRY_CHECK;
+
+ if (!s.in())
+ {
+ ACE_OS::strcpy (received, "(null)");
+ }
+ else
+ {
+ ACE_OS::strcpy (received, s.in());
+ }
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ ACE_OS::strcpy (received, "CORBA::TRANSIENT");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("CLIENT> SHUTDOWN expected: '%s'"),
+ expected));
+ if (ACE_OS::strcmp (expected, received))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("... FAIL\n"
+ "CLIENT> received: '%s'\n"),
+ received));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("... OK\n")));
+ return 0;
+}
+
+int run_full_abort_test (Simple_Server_ptr server)
+{
+ int rv = run_remote_test (server, second_key);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_abort_test (server, second_key, first_key);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_remote_test (server, first_key);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_abort_test (server, first_key, 0);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_remote_test (server, 0);
+ if (rv)
+ {
+ return rv;
+ }
+
+ return 0;
+}
+
+int run_full_shutdown_test (Simple_Server_ptr server)
+{
+ int rv = run_remote_test (server, second_key);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_shutdown_test (server, second_key, second_key);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_remote_test (server, first_key);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_shutdown_test (server, first_key, first_key);
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_remote_test (server, 0);
+ if (rv)
+ {
+ return rv;
+ }
+
+ return 0;
+}
+
+int
+Client_i::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Open the file for reading.
+ ACE_HANDLE f_handle = ACE_OS::open (ior_output_file,
+ 0);
+
+ if (f_handle == ACE_INVALID_HANDLE)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ ior_output_file));
+
+ ACE_Read_Buffer ior_buffer (f_handle);
+
+ char *data = ior_buffer.read ();
+
+ if (data == 0)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to read ior: %p\n"));
+
+
+ int argc = 0;
+ char **argv = 0;
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var object =
+ this->orb_->string_to_object (data
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Combined IOR stuff
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ data));
+ }
+
+ int rv;
+ if (!merged_test)
+ {
+ if (shutdown_test)
+ {
+ rv = run_shutdown_test (server.in(), first_key, first_key);
+ }
+ else
+ {
+ rv = run_abort_test (server.in(), first_key, 0);
+ }
+
+ if (!rv)
+ {
+ rv = run_remote_test (server.in(), 0);
+ }
+ }
+ else if (shutdown_test)
+ {
+ rv = run_full_shutdown_test (server.in ());
+ }
+ else
+ {
+ rv = run_full_abort_test (server.in ());
+ }
+
+ ior_buffer.alloc ()->free (data);
+ ACE_OS::close (f_handle);
+ return rv;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/Manager.h b/TAO/orbsvcs/tests/Bug_2247_Regression/Manager.h
new file mode 100755
index 00000000000..81760e158f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/Manager.h
@@ -0,0 +1,50 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef BUG_2247_REGRESSION_MANAGER_H
+#define BUG_2247_REGRESSION_MANAGER_H
+
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Object.h"
+
+class Manager
+{
+public:
+
+ Manager (void);
+ // Ctor
+
+ void init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL);
+
+ // Initialize the ORB, POA etc.
+
+ int make_merged_iors (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Merges the different IORS
+
+ int set_properties (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Sets the properties for the profiles
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the ORB event loop..
+
+ int write_to_file (void);
+ // Write the merged IOR to a file
+
+ CORBA::ORB_ptr orb (void);
+ // Return the pointer to the copy of our ORB
+private:
+ CORBA::ORB_var orb_;
+ // Our ORB
+
+ CORBA::Object_var merged_set_;
+ // The merged IOR set
+};
+
+#endif /* BUG_2247_REGRESSION_MANAGER_H */
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/README b/TAO/orbsvcs/tests/Bug_2247_Regression/README
new file mode 100755
index 00000000000..b2cda70e18d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/README
@@ -0,0 +1,31 @@
+// $Id$
+
+This program tests the behavior of FT aware client when there
+is a fault in the server.
+
+First, you can test the behavior of client when it works with
+a simple single profile IOR (not IOGR).
+
+To test server crashing down (aborting) in the middle of the RPC:
+$./server -o file1.ior -k KEY1
+$./Manager -a file://file1.ior -k KEY1 -c g.ior
+
+To test server gracefully shutting down in the middle of the RPC:
+$./server -o file1.ior -k KEY1
+$./Manager -a file://file1.ior -k KEY1 -c g.ior -s
+
+You can also test behavior of client when using IOGR with two servers
+by supplying -g as the option to Manager.
+
+To test servers crashing down (aborting) in the middle of the RPC:
+$./server -o file1.ior -k KEY1
+$./server -o file2.ior -k KEY2
+$./Manager -a file://file1.ior -k KEY1 -b file://file2.ior -l KEY2 -c g.ior -g
+
+To test one of two serversshutting down in the middle of the RPC:
+$./server -o file1.ior -k KEY1
+$./server -o file2.ior -k KEY2
+$./Manager -a file://file1.ior -k KEY1 -b file://file2.ior -l KEY2 -c g.ior -g -s
+
+The complete test can be run by run_test.pl.
+The script exits with error code != 0 in case of error.
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2247_Regression/run_test.pl
new file mode 100755
index 00000000000..64addd90090
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/run_test.pl
@@ -0,0 +1,142 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$file1ior = PerlACE::LocalFile ("file1.ior");
+$file2ior = PerlACE::LocalFile ("file2.ior");
+$outputior = PerlACE::LocalFile ("output.ior");
+
+unlink $file1ior, $file2ior, $outputior;
+
+$SERV1 = new PerlACE::Process ("server", "-o $file1ior -k KEY1");
+$SERV2 = new PerlACE::Process ("server", "-o $file2ior -k KEY2");
+$MANAGER_00 = new PerlACE::Process ("Manager", "-a file://$file1ior -k KEY1 -b file://$file2ior -l KEY2 -c $outputior");
+$MANAGER_01 = new PerlACE::Process ("Manager", "-a file://$file1ior -k KEY1 -b file://$file2ior -l KEY2 -c $outputior -s");
+$MANAGER_10 = new PerlACE::Process ("Manager", "-a file://$file1ior -k KEY1 -b file://$file2ior -l KEY2 -c $outputior -m");
+$MANAGER_11 = new PerlACE::Process ("Manager", "-a file://$file1ior -k KEY1 -b file://$file2ior -l KEY2 -c $outputior -m -s");
+
+# ---------------
+print STDERR "Starting ABORT test\n";
+
+print STDERR "Starting Server 1\n";
+$SERV1->Spawn ();
+if (PerlACE::waitforfile_timed ($file1ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file1ior>\n";
+ $SERV1->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting ABORT Manager\n";
+$MANAGER_00->Spawn ();
+$manager = $MANAGER_00->WaitKill (30);
+
+$SERV1->WaitKill(5);
+
+if ($manager != 0) {
+ print STDERR "ERROR: Manager returned $manager\n";
+ ++ $status;
+}
+
+unlink $file1ior, $outputior;
+
+# ---------------
+print STDERR "Starting SHUTDOWN test\n";
+
+print STDERR "Starting Server 1\n";
+$SERV1->Spawn ();
+if (PerlACE::waitforfile_timed ($file1ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file1ior>\n";
+ $SERV1->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting SHUTDOWN Manager\n";
+$MANAGER_01->Spawn ();
+$manager = $MANAGER_01->WaitKill (30);
+
+$SERV1->WaitKill(5);
+
+if ($manager != 0) {
+ print STDERR "ERROR: Manager returned $manager\n";
+ ++ $status;
+}
+
+unlink $file1ior, $outputior;
+
+# ---------------
+print STDERR "Starting MERGED ABORT test\n";
+
+print STDERR "Starting Server 1\n";
+$SERV1->Spawn ();
+if (PerlACE::waitforfile_timed ($file1ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file1ior>\n";
+ $SERV1->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Server 2\n";
+$SERV2->Spawn ();
+if (PerlACE::waitforfile_timed ($file2ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file2ior>\n";
+ $SERV1->Kill ();
+ $SERV2->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting ABORT Manager\n";
+$MANAGER_10->Spawn ();
+$manager = $MANAGER_10->WaitKill (30);
+
+$SERV1->WaitKill(5);
+$SERV2->WaitKill(5);
+
+if ($manager != 0) {
+ print STDERR "ERROR: Manager returned $manager\n";
+ ++ $status;
+}
+
+unlink $file1ior, $file2ior, $outputior;
+
+# ---------------
+print STDERR "Starting MERGED SHUTDOWN test\n";
+
+print STDERR "Starting Server 1\n";
+$SERV1->Spawn ();
+if (PerlACE::waitforfile_timed ($file1ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file1ior>\n";
+ $SERV1->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Server 2\n";
+$SERV2->Spawn ();
+if (PerlACE::waitforfile_timed ($file2ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file2ior>\n";
+ $SERV1->Kill ();
+ $SERV2->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting SHUTDOWN Manager\n";
+$MANAGER_11->Spawn ();
+$manager = $MANAGER_11->WaitKill (30);
+
+$SERV1->WaitKill(5);
+$SERV2->WaitKill(5);
+
+if ($manager != 0) {
+ print STDERR "ERROR: Manager returned $manager\n";
+ ++ $status;
+}
+
+unlink $file1ior, $file2ior, $outputior;
+
+exit $status
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_2247_Regression/server.cpp
new file mode 100755
index 00000000000..d597ec0d27d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/server.cpp
@@ -0,0 +1,136 @@
+// $Id$
+
+#include "test_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+const char *ior_output_file = 0;
+const char *key = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'k':
+ key = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "-k <key>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We do the command line parsing first
+ if (parse_args (argc, argv) != 0)
+ return 1;
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList policies;
+ policies.length (3);
+ policies[0] = root_poa->create_id_assignment_policy (
+ PortableServer::USER_ID ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policies[1] = root_poa->create_implicit_activation_policy (
+ PortableServer::NO_IMPLICIT_ACTIVATION ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policies[2] = root_poa->create_lifespan_policy (
+ PortableServer::PERSISTENT ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var poa = root_poa->create_POA (
+ "PERS_POA", poa_manager.in (), policies ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Instantiate the LCD_Display implementation class
+ Simple_Server_i display_impl (orb.in (), key);
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("IOGR_OID");
+
+ poa->activate_object_with_id (id.in(), &display_impl ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var server =
+ poa->id_to_reference (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run ();
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/test.idl b/TAO/orbsvcs/tests/Bug_2247_Regression/test.idl
new file mode 100755
index 00000000000..ecca7fffd42
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/test.idl
@@ -0,0 +1,10 @@
+/*
+ * $Id$
+ */
+
+interface Simple_Server
+{
+ string remote_call ();
+ string shutdown (in string ior_file);
+ string abort (in string ior_file);
+};
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/test_i.cpp b/TAO/orbsvcs/tests/Bug_2247_Regression/test_i.cpp
new file mode 100755
index 00000000000..6264149b61e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/test_i.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "test_i.h"
+
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb, const char* key)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , _key (CORBA::string_dup (key))
+{
+}
+
+Simple_Server_i::Simple_Server_i (void)
+ : orb_ (0)
+{
+ // no-op
+}
+
+char*
+Simple_Server_i::remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> executing remote_call()\n", _key.in()));
+
+ char buf[256];
+ ACE_OS::sprintf (buf, "remote_call() completed by %s", _key.in());
+
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> returning '%s'\n", _key.in(), buf));
+ return CORBA::string_dup (buf);
+}
+
+
+char*
+Simple_Server_i::shutdown (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> executing shutdown()\n", _key.in()));
+
+ int still_alive = 1;
+ if (!ACE_OS::strcmp (_key.in(), key))
+ {
+ this->orb_->shutdown (0);
+ still_alive = 0;
+ }
+
+ char buf[256];
+ ACE_OS::sprintf (buf, "shutdown() completed by %s, still_alive=%d",
+ _key.in(), still_alive);
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> returning '%s'\n", _key.in(), buf));
+ return CORBA::string_dup (buf);
+}
+
+char*
+Simple_Server_i::abort (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> executing abort()\n", _key.in()));
+ int still_alive = 1;
+ if (!ACE_OS::strcmp (_key.in(), key))
+ {
+ ACE_OS::abort();
+ still_alive = 0;
+ }
+
+ char buf[256];
+ ACE_OS::sprintf (buf, "abort() completed by %s, still_alive=%d",
+ _key.in(), still_alive);
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> returning '%s'\n", _key.in(), buf));
+ return CORBA::string_dup (buf);
+}
diff --git a/TAO/orbsvcs/tests/Bug_2247_Regression/test_i.h b/TAO/orbsvcs/tests/Bug_2247_Regression/test_i.h
new file mode 100755
index 00000000000..f00ae655410
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2247_Regression/test_i.h
@@ -0,0 +1,38 @@
+// $Id$
+
+#ifndef BUG_2247_REGRESSION_TEST_I_H
+#define BUG_2247_REGRESSION_TEST_I_H
+
+#include "testS.h"
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb, const char* key);
+ // ctor
+
+ Simple_Server_i (void);
+ // ctor
+
+ // = The Simple_Server methods.
+ char* remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char* shutdown (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char* abort (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+ CORBA::String_var _key;
+};
+
+#endif /* BUG_2247_REGRESSION_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/Bug_2248_Regression.mpc b/TAO/orbsvcs/tests/Bug_2248_Regression/Bug_2248_Regression.mpc
new file mode 100755
index 00000000000..b3ba87fb27c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/Bug_2248_Regression.mpc
@@ -0,0 +1,43 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ idlflags += -Sc
+
+ IDL_Files {
+ test.idl
+ tests.idl
+ }
+
+ custom_only = 1
+}
+
+project(*Server): taoserver, orbsvcsexe, iormanip, pi_server, ftorb, messaging, minimum_corba {
+ after += *idl
+
+ Source_Files {
+ test_i.cpp
+ testC.cpp
+ testS.cpp
+ testsC.cpp
+ testsS.cpp
+ Server_ORBInitializer.cpp
+ Server_Request_Interceptor.cpp
+ server.cpp
+ }
+
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, orbsvcsexe, iormanip, pi_server, ftorb, minimum_corba {
+ after += *idl
+
+ Source_Files {
+ testC.cpp
+ client.cpp
+ }
+
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/Client_i.h b/TAO/orbsvcs/tests/Bug_2248_Regression/Client_i.h
new file mode 100755
index 00000000000..b4eb64b13e5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/Client_i.h
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = FILENAME
+// Client_i.h
+//
+// = DESCRIPTION
+// A helper class for the client
+//
+// ============================================================================
+
+#ifndef BUG_2248_REGRESSION_CLIENT_I_H
+#define BUG_2248_REGRESSION_CLIENT_I_H
+
+#include /**/ "ace/pre.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Client_i
+{
+public:
+ Client_i (CORBA::ORB_ptr orb);
+ // Our constructor
+
+ int init (ACE_ENV_SINGLE_ARG_DECL);
+ // Initialize the ORB etc.
+
+private:
+ CORBA::ORB_var orb_;
+
+};
+
+#include /**/ "ace/post.h"
+#endif /* BUG_2248_REGRESSION_CLIENT_I_H*/
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2248_Regression/Makefile.am
new file mode 100644
index 00000000000..244772c3c63
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/Makefile.am
@@ -0,0 +1,180 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Bug_2248_Regression_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St -Sc $(srcdir)/test.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ testsC.cpp \
+ testsC.h \
+ testsC.inl \
+ testsS.cpp \
+ testsS.h \
+ testsS.inl
+
+CLEANFILES += \
+ tests-stamp \
+ testsC.cpp \
+ testsC.h \
+ testsC.inl \
+ testsS.cpp \
+ testsS.h \
+ testsS.inl
+
+testsC.cpp testsC.h testsC.inl testsS.cpp testsS.h testsS.inl: tests-stamp
+
+tests-stamp: $(srcdir)/tests.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St -Sc $(srcdir)/tests.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl \
+ tests.idl
+
+## Makefile.Bug_2248_Regression_Client.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp \
+ testC.cpp \
+ client.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.Bug_2248_Regression_Server.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ Server_ORBInitializer.cpp \
+ Server_Request_Interceptor.cpp \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ testsC.cpp \
+ testsS.cpp \
+ Server_ORBInitializer.h \
+ Server_Request_Interceptor.h \
+ test_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/README b/TAO/orbsvcs/tests/Bug_2248_Regression/README
new file mode 100755
index 00000000000..20a95c0bb35
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/README
@@ -0,0 +1,14 @@
+// $Id$
+
+This test is regression for bug 2248
+http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=2248
+
+To run:
+
+./server -o file1.ior -f file://iogr_10.ior -k KEY1
+./server -o file2.ior -k KEY2
+./client -a file://file1.ior -k KEY1 -b file://file2.ior -l KEY2 \
+ -g iogr_10.ior -h iogr_11.ior
+
+The complete test can be run by run_test.pl.
+The script exits with error code != 0 in case of error.
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.cpp b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.cpp
new file mode 100755
index 00000000000..8a557179c7c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.cpp
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Server_ORBInitializer.h"
+#include "tao/ORB_Constants.h"
+
+#if TAO_HAS_INTERCEPTORS == 1
+
+#include "Server_Request_Interceptor.h"
+
+Server_ORBInitializer::Server_ORBInitializer (void)
+ : server_interceptor_ ()
+{
+}
+
+void
+Server_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr interceptor;
+ // Install the server request interceptor.
+ ACE_NEW_THROW_EX (interceptor,
+ Server_Request_Interceptor,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ this->server_interceptor_ = interceptor;
+
+ info->add_server_request_interceptor (interceptor
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PortableInterceptor::ServerRequestInterceptor_ptr
+Server_ORBInitializer::server_interceptor (void)
+{
+ return
+ PortableInterceptor::ServerRequestInterceptor::_duplicate (
+ this->server_interceptor_.in ());
+}
+
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.h b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.h
new file mode 100755
index 00000000000..5c8103cd14f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_ORBInitializer.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef BUG_2248_REGRESSION_SERVER_ORB_INITIALIZER_H
+#define BUG_2248_REGRESSION_SERVER_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/LocalObject.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if TAO_HAS_INTERCEPTORS == 1
+
+#include "tao/PI/PI.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+// Forward declaration.
+class Server_Request_Interceptor;
+
+/// Server side ORB initializer.
+class Server_ORBInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ Server_ORBInitializer (void);
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the created server request interceptor. Only valid after
+ /// post_init(), i.e. ORB_init(), has been called.
+ PortableInterceptor::ServerRequestInterceptor_ptr server_interceptor (void);
+
+private:
+
+ /// Pointer to the server request interceptor. ORB is responsible
+ /// for storage.
+ PortableInterceptor::ServerRequestInterceptor_var server_interceptor_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+
+#include /**/ "ace/post.h"
+
+#endif /* BUG_2248_REGRESSION_SERVER_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.cpp b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.cpp
new file mode 100755
index 00000000000..69617231383
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.cpp
@@ -0,0 +1,136 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Server_Request_Interceptor.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/ORB_Constants.h"
+#include "tao/CDR.h"
+#include "testS.h"
+
+Server_Request_Interceptor::Server_Request_Interceptor (void)
+ : request_forwarded_ (0)
+{
+}
+
+Server_Request_Interceptor::~Server_Request_Interceptor (void)
+{
+}
+
+void
+Server_Request_Interceptor::forward_reference (
+ const char* iorstr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->iorstr_ = CORBA::string_dup (iorstr);
+}
+
+char *
+Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("Server_Request_Interceptor");
+}
+
+void
+Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_Request_Interceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr //
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+
+}
+
+void
+Server_Request_Interceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ IOP::ServiceContext_var svc =
+ ri->get_request_service_context (IOP::FT_GROUP_VERSION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // extract the group component
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (svc->context_data.get_buffer ()),
+ svc->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ return;
+ }
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ FT::TagFTGroupTaggedComponent group_component;
+
+ cdr >> group_component.object_group_ref_version;
+
+ if (group_component.object_group_ref_version < 11)
+ {
+ if (!request_forwarded_)
+ {
+ int argc = 0;
+ char** argv = 0;
+ CORBA::ORB_var orb = CORBA::ORB_init(argc,argv,ri->orb_id() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj = orb->string_to_object (iorstr_.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "SERVER (%P|%t) Request will be forwarded "
+ "to object 1\n" // "object 1" as in "obj_[0]"
+ "SERVER (%P|%t) via "
+ "receive_request_service_contexts().\n"));
+ request_forwarded_ = 1;
+ // Throw forward exception
+ ACE_THROW (PortableInterceptor::ForwardRequest (obj.in()));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "object_group_ref_version is %d\n", group_component.object_group_ref_version));
+ }
+ }
+
+ return;
+}
+
+void
+Server_Request_Interceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_Request_Interceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+Server_Request_Interceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.h b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.h
new file mode 100755
index 00000000000..c9a8151677a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/Server_Request_Interceptor.h
@@ -0,0 +1,109 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_Request_Interceptor.h
+ *
+ * $Id$
+ *
+ */
+//=============================================================================
+
+#ifndef BUG_2248_REGRESSION_SERVER_REQUEST_INTERCEPTOR_H
+#define BUG_2248_REGRESSION_SERVER_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include "testsC.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class Server_Request_Interceptor
+ *
+ * @brief Simple concrete server request interceptor.
+ *
+ *
+ */
+class Server_Request_Interceptor
+ : public virtual Simple_ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ Server_Request_Interceptor (void);
+
+ /// Destructor.
+ ~Server_Request_Interceptor (void);
+
+ /// Set the references to which requests will be forwarded.
+ virtual void forward_reference (const char* iorstr ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /**
+ * @name Methods Required by the Server Request Interceptor
+ * Interface
+ *
+ * These are methods that must be implemented since they are pure
+ * virtual in the abstract base class. They are the canonical
+ * methods required for all server request interceptors.
+ */
+ //@{
+ /// Return the name of this ServerRequestinterceptor.
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+ //@}
+
+private:
+
+ /// References to the two objects used in this test.
+ CORBA::String_var iorstr_;
+ int request_forwarded_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* BUG_2248_REGRESSION_SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp
new file mode 100755
index 00000000000..0d6a828940b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp
@@ -0,0 +1,520 @@
+// $Id$
+#include "client.h"
+#include "Client_i.h"
+#include "testC.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "ace/OS_NS_stdio.h"
+
+// Files which have the IOR
+const char *first_ior = 0;
+const char *first_key = 0;
+const char *second_ior = 0;
+const char *second_key = 0;
+const char *first_iogr_file = 0;
+const char *second_iogr_file = 0;
+
+// Objects
+CORBA::Object_var object_primary = 0;
+CORBA::Object_var object_secondary = 0;
+
+// Reference to the IOR manipulator
+
+int
+parse_args (int argc, char* argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "a:k:b:l:g:h:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'a':
+ first_ior = get_opts.opt_arg ();
+ break;
+ case 'k':
+ first_key = get_opts.opt_arg ();
+ break;
+ case 'b':
+ second_ior = get_opts.opt_arg ();
+ break;
+ case 'l':
+ second_key = get_opts.opt_arg ();
+ break;
+ case 'g':
+ first_iogr_file = get_opts.opt_arg ();
+ break;
+ case 'h':
+ second_iogr_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-a <iorfile1> -k <key1> "
+ "-b <iorfile2> -l <key2> "
+ "-g <iogr v10 output file> "
+ "-h <iogr v11 output file> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+int
+main (int argc,
+ char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ Manager manager;
+
+ ACE_TRY
+ {
+ // Initilaize the ORB, POA etc.
+ manager.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // the command line arguments
+ if (parse_args (argc, argv) == -1)
+ return -1;
+
+ // Merge the different IORS
+ manager.make_merged_iors (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Write IOR to file
+ if (manager.write_to_files ())
+ return -1;
+
+ // Client, who is going to use the merged IOR
+ // Construct that with the managers ORB
+ Client_i client_imp (manager.orb ());
+ return client_imp.init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Manager::Manager (void)
+{
+ //no-op
+}
+
+void
+Manager::init (int& argc,
+ char**& argv
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain the RootPOA.
+ CORBA::Object_var obj_var =
+ this->orb_->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa_var =
+ PortableServer::POA::_narrow (obj_var.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get the POAManager of the RootPOA.
+ PortableServer::POAManager_var poa_manager_var =
+ root_poa_var->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager_var->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Manager::make_merged_iors (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get an object reference for the ORBs IORManipultion object!
+ CORBA::Object_var IORM =
+ this->orb_->resolve_initial_references (
+ TAO_OBJID_IORMANIPULATION, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (IORM.in()))
+ return -1;
+
+ TAO_IOP::TAO_IOR_Manipulation_var iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (iorm.in()))
+ return -1;
+
+ CORBA::Object_var first = orb_->string_to_object (first_ior ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (first.in()))
+ return -1;
+
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (1);
+ iors.length(1);
+ iors [0] = first;
+
+ merged_set_10_ = iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (merged_set_10_.in()))
+ {
+ return -1;
+ }
+
+ int result = set_properties (iorm.in(), merged_set_10_.in(),
+ first.in(), 10 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (-1 == result)
+ {
+ return -1;
+ }
+
+ first = orb_->string_to_object (first_ior);
+ if (CORBA::is_nil (first.in()))
+ {
+ return -1;
+ }
+
+ CORBA::Object_var second = orb_->string_to_object (second_ior);
+
+ if (CORBA::is_nil (second.in()))
+ {
+ return -1;
+ }
+
+ // Create the list
+
+ iors.length(2);
+ iors [0] = first;
+ iors [1] = second;
+
+ merged_set_11_ = iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (merged_set_11_.in()))
+ {
+ return -1;
+ }
+
+ result = set_properties (iorm.in(), merged_set_11_.in(),
+ first.in(), 11 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (-1 == result)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+Manager::set_properties (TAO_IOP::TAO_IOR_Manipulation_ptr iorm,
+ CORBA::Object_ptr merged_set,
+ CORBA::Object_ptr primary,
+ CORBA::ULong version
+ ACE_ENV_ARG_DECL)
+{
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ const char *id = "iogr_testing";
+ ft_tag_component.group_domain_id = id;
+
+ // Object group id
+ ft_tag_component.object_group_id = 10;
+
+ // Version
+ ft_tag_component.object_group_ref_version = version;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property
+ CORBA::Boolean retval = iorm->set_primary (&iogr_prop,
+ primary,
+ merged_set
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Set the primary
+ // See we are setting the second ior as the primary
+ if (retval != 0)
+ {
+ retval = iorm->set_property (&iogr_prop,
+ merged_set
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+int
+Manager::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Error in run \n"),
+ -1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int Manager::write_to_files ()
+{
+ if (write_to_file (merged_set_10_.in(), first_iogr_file) ||
+ write_to_file (merged_set_11_.in(), second_iogr_file))
+ {
+ return -1;
+ }
+ return 0;
+}
+
+int
+Manager::write_to_file (CORBA::Object_ptr ior, const char* ior_output_file)
+{
+ CORBA::String_var iorref =
+ this->orb_->object_to_string (ior);
+
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", iorref.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ return 0;
+}
+
+CORBA::ORB_ptr
+Manager::orb (void)
+{
+ return this->orb_.in ();
+}
+
+Client_i::Client_i (CORBA::ORB_ptr orb)
+ :orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+int run_remote_test (Simple_Server_ptr server, const char* execute_key ACE_ENV_ARG_DECL)
+{
+ char expected[1024], received[1024];
+ if (execute_key)
+ {
+ ACE_OS::sprintf (expected,
+ "remote_call() completed by %s", execute_key);
+ }
+ else
+ {
+ ACE_OS::strcpy (expected, "CORBA::TRANSIENT");
+ }
+
+ ACE_TRY
+ {
+ // Make a remote call
+ CORBA::String_var s =
+ server->remote_call (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!s.in())
+ {
+ ACE_OS::strcpy (received, "(null)");
+ }
+ else
+ {
+ ACE_OS::strcpy (received, s.in());
+ }
+ }
+ ACE_CATCH (CORBA::TRANSIENT, te)
+ {
+ ACE_OS::strcpy (received, "CORBA::TRANSIENT");
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, cf)
+ {
+ ACE_OS::strcpy (received, "CORBA::COMM_FAILURE");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("CLIENT> REMOTE expected: '%s'"),
+ expected));
+ if (ACE_OS::strcmp (expected, received))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("... FAIL\n"
+ "CLIENT> received: '%s'\n"),
+ received));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("... OK\n")));
+ return 0;
+}
+
+int run_abort_test (Simple_Server_ptr server,
+ const char* request_key, const char* execute_key ACE_ENV_ARG_DECL)
+{
+ char expected[1024], received[1024];
+ if (execute_key)
+ {
+ ACE_OS::sprintf (expected,
+ "abort() completed by %s, still_alive=1",
+ execute_key);
+ }
+ else
+ {
+ ACE_OS::strcpy (expected, "CORBA::TRANSIENT");
+ }
+
+ ACE_TRY
+ {
+ CORBA::String_var s = server->abort (request_key);
+ ACE_TRY_CHECK;
+
+ if (!s.in())
+ {
+ ACE_OS::strcpy (received, "(null)");
+ }
+ else
+ {
+ ACE_OS::strcpy (received, s.in());
+ }
+ }
+ ACE_CATCH (CORBA::TRANSIENT, te)
+ {
+ ACE_OS::strcpy (received, "CORBA::TRANSIENT");
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, cf)
+ {
+ ACE_OS::strcpy (received, "CORBA::COMM_FAILURE");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("CLIENT> ABORT expected: '%s'"),
+ expected));
+
+ if (ACE_OS::strcmp (expected, received))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("... FAIL\n"
+ "CLIENT> received: '%s'\n"),
+ received));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("... OK\n")));
+ return 0;
+}
+
+int run_test (Simple_Server_ptr server ACE_ENV_ARG_DECL)
+{
+ int rv = run_abort_test (server, first_key, second_key ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_remote_test (server, second_key ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (rv)
+ {
+ return rv;
+ }
+
+ rv = run_abort_test (server, second_key, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return rv;
+}
+
+int
+Client_i::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ char iogrstr[1024];
+ ACE_OS::sprintf (iogrstr, "file://%s", first_iogr_file);
+
+ int argc = 0;
+ char **argv = 0;
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var object =
+ this->orb_->string_to_object (iogrstr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ // Combined IOR stuff
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ iogrstr));
+ }
+
+ // run tests
+ int result = run_test (server.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/client.h b/TAO/orbsvcs/tests/Bug_2248_Regression/client.h
new file mode 100755
index 00000000000..1bf9b049712
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/client.h
@@ -0,0 +1,57 @@
+// $Id$
+
+#ifndef BUG_2248_REGRESSION_CLIENT_H
+#define BUG_2248_REGRESSION_CLIENT_H
+
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Object.h"
+#include "tao/IORManipulation/IORManipulation.h"
+class Manager
+{
+public:
+
+ Manager (void);
+ // Ctor
+
+ void init (int& argc,
+ char**& argv
+ ACE_ENV_ARG_DECL);
+
+ // Initialize the ORB, POA etc.
+
+ int make_merged_iors (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Merges the different IORS
+
+ /// Run the ORB event loop..
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Write the merged IOGRs to a file
+ int write_to_files (void);
+
+ /// Return the pointer to the copy of our ORB
+ CORBA::ORB_ptr orb (void);
+
+private:
+
+ /// Write the merged IOGRs to a file
+ int write_to_file (CORBA::Object_ptr ior, const char* ior_output_file);
+
+ /// Sets the properties for the profiles
+ int set_properties (TAO_IOP::TAO_IOR_Manipulation_ptr iorm,
+ CORBA::Object_ptr merged_set,
+ CORBA::Object_ptr primary, CORBA::ULong version ACE_ENV_ARG_DECL);
+
+ /// Our ORB
+ CORBA::ORB_var orb_;
+
+ /// The merged IOR set
+ CORBA::Object_var merged_set_10_;
+ CORBA::Object_var merged_set_11_;
+};
+
+#endif /* BUG_2248_REGRESSION_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2248_Regression/run_test.pl
new file mode 100755
index 00000000000..3ede98e03ca
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/run_test.pl
@@ -0,0 +1,57 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$file1ior = PerlACE::LocalFile ("file1.ior");
+$file2ior = PerlACE::LocalFile ("file2.ior");
+$output10ior = PerlACE::LocalFile ("iogr_10.ior");
+$output11ior = PerlACE::LocalFile ("iogr_11.ior");
+
+unlink $file1ior, $file2ior, $output10ior, $output11ior;
+
+$SERV1 = new PerlACE::Process ("server", "-o $file1ior -f file://$output11ior -k KEY1");
+$SERV2 = new PerlACE::Process ("server", "./server -o $file2ior -k KEY2");
+$CLIENT = new PerlACE::Process ("client", "-a file://$file1ior -k KEY1 -b file://$file2ior -l KEY2 -g $output10ior -h $output11ior");
+
+# ---------------
+
+print STDERR "Starting Server 1\n";
+$SERV1->Spawn ();
+if (PerlACE::waitforfile_timed ($file1ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file1ior>\n";
+ $SERV1->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Server 2\n";
+$SERV2->Spawn ();
+if (PerlACE::waitforfile_timed ($file2ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file2ior>\n";
+ $SERV1->Kill ();
+ $SERV2->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Client\n";
+$CLIENT->Spawn ();
+$client = $CLIENT->WaitKill (30);
+
+$SERV1->WaitKill(5);
+$SERV2->WaitKill(5);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ ++ $status;
+}
+
+unlink $file1ior, $file2ior, $output10ior, $output11ior;
+
+exit $status
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_2248_Regression/server.cpp
new file mode 100755
index 00000000000..60f306ac782
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/server.cpp
@@ -0,0 +1,178 @@
+// $Id$
+
+#include "Server_ORBInitializer.h"
+#include "Server_Request_Interceptor.h"
+#include "test_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+#include "tao/ORBInitializer_Registry.h"
+
+const char *ior_output_file = 0;
+const char* merged_iorstr = 0;
+const char *key = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:k:f:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'k':
+ key = get_opts.opt_arg ();
+ break;
+ case 'f':
+ merged_iorstr = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "-k <key> "
+ "-f merged_iorstr"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ Server_ORBInitializer *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ Server_ORBInitializer,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We do the command line parsing first
+ if (parse_args (argc, argv) != 0)
+ return 1;
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList policies;
+ policies.length (3);
+ policies[0] = root_poa->create_id_assignment_policy (
+ PortableServer::USER_ID ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policies[1] = root_poa->create_implicit_activation_policy (
+ PortableServer::NO_IMPLICIT_ACTIVATION ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policies[2] = root_poa->create_lifespan_policy (
+ PortableServer::PERSISTENT ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var poa = root_poa->create_POA (
+ "PERS_POA", poa_manager.in (), policies ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Instantiate the LCD_Display implementation class
+ Simple_Server_i display_impl (orb.in (), key);
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("IOGR_OID");
+
+ poa->activate_object_with_id (id.in(), &display_impl ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var server =
+ poa->id_to_reference (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ // Set the forward references in the server request interceptor.
+ PortableInterceptor::ServerRequestInterceptor_var
+ server_interceptor = temp_initializer->server_interceptor ();
+
+ Simple_ServerRequestInterceptor_var interceptor =
+ Simple_ServerRequestInterceptor::_narrow (
+ server_interceptor.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (interceptor.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Could not obtain reference to "
+ "server request interceptor.\n"),
+ -1);
+
+ interceptor->forward_reference (merged_iorstr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/test.idl b/TAO/orbsvcs/tests/Bug_2248_Regression/test.idl
new file mode 100755
index 00000000000..f1ba468adb1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/test.idl
@@ -0,0 +1,8 @@
+// $Id$
+
+interface Simple_Server
+{
+ string remote_call ();
+ string shutdown (in string ior_file);
+ string abort (in string ior_file);
+};
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/test_i.cpp b/TAO/orbsvcs/tests/Bug_2248_Regression/test_i.cpp
new file mode 100755
index 00000000000..c3cc5424921
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/test_i.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "test_i.h"
+
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb, const char* key)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+ , _key (CORBA::string_dup (key))
+{
+}
+
+Simple_Server_i::Simple_Server_i (void)
+ : orb_ (0)
+{
+ // no-op
+}
+
+char*
+Simple_Server_i::remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> executing remote_call()\n", _key.in()));
+
+ char buf[256];
+ ACE_OS::sprintf (buf, "remote_call() completed by %s", _key.in());
+
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> returning '%s'\n", _key.in(), buf));
+ return CORBA::string_dup (buf);
+}
+
+
+char*
+Simple_Server_i::shutdown (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> executing shutdown()\n", _key.in()));
+
+ int still_alive = 1;
+ if (!ACE_OS::strcmp (_key.in(), key))
+ {
+ this->orb_->shutdown (0);
+ still_alive = 0;
+ }
+
+ char buf[256];
+ ACE_OS::sprintf (buf, "shutdown() completed by %s, still_alive=%d",
+ _key.in(), still_alive);
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> returning '%s'\n", _key.in(), buf));
+ return CORBA::string_dup (buf);
+}
+
+char*
+Simple_Server_i::abort (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> executing abort()\n", _key.in()));
+ int still_alive = 1;
+ if (!ACE_OS::strcmp (_key.in(), key))
+ {
+ ACE_OS::abort();
+ still_alive = 0;
+ }
+
+ char buf[256];
+ ACE_OS::sprintf (buf, "abort() completed by %s, still_alive=%d",
+ _key.in(), still_alive);
+ ACE_DEBUG ((LM_DEBUG, "SERVER(%s)> returning '%s'\n", _key.in(), buf));
+ return CORBA::string_dup (buf);
+}
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/test_i.h b/TAO/orbsvcs/tests/Bug_2248_Regression/test_i.h
new file mode 100755
index 00000000000..09da165bd14
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/test_i.h
@@ -0,0 +1,38 @@
+// $Id$
+
+#ifndef BUG_2248_REGRESSION_TEST_I_H
+#define BUG_2248_REGRESSION_TEST_I_H
+
+#include "testS.h"
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb, const char* key);
+ // ctor
+
+ Simple_Server_i (void);
+ // ctor
+
+ // = The Simple_Server methods.
+ char* remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char* shutdown (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ char* abort (const char* key ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+ CORBA::String_var _key;
+};
+
+#endif /* BUG_2248_REGRESSION_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/tests.idl b/TAO/orbsvcs/tests/Bug_2248_Regression/tests.idl
new file mode 100755
index 00000000000..a1be42b8619
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/tests.idl
@@ -0,0 +1,13 @@
+// $Id$
+
+#include "tao/PortableInterceptor.pidl"
+#include "tao/PI_Server/PI_Server_include.pidl"
+
+#include "test.idl"
+
+local interface Simple_ServerRequestInterceptor
+ : PortableInterceptor::ServerRequestInterceptor
+{
+ /// Set the reference to which requests will be forwarded.
+ void forward_reference (in string iorstr);
+};
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/Bug_2285_Regression.mpc b/TAO/orbsvcs/tests/Bug_2285_Regression/Bug_2285_Regression.mpc
new file mode 100644
index 00000000000..349374bb355
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/Bug_2285_Regression.mpc
@@ -0,0 +1,67 @@
+// -*- MPC -*-
+// $Id$
+
+project(*IDL): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*Client): taoserver, ftclientorb {
+ after += *IDL
+
+ exename = client
+ Source_Files {
+ client.cpp
+ Hello.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project (*Server) : taoserver, ftclientorb, pi_server {
+ after += *IDL
+
+ exename = server
+ Source_Files {
+ server.cpp
+ Hello.cpp
+ ServerORBInitializer.cpp
+ ServerRequest_Interceptor.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client2): taoclient, ftclientorb, iormanip {
+ after += *IDL
+
+ exename = client2
+ Source_Files {
+ client2.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project (*Server2) : taoserver, pi_server, ftclientorb {
+ after += *IDL
+
+ exename = server2
+ Source_Files {
+ server2.cpp
+ Hello.cpp
+ ServerORBInitializer2.cpp
+ ServerRequest_Interceptor2.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/Hello.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/Hello.cpp
new file mode 100644
index 00000000000..6463bd8e9ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/Hello.cpp
@@ -0,0 +1,74 @@
+//
+// $Id$
+//
+#include "Hello.h"
+
+ACE_RCSID(Hello, Hello, "$Id$")
+
+CORBA::Boolean
+Hello::ids_differ_ = 1;
+
+Hello::Hello (CORBA::ORB_ptr orb, Test::Hello_ptr server, CORBA::ULong server_id)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ server_ (Test::Hello::_duplicate (server)),
+ server_id_ (server_id)
+{
+}
+
+char *
+Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("Hello there!");
+}
+
+void
+Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Hello::throw_exception (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, Test::MyException))
+{
+ ACE_THROW (Test::MyException ());
+}
+
+// Nested sequence step 1 - This op called by the client on the server
+CORBA::Boolean
+Hello::call_me_back (Test::Hello_ptr me ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Boolean result = me->call_back (ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ return result;
+}
+
+// Nested sequence step 2 - This op called by the server on the client
+CORBA::Boolean
+Hello::call_back (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Boolean result = server_->check_request_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ return result;
+}
+
+// Nested sequence step 3 - This op called by the client on the server
+CORBA::Boolean
+Hello::check_request_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // The server request interceptor will have set this public static member
+ // false if the same retention id has been used twice
+ return ids_differ_;
+}
+
+CORBA::ULong
+Hello::drop_down_dead (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return server_id_;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/Hello.h b/TAO/orbsvcs/tests/Bug_2285_Regression/Hello.h
new file mode 100644
index 00000000000..4967689c88a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/Hello.h
@@ -0,0 +1,63 @@
+//
+// $Id$
+//
+
+#ifndef HELLO_H
+#define HELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+/// Implement the Test::Hello interface
+class Hello
+ : public virtual POA_Test::Hello
+{
+public:
+ /// Constructor
+ Hello (CORBA::ORB_ptr orb, Test::Hello_ptr server, CORBA::ULong server_id = 0);
+
+ // = The skeleton methods
+ virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void throw_exception (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, Test::MyException));
+
+ virtual CORBA::Boolean call_me_back (Test::Hello_ptr me ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean call_back (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean check_request_id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::ULong drop_down_dead (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ static CORBA::Boolean ids_differ_;
+
+private:
+ /// Use an ORB reference to conver strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+
+ Test::Hello_var server_;
+
+ CORBA::ULong server_id_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* HELLO_H */
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2285_Regression/Makefile.am
new file mode 100644
index 00000000000..63042936044
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/Makefile.am
@@ -0,0 +1,252 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Bug_2285_Regression_IDL.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.Bug_2285_Regression_Client.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ Hello.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ client.cpp \
+ Hello.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.Bug_2285_Regression_Client2.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client2
+
+client2_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client2_SOURCES = \
+ TestC.cpp \
+ client2.cpp \
+ Hello.h \
+ ServerORBInitializer.h \
+ ServerORBInitializer2.h \
+ ServerRequest_Interceptor.h \
+ ServerRequest_Interceptor2.h
+
+client2_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.Bug_2285_Regression_Server.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ Hello.cpp \
+ ServerORBInitializer.cpp \
+ ServerRequest_Interceptor.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ Hello.h \
+ ServerORBInitializer.h \
+ ServerRequest_Interceptor.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.Bug_2285_Regression_Server2.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server2
+
+server2_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server2_SOURCES = \
+ Hello.cpp \
+ ServerORBInitializer2.cpp \
+ ServerRequest_Interceptor2.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server2.cpp \
+ Hello.h \
+ ServerORBInitializer2.h \
+ ServerRequest_Interceptor2.h
+
+server2_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/README b/TAO/orbsvcs/tests/Bug_2285_Regression/README
new file mode 100644
index 00000000000..eb174b925d9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/README
@@ -0,0 +1,96 @@
+// $Id$
+
+See http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=2285 for more.
+
+These two test scenarios test that the following FT spec conditions are met:
+
+1 / "The retention_id uniquely identifies the request within the scope of the client and the expiration_time."
+2 / "Each repetition of a request must carry the same client_id, retention_id, and expiration_time as the original request."
+3 / "If a client ORB loses the connection with a server or incurs some other kind of transport fault, the ORB may attempt to retransmit the request message, or retransmit the request message to an alternative destination or using an alternative transport, up to the expiration_time."
+4 / "TimeBase::TimeT expiration_time" and "TimeT represents a single time value, which is 64 bits in size, and holds the number of 100 nanoseconds that have passed since the base time. For absolute time the base is 15 October 1582 00:00 of the Gregorian Calendar. All absolute time shall be computed using dates from the Gregorian Calendar."
+
+Test #1 checks that unique retention IDs are used in two scenarios:
+1/ When a request follows a previous request that concluded with an exception being returned to the application code.
+2/ When a subsequent request is made in a thread when that thread still as a response to a previous request outstanding.
+
+__Test #1 - Regression 1 & 2__
+
+TAO249_ServerRequest_Interceptor::receive_request (24807|3074381504) called for method: throw_exception ... client retention id is: 1
+Client catches a MyException, as expected. No problem !
+TAO249_ServerRequest_Interceptor::receive_request (24807|3074381504) called for method: call_me_back ... client retention id is: 1
+Test Failed - REGRESSION !!! Same client retention id has been used for TWO consecutive independent invocations!!
+TAO249_ServerRequest_Interceptor::receive_request (24807|3074381504) called for method: check_request_id ... client retention id is: 1
+Test Failed - REGRESSION !!! Same client retention id has been used for TWO consecutive independent invocations!!
+TAO249_ServerRequest_Interceptor::receive_request (24807|3074381504) called for method: shutdown ... client retention id is: 2
+(24807|3074381504) server - event loop finished
+Error: REGRESSION identified!!!
+ERROR: client returned 1
+
+__Test #1 - Successful result__
+
+E:\doc_cvs\ACE_wrappers\TAO\orbsvcs\tests\tao249_regression>run_test.pl
+TAO249_ServerRequest_Interceptor::receive_request (2844|1244) called for method: throw_exception ... client retention id is: 1
+Client catches a MyException, as expected. No problem !
+TAO249_ServerRequest_Interceptor::receive_request (2844|1244) called for method: call_me_back ... client retention id is: 2
+TAO249_ServerRequest_Interceptor::receive_request (2844|1244) called for method: check_request_id ... client retention id is: 3
+TAO249_ServerRequest_Interceptor::receive_request (2844|1244) called for method: shutdown ... client retention id is: 4
+(2844|1244) server - event loop finished
+Test passed !!!
+
+Test #2 checks that 4 conditions are met:
+1/ That the conversion from ACE_Time_Value to TimeT used in the calculation of the expiration time is done correctly.
+2/ That the correct offset has been applied to convert from posix to gregorian time.
+3/ That the client reuses the same original expiration time on all retries of the same request.
+4/ That the client stops retrying a request once the expiration time has passed.
+
+__Test #2 - Regression 1__
+
+Test Failed - REGRESSION !!! Expiration time is garbage - it is after 2358 A.D.!!
+Expiration time: 18446744072261958952
+2358 A.D. : 244385856000000000
+Error: REGRESSION identified by server 0. Test Failed !!
+Error: REGRESSION identified!!!
+ERROR: client returned 1
+
+__Test #2 - Regression 2__
+
+Test Failed - REGRESSION !!! Expiration time is in wrong format - it is before 1970 A.D. !!
+Expiration time: 11301710711718750
+1970 A.D. : 122192928000000000
+Error: REGRESSION identified by server 0. Test Failed !!
+Error: REGRESSION identified!!!
+ERROR: client returned 1
+
+__Test #2 - Regression 3__
+
+abnormal program termination
+Test Failed - REGRESSION !!! Different expiration times used on consecutive retries of the same op!!
+Previous expiration: 133494646145937500
+Current expiration : 133494646183906250
+Error: REGRESSION identified by server 1. Test Failed !!
+Error: REGRESSION identified!!!
+ERROR: client returned 1
+
+__Test #2 - Regression 4__
+
+abnormal program termination
+...
+abnormal program termination
+Test Failed - REGRESSION !!! Client ORB is still retrying after the expiration time!!
+Expiration time : 133494661968437500
+Previous attempt : 133494661990000000
+Time now : 133494662015156250
+Error: REGRESSION identified by server 2. Test Failed !!
+Error: REGRESSION identified!!!
+ERROR: client returned 1
+
+__Test #2 - Successful result:__
+
+abnormal program termination
+
+abnormal program termination
+(4084|3584) EXCEPTION, Client caught transport exception, as expected. No problem !
+
+system exception, ID 'IDL:omg.org/CORBA/COMM_FAILURE:1.0' TAO exception, minor code = 6 (failed to recv request response; ENOENT), completed = MAYBE
+
+Test passed !!!
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.cpp
new file mode 100644
index 00000000000..e371cd8c9be
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.cpp
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ServerORBInitializer.h"
+#include "ServerRequest_Interceptor.h"
+#include "tao/ORB_Constants.h"
+#include "tao/Exception.h"
+
+
+void
+Server_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+}
+
+void
+Server_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_server_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Server_ORBInitializer::register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr sri =
+ PortableInterceptor::ServerRequestInterceptor::_nil ();
+
+ ACE_NEW_THROW_EX (sri,
+ TAO249_ServerRequest_Interceptor,
+ CORBA::NO_MEMORY ());
+
+ PortableInterceptor::ServerRequestInterceptor_var
+ server_interceptor = sri;
+
+ info->add_server_request_interceptor (server_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.h b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.h
new file mode 100644
index 00000000000..d7ca298b858
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer.h
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id$
+ */
+//=============================================================================
+#ifndef TAO249_SERVER_ORBINITIALIZER_H
+#define TAO249_SERVER_ORBINITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/PI_Server_includeC.h"
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+/// RTCORBA ORB initializer.
+class Server_ORBInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// Register the necessary interceptors.
+ void register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO249_SERVER_ORBINITIALIZER_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.cpp
new file mode 100644
index 00000000000..f7a7b408be7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.cpp
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ServerORBInitializer2.h"
+#include "ServerRequest_Interceptor2.h"
+#include "tao/ORB_Constants.h"
+#include "tao/Exception.h"
+
+
+void
+Server_ORBInitializer2::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+}
+
+void
+Server_ORBInitializer2::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_server_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Server_ORBInitializer2::register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr sri =
+ PortableInterceptor::ServerRequestInterceptor::_nil ();
+
+ ACE_NEW_THROW_EX (sri,
+ TAO249_ServerRequest_Interceptor2,
+ CORBA::NO_MEMORY ());
+
+ PortableInterceptor::ServerRequestInterceptor_var
+ server_interceptor = sri;
+
+ info->add_server_request_interceptor (server_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.h b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.h
new file mode 100644
index 00000000000..a98a94523be
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerORBInitializer2.h
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id$
+ */
+//=============================================================================
+#ifndef TAO249_SERVER_ORBINITIALIZER2_H
+#define TAO249_SERVER_ORBINITIALIZER2_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/PI_Server_includeC.h"
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+/// RTCORBA ORB initializer.
+class Server_ORBInitializer2 :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// Register the necessary interceptors.
+ void register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO249_SERVER_ORBINITIALIZER2_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.cpp
new file mode 100644
index 00000000000..3ace3eaea71
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.cpp
@@ -0,0 +1,145 @@
+// -*- C++ -*-
+
+#include "ServerRequest_Interceptor.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/IOP_IORC.h"
+#include "tao/ORB_Constants.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/CDR.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_string.h"
+#include "Hello.h"
+
+ACE_RCSID (FaultTolerance,
+ TAO249_ServerRequest_Interceptor,
+ "$Id$")
+
+TAO249_ServerRequest_Interceptor::TAO249_ServerRequest_Interceptor (void)
+: orb_ (0),
+ client_id_ (0)
+{
+}
+
+TAO249_ServerRequest_Interceptor::~TAO249_ServerRequest_Interceptor (void)
+{
+}
+
+
+char *
+TAO249_ServerRequest_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO_TAO249_ServerRequest_Interceptor");
+}
+
+void
+TAO249_ServerRequest_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_TRY
+ {
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (IOP::FT_REQUEST
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_InputCDR cdr (reinterpret_cast <const char*>
+ (sc->context_data.get_buffer ()),
+ sc->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+ }
+ ACE_TRY_CHECK;
+
+ cdr.reset_byte_order (static_cast <int> (byte_order));
+
+ FT::FTRequestServiceContext ftrsc;
+
+ if ((cdr >> ftrsc) == 0)
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "TAO249_ServerRequest_Interceptor::receive_request (%P|%t) called for method: %s ... client retention id is: %d\n", op.in (), ftrsc.retention_id ));
+
+ if (client_id_ == 0)
+ {
+ client_id_ = ftrsc.retention_id;
+ }
+ else
+ {
+ if (client_id_ != ftrsc.retention_id)
+ {
+ client_id_ = ftrsc.retention_id;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_ERROR, "Test Failed - REGRESSION !!! Same client retention id has been used for TWO consecutive independent invocations!!\n"));
+ Hello::ids_differ_ = 0;
+ }
+ }
+ }
+ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_ERROR, "Unexpected (non regression) error - test failed\n"));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in TAO249_ServerRequest_Interceptor::receive_request \n");
+ ACE_RE_THROW;
+ }
+ACE_ENDTRY;
+ACE_CHECK;
+
+}
+
+void
+TAO249_ServerRequest_Interceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.h b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.h
new file mode 100644
index 00000000000..fdccf530614
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor.h
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id$
+ */
+//=============================================================================
+
+#ifndef TAO249_SERVER_REQUEST_INTERCEPTOR_H
+#define TAO249_SERVER_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/ORB.h"
+#include "tao/PI/PI.h"
+#include "tao/PI_Server/PI_Server.h"
+
+/**
+* $Id$
+*/
+class TAO249_ServerRequest_Interceptor
+: public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+/// Constructor.
+TAO249_ServerRequest_Interceptor (void);
+
+/// Destructor.
+~TAO249_ServerRequest_Interceptor (void);
+
+/**
+ * @name Methods Required by the Server Request Interceptor
+ * Interface
+ *
+ * These are methods that must be implemented since they are pure
+ * virtual in the abstract base class. They are the canonical
+ * methods required for all server request interceptors.
+ */
+//@{
+/// Return the name of this ServerRequestinterceptor.
+virtual char * name (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+//@}
+private:
+
+CORBA::ORB_var orb_;
+
+CORBA:: Long client_id_;
+};
+
+#endif /* TAO249_SERVER_REQUEST_INTERCEPTOR_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.cpp
new file mode 100644
index 00000000000..cc63dbf287e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.cpp
@@ -0,0 +1,240 @@
+// -*- C++ -*-
+
+#include "ServerRequest_Interceptor2.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/IOP_IORC.h"
+#include "tao/ORB_Constants.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/CDR.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "Hello.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID (FaultTolerance,
+ TAO249_ServerRequest_Interceptor2,
+ "$Id$")
+
+TAO249_ServerRequest_Interceptor2::TAO249_ServerRequest_Interceptor2 (void)
+: orb_ (0),
+ client_id_ (0)
+{
+}
+
+TAO249_ServerRequest_Interceptor2::~TAO249_ServerRequest_Interceptor2 (void)
+{
+}
+
+
+char *
+TAO249_ServerRequest_Interceptor2::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO_TAO249_ServerRequest_Interceptor2");
+}
+
+void
+TAO249_ServerRequest_Interceptor2::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ if (ACE_OS::strcmp (op.in (), "drop_down_dead"))
+ {
+ // bail if not the op we are interested in -
+ // avoid excess spurious error clutter when client calls ::shutdown
+ return;
+ }
+
+ ACE_CHECK;
+ ACE_TRY
+ {
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (IOP::FT_REQUEST
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_InputCDR cdr (reinterpret_cast <const char*>
+ (sc->context_data.get_buffer ()
+ ),
+ sc->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+ }
+ ACE_TRY_CHECK;
+
+ cdr.reset_byte_order (static_cast <int>(byte_order));
+
+ FT::FTRequestServiceContext ftrsc;
+
+ if ((cdr >> ftrsc) == 0)
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ FILE* last_exp_time_file = ACE_OS::fopen ("last_expiration_time", "r+");
+ TimeBase::TimeT last_exp_time = 0;
+
+ if (!last_exp_time_file)
+ {
+ // file does not exist ... we're the first server
+ // create new file for the expiration time
+ last_exp_time_file = ACE_OS::fopen ("last_expiration_time", "w+");
+ last_exp_time = ftrsc.expiration_time;
+ }
+ else
+ {
+ // We're a subsequent server... read in the previous server's expiration time
+ ACE_OS::fread (&last_exp_time,
+ 1,
+ sizeof (TimeBase::TimeT),
+ last_exp_time_file);
+ ACE_OS::sleep (1);
+ }
+
+ if (last_exp_time != ftrsc.expiration_time)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Test Failed - REGRESSION !!! Different expiration times used on consecutive retries of the same op!!\n"));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Previous expiration: %Q\n"), last_exp_time));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Current expiration : %Q\n"), ftrsc.expiration_time));
+ return;
+ }
+
+
+ // This is the offset from UTC to posix - a value less than than this will
+ // indicate posix is (mistakenly) being used
+ TimeBase::TimeT the_seventies = ACE_UINT64_LITERAL (0x1B21DD213814000);
+
+ // @warning - this test is fragile. It will break in 2358 A.D. :-)
+ if (last_exp_time <= the_seventies)
+ {
+ ACE_DEBUG ((LM_ERROR, "Test Failed - REGRESSION !!! Expiration time is in wrong format - it is before 1970 A.D. !!\n"));
+ ACE_DEBUG ((LM_DEBUG, "Expiration time: %Q\n", last_exp_time));
+ ACE_DEBUG ((LM_DEBUG, "1970 A.D. : %Q\n", the_seventies));
+ return;
+ }
+ else if ( last_exp_time > (the_seventies * 2))
+ {
+ ACE_DEBUG ((LM_ERROR, "Test Failed - REGRESSION !!! Expiration time is garbage - it is after 2358 A.D. !!\n"));
+ ACE_DEBUG ((LM_DEBUG, "Expiration time: %Q\n", last_exp_time));
+ ACE_DEBUG ((LM_DEBUG, "2358 A.D. : %Q\n", (the_seventies * 2)));
+ return;
+ }
+
+ TimeBase::TimeT now = get_now ();
+
+ if (now > last_exp_time)
+ {
+ // We have passed the exp time... there should be no more retries received after this point...
+ FILE* no_more_retries = ACE_OS::fopen ("no_more_retries", "r+");
+ if (no_more_retries)
+ {
+ TimeBase::TimeT last_expired_attempt = 0;
+ ACE_OS::fread (&last_expired_attempt, 1, sizeof (TimeBase::TimeT), no_more_retries);
+ ACE_OS::fclose (no_more_retries);
+
+ // There has already been an attempt after the last server passed the expiration time
+ ACE_DEBUG ((LM_ERROR, "Test Failed - REGRESSION !!! Client ORB is still retrying after the expiration time!!\n"));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Expiration time : %Q\n"), last_exp_time));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Previous attempt : %Q\n"), last_expired_attempt));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Time now : %Q\n"), now));
+ return;
+ }
+ else
+ {
+ // Tell the next server we've passed the point of no return
+ no_more_retries = ACE_OS::fopen ("no_more_retries", "w+");
+ ACE_OS::fwrite (&now, 1, sizeof (TimeBase::TimeT), no_more_retries);
+ ACE_OS::fflush (no_more_retries);
+ ACE_OS::fclose (no_more_retries);
+ }
+ }
+
+ // Everthing is fine so far. Write out the expiration time for the next server to check
+ ACE_OS::fwrite (&ftrsc.expiration_time, 1, sizeof (TimeBase::TimeT), last_exp_time_file);
+ ACE_OS::fflush (last_exp_time_file);
+ ACE_OS::fclose (last_exp_time_file);
+
+ // Goodbye cruel world !!
+ ACE_OS::abort ();
+ }
+ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_ERROR, "Unexpected (non regression problem) error - test failed\n"));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in TAO249_ServerRequest_Interceptor2::receive_request \n");
+ ACE_RE_THROW;
+ }
+ACE_ENDTRY;
+ACE_CHECK;
+
+}
+
+TimeBase::TimeT
+TAO249_ServerRequest_Interceptor2::get_now (void)
+{
+ // 1582...
+ const TimeBase::TimeT timeOffset = ACE_UINT64_LITERAL (0x1B21DD213814000);
+
+ // Now in posix
+ ACE_Time_Value time_value = ACE_OS::gettimeofday ();
+
+ TimeBase::TimeT sec_part = time_value.sec ();
+ sec_part = sec_part * 10000000;
+ TimeBase::TimeT usec_part = time_value.usec ();
+ usec_part = usec_part * 10;
+ return (sec_part + usec_part + timeOffset);
+}
+
+void
+TAO249_ServerRequest_Interceptor2::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.h b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.h
new file mode 100644
index 00000000000..74a92c7e0ed
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/ServerRequest_Interceptor2.h
@@ -0,0 +1,96 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id$
+ */
+//=============================================================================
+
+#ifndef TAO249_SERVER_REQUEST_INTERCEPTOR2_H
+#define TAO249_SERVER_REQUEST_INTERCEPTOR2_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/ORB.h"
+#include "tao/PI/PI.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/TimeBaseC.h"
+
+/**
+* $Id$
+*/
+class TAO249_ServerRequest_Interceptor2
+: public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+/// Constructor.
+TAO249_ServerRequest_Interceptor2 (void);
+
+/// Destructor.
+~TAO249_ServerRequest_Interceptor2 (void);
+
+/**
+ * @name Methods Required by the Server Request Interceptor
+ * Interface
+ *
+ * These are methods that must be implemented since they are pure
+ * virtual in the abstract base class. They are the canonical
+ * methods required for all server request interceptors.
+ */
+//@{
+/// Return the name of this ServerRequestinterceptor.
+virtual char * name (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+//@}
+
+protected:
+ TimeBase::TimeT get_now (void);
+
+private:
+
+CORBA::ORB_var orb_;
+
+CORBA::Long client_id_;
+};
+
+#endif /* TAO249_SERVER_REQUEST_INTERCEPTOR2_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/Test.idl b/TAO/orbsvcs/tests/Bug_2285_Regression/Test.idl
new file mode 100644
index 00000000000..00cc73c174e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/Test.idl
@@ -0,0 +1,43 @@
+//
+// $Id$
+//
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ exception MyException {};
+ /// A very simple interface
+ interface Hello
+ {
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+
+ // Methods for first test
+
+ // The client first calls this to generate a (user) exception
+ // which is handled in the application code
+ void throw_exception () raises (MyException);
+
+ // Starts the nested sequence - client calls...
+ boolean call_me_back (in Hello me);
+
+ // ... then the server calls this back onto the client,
+ // which prompts the client to call...
+ boolean call_back ();
+
+ // ... this ! The server interceptor will have been recording
+ // if any retention ID has been reused in the sequence of invocations
+ // @return true for all different, false otherwise.
+ boolean check_request_id ();
+
+ // Method for second test. Makes the servant perform
+ // a number of checks and then either commit suicide (to prompt a
+ // retry on the next member of the IOGR) or to return
+ // successfully if it has detected a regresssion.
+ // @return the number identifying this servant with teh group
+ unsigned long drop_down_dead ();
+ };
+};
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/client.cpp
new file mode 100644
index 00000000000..60c37b8dff5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/client.cpp
@@ -0,0 +1,137 @@
+// $Id$
+
+#include "TestS.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+#include "Hello.h"
+
+ACE_RCSID(Hello, client, "$Id$")
+
+const char *ior = "file://test.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ CORBA::Boolean result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Test failed - Not regression - unexpected nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Hello *hello_impl;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (orb.in (), hello.in ()),
+ 1);
+ PortableServer::ServantBase_var owner_transfer(hello_impl);
+
+ Test::Hello_var me =
+ hello_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY
+ {
+ hello->throw_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ ACE_CATCH (Test::MyException, my_ex)
+ {
+ ACE_UNUSED_ARG (my_ex);
+ ACE_DEBUG ((LM_DEBUG, "Client catches a MyException, as expected. No problem !\n"));
+ }
+ ACE_ENDTRY;
+
+ result = ! hello->call_me_back (me.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ hello->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test failed (Not regression) because unexpected exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ if (result)
+ {
+ ACE_DEBUG ((LM_ERROR, "Error: REGRESSION identified!!!\n"));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Test passed !!!\n"));
+ }
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp
new file mode 100644
index 00000000000..682b0d8f86f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/client2.cpp
@@ -0,0 +1,215 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+
+ACE_RCSID(Hello, client, "$Id$")
+
+//const char *ior = "file://test.ior";
+TAO_IOP::TAO_IOR_Manipulation_var iorm = 0;
+CORBA::ULong number_of_servers = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:n:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ break;
+ case 'n':
+ number_of_servers = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+CORBA::Object_ptr
+make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_version, Test::Hello_ptr* refs ACE_ENV_ARG_DECL)
+{
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (number_of_servers);
+ iors.length(number_of_servers);
+ for (CORBA::ULong i = 0; i < number_of_servers; ++i)
+ {
+ iors [i] = CORBA::Object::_duplicate (refs[i]);
+ }
+
+ CORBA::Object_var new_ref =
+ iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ //const char *id = "iogr_testing";
+ ft_tag_component.group_domain_id = domain_id;
+
+ // Object group id
+ ft_tag_component.object_group_id = group_id;
+
+ // Version
+ ft_tag_component.object_group_ref_version = group_version;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property
+ CORBA::Boolean retval = iorm->set_property (&iogr_prop,
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Set the primary
+ // See we are setting the second ior as the primary
+ if (retval != 0)
+ {
+ retval = iorm->set_primary (&iogr_prop,
+ refs[0],
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return new_ref._retn ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ CORBA::Boolean result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // Get a ref to the IORManipulation object
+ CORBA::Object_var IORM =
+ orb->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow
+ iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Hello_ptr *servers = new Test::Hello_ptr [number_of_servers];
+
+ for (CORBA::ULong i = 0; i < number_of_servers; ++ i)
+ {
+ char buf[4]; // if you run more than 10000 servers then you need your head looking at
+ const char *number = ACE_OS::itoa ((int) i, buf, 10);
+ ACE_CString ior_file ("file://n");
+ const char *ior = ((ior_file += number) += ".ior").c_str ();
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ servers[i] =
+ Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (servers[i]))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+ }
+
+ CORBA::Object_var iogr = make_iogr ("Domain_1", 1, 1, servers ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Hello_var hello_iogr = Test::Hello::_narrow(iogr.in () ACE_ENV_ARG_PARAMETER);
+
+ CORBA::ULong last_server = 0;
+
+ ACE_TRY
+ {
+ last_server = hello_iogr->drop_down_dead (ACE_ENV_SINGLE_ARG_PARAMETER);
+ // If the call 'succeeds' the server has identified a regression.
+ result = 1;
+ ACE_DEBUG ((LM_ERROR, "Error: REGRESSION identified by server %u. Test Failed !!\n", last_server));
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, my_ex)
+ {
+ ACE_UNUSED_ARG (my_ex);
+ // We can't use the word exception for fear of upsetting the build log parser
+ ACE_DEBUG ((LM_DEBUG, "Client caught one of those things that is normally used to indicate a problem ("
+ "although it doesn't in this case) and which we cannot name because the autobuild "
+ "script will think we have a problem if we do mention the word. No problem !\n"));
+ }
+ ACE_ENDTRY;
+
+ for (CORBA::ULong j = last_server; j < number_of_servers; ++j)
+ {
+ ACE_TRY
+ {
+ servers[j]->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHALL
+ {
+ // Well we tried...
+ }
+ ACE_ENDTRY;
+
+ CORBA::release (servers [j]);
+ }
+
+ for (CORBA::ULong k = 0; k < last_server; ++k)
+ {
+ CORBA::release (servers [k]);
+ }
+
+ delete [] servers;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test failed (Not regression) because unexpected exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ if (result)
+ {
+ ACE_DEBUG ((LM_ERROR, "Error: REGRESSION identified!!!\n"));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Test passed !!!\n"));
+ }
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2285_Regression/run_test.pl
new file mode 100755
index 00000000000..de69f709455
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/run_test.pl
@@ -0,0 +1,49 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+unlink $iorfile;
+
+if (PerlACE::is_vxworks_test()) {
+ $SV = new PerlACE::ProcessVX ("server", "-o server.ior");
+}
+else {
+ $SV = new PerlACE::Process ("server", "-o $iorfile");
+}
+$CL = new PerlACE::Process ("client", " -k file://$iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/run_test2.pl b/TAO/orbsvcs/tests/Bug_2285_Regression/run_test2.pl
new file mode 100755
index 00000000000..e96b15a55b2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/run_test2.pl
@@ -0,0 +1,70 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$number_of_servers = 5;
+
+@SV;
+
+unlink PerlACE::LocalFile ("last_expiration_time");
+unlink PerlACE::LocalFile ("no_more_retries");
+
+for ($counter = 0; $counter < $number_of_servers; $counter++)
+{
+ unlink PerlACE::LocalFile ("n".$counter.".ior");
+}
+
+for($counter=0; $counter < $number_of_servers; $counter++)
+{
+ if (PerlACE::is_vxworks_test()) {
+ push (@SV, new PerlACE::ProcessVX ("server2", "-n $counter"));
+ }
+ else {
+ push (@SV, new PerlACE::Process ("server2", "-n $counter"));
+ }
+
+ $SV[$counter]->Spawn ();
+}
+
+# Loops are cheap.
+for ($counter2=0; $counter2 < $number_of_servers; $counter2++)
+{
+ if (PerlACE::waitforfile_timed (PerlACE::LocalFile ("n".$counter2.".ior"),
+ $PerlACE::wait_interval_for_process_creation) == -1)
+ {
+ print STDERR "ERROR: cannot find file <n$counter2.ior>\n";
+ for ($kill_count = 0; $kill_count < $number_of_servers; $kill_count++)
+ {
+ $SV[$kill_count]->Kill (); $SV[$kill_count]->TimedWait (1);
+ }
+ exit 1;
+ }
+}
+
+$CL = new PerlACE::Process ("client2", " -n $number_of_servers");
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+for ($counter = 0; $counter < $number_of_servers; $counter++)
+{
+ $SV[$counter]->WaitKill (10);
+
+ unlink PerlACE::LocalFile ("n".$counter.".ior");
+}
+
+unlink PerlACE::LocalFile ("last_expiration_time");
+unlink PerlACE::LocalFile ("no_more_retries");
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/server.cpp
new file mode 100644
index 00000000000..8c27291400e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/server.cpp
@@ -0,0 +1,241 @@
+// $Id$
+
+#include "Hello.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "ServerORBInitializer.h"
+#include "ServerRequest_Interceptor.h"
+#include "tao/PI/PI.h"
+#include "tao/ORBInitializer_Registry.h"
+
+ACE_RCSID (Hello,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+TAO_IOP::TAO_IOR_Manipulation_var iorm = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+CORBA::Object_ptr
+make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_version, CORBA::Object_ptr ref ACE_ENV_ARG_DECL)
+{
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (1);
+ iors.length(1);
+ iors [0] = CORBA::Object::_duplicate (ref);
+
+ CORBA::Object_var new_ref =
+ iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ //const char *id = "iogr_testing";
+ ft_tag_component.group_domain_id = domain_id;
+
+ // Object group id
+ ft_tag_component.object_group_id = group_id;
+
+ // Version
+ ft_tag_component.object_group_ref_version = group_version;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property
+ CORBA::Boolean retval = iorm->set_property (&iogr_prop,
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Set the primary
+ // See we are setting the second ior as the primary
+ if (retval != 0)
+ {
+ retval = iorm->set_primary (&iogr_prop,
+ new_ref.in (),
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return new_ref._retn ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Server_ORBInitializer *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ Server_ORBInitializer,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ policies[1] =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var my_poa =
+ root_poa->create_POA ("my_poa",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of the new POA is over, so destroy the Policy_ptr's.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Hello *hello_impl;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (orb.in (), Test::Hello::_nil ()),
+ 1);
+
+ PortableServer::ObjectId_var server_id =
+ PortableServer::string_to_ObjectId ("server_id");
+
+ my_poa->activate_object_with_id (server_id.in (),
+ hello_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var hello =
+ my_poa->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get a ref to the IORManipulation object
+ CORBA::Object_var IORM =
+ orb->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow
+ iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var iogr = make_iogr ("Domain_1", 1, 1, orb->string_to_object (ior.in ()) ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var iorgr_string =
+ orb->object_to_string (iogr.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", iorgr_string.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp
new file mode 100644
index 00000000000..43a23d567ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp
@@ -0,0 +1,175 @@
+// $Id$
+
+#include "Hello.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ServerORBInitializer2.h"
+#include "ServerRequest_Interceptor2.h"
+#include "tao/PI/PI.h"
+#include "tao/ORBInitializer_Registry.h"
+
+ACE_RCSID (Hello,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "";
+
+CORBA::ULong my_id_number = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:");
+ int c;
+ ACE_CString ior_file ("n");
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'n':
+ my_id_number = (CORBA::ULong) ACE_OS::atoi (get_opts.opt_arg ());
+ ior_file += get_opts.opt_arg ();
+ ior_file += ".ior";
+ ior_output_file = CORBA::string_dup (ior_file.c_str ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "[-o <iorfile>]"
+ "[-i <server_id>]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Server_ORBInitializer2 *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ Server_ORBInitializer2,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ policies[1] =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var my_poa =
+ root_poa->create_POA ("my_poa",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of the new POA is over, so destroy the Policy_ptr's.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Hello *hello_impl;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (orb.in (), Test::Hello::_nil (), my_id_number),
+ 1);
+
+ PortableServer::ObjectId_var server_id =
+ PortableServer::string_to_ObjectId ("server_id");
+
+ my_poa->activate_object_with_id (server_id.in (),
+ hello_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var hello =
+ my_poa->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s\n",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/Bug_2287_Regression.mpc b/TAO/orbsvcs/tests/Bug_2287_Regression/Bug_2287_Regression.mpc
new file mode 100644
index 00000000000..4138843a913
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/Bug_2287_Regression.mpc
@@ -0,0 +1,39 @@
+// -*- MPC -*-
+// $Id$
+
+project(*IDL): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*Client): taoserver, ftclientorb {
+ after += *IDL
+
+ exename = client
+ Source_Files {
+ client.cpp
+ Hello.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project (*Server) : taoserver, ftclientorb, pi_server {
+ after += *IDL
+
+ exename = server
+ Source_Files {
+ server.cpp
+ Hello.cpp
+ ServerORBInitializer2.cpp
+ ServerRequest_Interceptor2.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/Hello.cpp b/TAO/orbsvcs/tests/Bug_2287_Regression/Hello.cpp
new file mode 100644
index 00000000000..995e0eeed0d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/Hello.cpp
@@ -0,0 +1,32 @@
+//
+// $Id$
+//
+#include "Hello.h"
+
+ACE_RCSID(Hello, Hello, "$Id$")
+
+Hello::Hello (CORBA::ORB_ptr orb, Test::Hello_ptr, CORBA::ULong)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+void
+Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Hello::ping (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return;
+}
+
+void
+Hello::throw_location_forward (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/Hello.h b/TAO/orbsvcs/tests/Bug_2287_Regression/Hello.h
new file mode 100644
index 00000000000..c1d688daa82
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/Hello.h
@@ -0,0 +1,45 @@
+//
+// $Id$
+//
+
+#ifndef HELLO_H
+#define HELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+/// Implement the Test::Hello interface
+class Hello
+ : public virtual POA_Test::Hello
+{
+public:
+ /// Constructor
+ Hello (CORBA::ORB_ptr orb, Test::Hello_ptr server, CORBA::ULong server_id = 0);
+
+ // = The skeleton methods
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void ping (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void throw_location_forward (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to conver strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* HELLO_H */
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2287_Regression/Makefile.am
new file mode 100644
index 00000000000..4e41c8eec08
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/Makefile.am
@@ -0,0 +1,153 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Bug_2287_Regression_IDL.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.Bug_2287_Regression_Client.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ Hello.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ client.cpp \
+ Hello.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.Bug_2287_Regression_Server.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ Hello.cpp \
+ ServerORBInitializer2.cpp \
+ ServerRequest_Interceptor2.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ Hello.h \
+ ServerORBInitializer2.h \
+ ServerRequest_Interceptor2.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/README b/TAO/orbsvcs/tests/Bug_2287_Regression/README
new file mode 100644
index 00000000000..3c77b3edb08
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/README
@@ -0,0 +1,32 @@
+// $Id$
+
+This test provides regression coverage for bugzilla #2287.
+
+See http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=2287 for more.
+
+The server installs a server request interceptor and persistent servant and writes out an IOGR for itself.
+The client installs client side FT support and invokes the method "throw_location_forward" on the IOGR.
+The server request interceptor detects invocations of this method and in response either:
+a/ Throws a location forward back to the original IOGR if cannot determine (from the expiration_time member of the FT request service context) thatthe client must have despatched the request after the expiration time.
+b/ Allows the request to be completed if it can determine absolutely that the request was despatched after the expiration time. This indicates a regression to the client.
+
+A successful outcome is if the client stops following the location forwards once it detects that the expiration time has passed, and a TRANSIENT system exception is recived in the application code.
+
+__Regression Output__
+
+The expiration time has now passed !!
+Expiration time : 133496335605156250
+Time now : 133496335605312500
+Test Failed - REGRESSION !!! Client ORB is still retrying LOCATION_FORWARDs after the expiration time!!
+Expiration time : 133496335605156250
+Time now : 133496335605312500
+REGRESSION - Test has failed !!!
+(3128|3992) server - event loop finished
+Error: REGRESSION identified!!!
+ERROR: client returned 1
+
+__Successful Output__
+
+Client catches a TRANSIENT, as expected. No problem !
+(3528|3532) server - event loop finished
+Test passed !!!
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.cpp b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.cpp
new file mode 100644
index 00000000000..f7a7b408be7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.cpp
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ServerORBInitializer2.h"
+#include "ServerRequest_Interceptor2.h"
+#include "tao/ORB_Constants.h"
+#include "tao/Exception.h"
+
+
+void
+Server_ORBInitializer2::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+}
+
+void
+Server_ORBInitializer2::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_server_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Server_ORBInitializer2::register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr sri =
+ PortableInterceptor::ServerRequestInterceptor::_nil ();
+
+ ACE_NEW_THROW_EX (sri,
+ TAO249_ServerRequest_Interceptor2,
+ CORBA::NO_MEMORY ());
+
+ PortableInterceptor::ServerRequestInterceptor_var
+ server_interceptor = sri;
+
+ info->add_server_request_interceptor (server_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.h b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.h
new file mode 100644
index 00000000000..a98a94523be
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerORBInitializer2.h
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id$
+ */
+//=============================================================================
+#ifndef TAO249_SERVER_ORBINITIALIZER2_H
+#define TAO249_SERVER_ORBINITIALIZER2_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/PI_Server_includeC.h"
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+/// RTCORBA ORB initializer.
+class Server_ORBInitializer2 :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// Register the necessary interceptors.
+ void register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO249_SERVER_ORBINITIALIZER2_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.cpp b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.cpp
new file mode 100644
index 00000000000..226898bcf40
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.cpp
@@ -0,0 +1,176 @@
+// -*- C++ -*-
+
+#include "ServerRequest_Interceptor2.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/IOP_IORC.h"
+#include "tao/ORB_Constants.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/CDR.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "Hello.h"
+#include "ace/OS_NS_sys_time.h"
+#include "tao/PI/PIForwardRequestC.h"
+
+ACE_RCSID (FaultTolerance,
+ TAO249_ServerRequest_Interceptor2,
+ "$Id$")
+
+CORBA::Object_var
+TAO249_ServerRequest_Interceptor2::server_iogr_ = CORBA::Object::_nil ();
+
+TAO249_ServerRequest_Interceptor2::TAO249_ServerRequest_Interceptor2 (void)
+: orb_ (0),
+ expired_ (0)
+{
+}
+
+TAO249_ServerRequest_Interceptor2::~TAO249_ServerRequest_Interceptor2 (void)
+{
+}
+
+char *
+TAO249_ServerRequest_Interceptor2::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO_TAO249_ServerRequest_Interceptor2");
+}
+
+void
+TAO249_ServerRequest_Interceptor2::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ if (ACE_OS::strcmp (op.in (), "throw_location_forward"))
+ {
+ // bail if not the op we are interested in -
+ // avoid excess spurious error clutter when client calls ::shutdown
+ return;
+ }
+
+
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (IOP::FT_REQUEST
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_InputCDR cdr (reinterpret_cast <const char*>
+ (sc->context_data.get_buffer ()
+ ),
+ sc->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+ }
+ ACE_CHECK;
+
+ cdr.reset_byte_order (static_cast <int>(byte_order));
+
+ FT::FTRequestServiceContext ftrsc;
+
+ if ((cdr >> ftrsc) == 0)
+ ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ TimeBase::TimeT now = get_now ();
+
+ if (now > ftrsc.expiration_time)
+ {
+ // We have passed the exp time... there should be no more retries received after this point...
+ if (expired_)
+ {
+ // The client has retried after the expiration time. This is a regression
+ ACE_DEBUG ((LM_ERROR, "Test Failed - REGRESSION !!! Client ORB is still retrying LOCATION_FORWARDs after the expiration time!!\n"));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Expiration time : %Q\n"), ftrsc.expiration_time));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Time now : %Q\n"), now));
+
+ // Let the request 'succeed' rather than throwing a forward exception.
+ return;
+ }
+ else
+ {
+ // A request has been recioved after the expiration time.
+ // This could legitimately happen - it is only definitely a problem if
+ // the client keeps on retrying after now. We set a flag so we can check for this.
+ expired_ = 1;
+ ACE_DEBUG ((LM_DEBUG, "The expiration time has now passed !!\n"));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Expiration time : %Q\n"), ftrsc.expiration_time));
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Time now : %Q\n"), now));
+ }
+ }
+
+ // Let's forward the client back to us again. I would like to be able to make this a PERM
+ // but there's no such animal in the PortableInterceptor module. Plus as we (currently) transform
+ // and marshal *all* forward requests as vanilla LOCATION_FORWARD it doesn't really matter.
+ ACE_THROW (PortableInterceptor::ForwardRequest (server_iogr_.in ()));
+}
+
+TimeBase::TimeT
+TAO249_ServerRequest_Interceptor2::get_now (void)
+{
+ // 1582...
+ const TimeBase::TimeT timeOffset = ACE_UINT64_LITERAL (0x1B21DD213814000);
+
+ // Now in posix
+ ACE_Time_Value time_value = ACE_OS::gettimeofday ();
+
+ TimeBase::TimeT sec_part = time_value.sec ();
+ sec_part = sec_part * 10000000;
+ TimeBase::TimeT usec_part = time_value.usec ();
+ usec_part = usec_part * 10;
+ return (sec_part + usec_part + timeOffset);
+}
+
+void
+TAO249_ServerRequest_Interceptor2::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO249_ServerRequest_Interceptor2::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.h b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.h
new file mode 100644
index 00000000000..b7767f6d798
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/ServerRequest_Interceptor2.h
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id$
+ */
+//=============================================================================
+
+#ifndef TAO249_SERVER_REQUEST_INTERCEPTOR2_H
+#define TAO249_SERVER_REQUEST_INTERCEPTOR2_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/ORB.h"
+#include "tao/PI/PI.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/TimeBaseC.h"
+
+/**
+* $Id$
+*/
+class TAO249_ServerRequest_Interceptor2
+: public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+/// Constructor.
+TAO249_ServerRequest_Interceptor2 (void);
+
+/// Destructor.
+~TAO249_ServerRequest_Interceptor2 (void);
+
+/**
+ * @name Methods Required by the Server Request Interceptor
+ * Interface
+ *
+ * These are methods that must be implemented since they are pure
+ * virtual in the abstract base class. They are the canonical
+ * methods required for all server request interceptors.
+ */
+//@{
+/// Return the name of this ServerRequestinterceptor.
+virtual char * name (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+//@}
+
+static CORBA::Object_var server_iogr_;
+
+protected:
+ TimeBase::TimeT get_now (void);
+
+private:
+
+CORBA::ORB_var orb_;
+
+CORBA::Boolean expired_;
+};
+
+#endif /* TAO249_SERVER_REQUEST_INTERCEPTOR2_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/Test.idl b/TAO/orbsvcs/tests/Bug_2287_Regression/Test.idl
new file mode 100644
index 00000000000..9e1fa22e0be
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/Test.idl
@@ -0,0 +1,24 @@
+//
+// $Id$
+//
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ interface Hello
+ {
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+
+ // Lets make sure things are working
+ void ping ();
+
+ // The client calls this method which will generate
+ // a locate forward to the same IOGR on every invocation
+ // until well after the request expiration time when it will then succeed
+ void throw_location_forward ();
+ };
+};
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_2287_Regression/client.cpp
new file mode 100644
index 00000000000..efc5c8c1da7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/client.cpp
@@ -0,0 +1,110 @@
+// $Id$
+
+#include "TestS.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+#include "Hello.h"
+
+ACE_RCSID(Hello, client, "$Id$")
+
+const char *ior = "file://test.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ CORBA::Boolean result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ // Check this isn't generating transients for any other reason
+ hello->ping (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ ACE_TRY
+ {
+ hello->throw_location_forward (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_ERROR, "REGRESSION - Test has failed !!!\n"));
+ result = 1;
+ }
+ ACE_CATCH (CORBA::TRANSIENT, my_ex)
+ {
+ ACE_UNUSED_ARG (my_ex);
+ ACE_DEBUG ((LM_DEBUG, "Client catches a TRANSIENT, as expected. No problem !\n"));
+ }
+ ACE_ENDTRY;
+
+ hello->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test failed (Not regression) because unexpected exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ if (result)
+ {
+ ACE_DEBUG ((LM_ERROR, "Error: REGRESSION identified!!!\n"));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Test passed !!!\n"));
+ }
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2287_Regression/run_test.pl
new file mode 100755
index 00000000000..de69f709455
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/run_test.pl
@@ -0,0 +1,49 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+unlink $iorfile;
+
+if (PerlACE::is_vxworks_test()) {
+ $SV = new PerlACE::ProcessVX ("server", "-o server.ior");
+}
+else {
+ $SV = new PerlACE::Process ("server", "-o $iorfile");
+}
+$CL = new PerlACE::Process ("client", " -k file://$iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp
new file mode 100644
index 00000000000..eca1cfc94de
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp
@@ -0,0 +1,243 @@
+// $Id$
+
+#include "Hello.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "ServerORBInitializer2.h"
+#include "ServerRequest_Interceptor2.h"
+#include "tao/PI/PI.h"
+#include "tao/ORBInitializer_Registry.h"
+
+ACE_RCSID (Hello,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+TAO_IOP::TAO_IOR_Manipulation_var iorm = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+CORBA::Object_ptr
+make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_version, CORBA::Object_ptr ref ACE_ENV_ARG_DECL)
+{
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (1);
+ iors.length(1);
+ iors [0] = CORBA::Object::_duplicate (ref);
+
+ CORBA::Object_var new_ref =
+ iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ //const char *id = "iogr_testing";
+ ft_tag_component.group_domain_id = domain_id;
+
+ // Object group id
+ ft_tag_component.object_group_id = group_id;
+
+ // Version
+ ft_tag_component.object_group_ref_version = group_version;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property
+ CORBA::Boolean retval = iorm->set_property (&iogr_prop,
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Set the primary
+ // See we are setting the second ior as the primary
+ if (retval != 0)
+ {
+ retval = iorm->set_primary (&iogr_prop,
+ new_ref.in (),
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return new_ref._retn ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Server_ORBInitializer2 *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ Server_ORBInitializer2,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ policies[1] =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var my_poa =
+ root_poa->create_POA ("my_poa",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of the new POA is over, so destroy the Policy_ptr's.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Hello *hello_impl;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (orb.in (), Test::Hello::_nil ()),
+ 1);
+
+ PortableServer::ObjectId_var server_id =
+ PortableServer::string_to_ObjectId ("server_id");
+
+ my_poa->activate_object_with_id (server_id.in (),
+ hello_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var hello =
+ my_poa->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get a ref to the IORManipulation object
+ CORBA::Object_var IORM =
+ orb->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow
+ iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var iogr = make_iogr ("Domain_1", 1, 1, orb->string_to_object (ior.in ()) ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var iorgr_string =
+ orb->object_to_string (iogr.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", iorgr_string.in ());
+ ACE_OS::fclose (output_file);
+
+ TAO249_ServerRequest_Interceptor2::server_iogr_ = CORBA::Object::_duplicate (iogr.in ());
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/Bug_2316_Regression.mpc b/TAO/orbsvcs/tests/Bug_2316_Regression/Bug_2316_Regression.mpc
new file mode 100644
index 00000000000..2b4960fc5cd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/Bug_2316_Regression.mpc
@@ -0,0 +1,36 @@
+// -*- MPC -*-
+// $Id$
+
+project(*IDL): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): orbsvcsexe, portablegroup, portableserver {
+ exename = server
+ after += *IDL
+
+ Source_Files {
+ Test_impl.cpp
+ server.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): orbsvcsexe, portablegroup {
+ exename = client
+ after += *IDL
+
+ Source_Files {
+ client.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2316_Regression/Makefile.am
new file mode 100644
index 00000000000..a04dad99ade
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/Makefile.am
@@ -0,0 +1,130 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Bug_2316_Regression_IDL.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.Bug_2316_Regression_Client.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ TestC.cpp \
+ client.cpp \
+ Test_impl.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Bug_2316_Regression_Server.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ TestC.cpp \
+ TestS.cpp \
+ Test_impl.cpp \
+ server.cpp \
+ Test_impl.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/README b/TAO/orbsvcs/tests/Bug_2316_Regression/README
new file mode 100644
index 00000000000..89f1c090651
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/README
@@ -0,0 +1,26 @@
+$Id$
+
+This client and server in this test both load the UIPMC protocol plug in
+(see svc.conf).
+
+The client creates a MIOP object ref and tests that it can be marshalled
+and demarshalled without problems by passing it over the wire to the server.
+
+_Expected successful result_:
+
+E:\worcvs\tao14\prism\tests\tao277_regression>run_test.pl
+Test passed !!
+
+_Expected regression result_:
+
+E:\worcvs\tao14\prism\tests\tao277_regression>run_test.pl
+TAO (1808|644) ERROR: Could not create all profiles while extracting object
+TAO (1808|644) ERROR: reference from the CDR stream.
+Test Failed - Regression. Sending UIPMC object ref to server failed with:
+(1924|1884) EXCEPTION, Exception :
+
+system exception, ID 'IDL:omg.org/CORBA/MARSHAL:1.0'
+TAO exception, minor code = 0 (unknown location; unspecified errno), completed =
+ NO
+
+ERROR: Test failed - client returned 1
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/Test.idl b/TAO/orbsvcs/tests/Bug_2316_Regression/Test.idl
new file mode 100644
index 00000000000..36820e2b6d1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/Test.idl
@@ -0,0 +1,12 @@
+// $Id$
+
+#ifndef _TEST_IDL_
+#define _TEST_IDL_
+
+interface server
+{
+ void method (in Object obj);
+ oneway void shutdown ();
+};
+
+#endif // _TEST_IDL_
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.cpp b/TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.cpp
new file mode 100644
index 00000000000..d469544e251
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.cpp
@@ -0,0 +1,19 @@
+// $Id$
+
+#include "Test_impl.h"
+
+void Server_impl::shutdown ()
+ throw (CORBA::SystemException)
+{
+ this->orb_->shutdown (0);
+}
+
+Server_impl::Server_impl (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+void Server_impl::method (CORBA::Object_ptr)
+ throw (CORBA::SystemException)
+{
+}
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.h b/TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.h
new file mode 100644
index 00000000000..41c11b90668
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/Test_impl.h
@@ -0,0 +1,19 @@
+// $Id$
+
+#ifndef TEST_IMPL_HPP
+#define TEST_IMPL_HPP
+
+#include "TestS.h"
+
+class Server_impl : public virtual POA_server
+{
+public:
+ Server_impl (CORBA::ORB_ptr orb);
+ virtual void method (CORBA::Object_ptr object) throw (CORBA::SystemException);
+ virtual void shutdown () throw (CORBA::SystemException);
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif /* TEST_IMPL_HPP */
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_2316_Regression/client.cpp
new file mode 100644
index 00000000000..183bc338fd4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/client.cpp
@@ -0,0 +1,55 @@
+// $Id$
+
+#include "Test_impl.h"
+#include "ace/OS_NS_stdio.h"
+
+const char *ior_callback = "callback.ior";
+const char *ior_server = "file://server.ior";
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+ poa_manager->activate ();
+
+ const char* uipmc_ior = "corbaloc:miop:1.0@1.0-domain-1/127.0.0.1:23232";
+ CORBA::Object_var obj =orb->string_to_object (uipmc_ior);
+
+ CORBA::Object_var tmp = orb->string_to_object (ior_server);
+ server_var server = server::_narrow (tmp.in ());
+
+ try
+ {
+ server->method (obj.in());
+
+ ACE_DEBUG ((LM_DEBUG, "Test passed !!\n"));
+ }
+ catch (const CORBA::SystemException& marshal)
+ {
+ ACE_DEBUG ((LM_ERROR, "Test Failed - Regression. "
+ "Sending UIPMC object ref to server failed with:\n"));
+ ACE_PRINT_EXCEPTION (marshal, "Exception : \n");
+ result = 1;
+ }
+
+ server->shutdown ();
+ }
+ catch(const CORBA::SystemException& e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Unexpected exception - not a regression.\n");
+ result = 1;
+ }
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2316_Regression/run_test.pl
new file mode 100755
index 00000000000..ba9d7040c5a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/run_test.pl
@@ -0,0 +1,42 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+unlink $iorfile;
+$status = 0;
+
+$SV = new PerlACE::Process ("server");
+$CL = new PerlACE::Process ("client");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: Test failed. Not regression. Cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: Test failed - client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: During clean up - killing server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_2316_Regression/server.cpp
new file mode 100644
index 00000000000..76443812a25
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/server.cpp
@@ -0,0 +1,38 @@
+// $Id$
+
+#include "Test_impl.h"
+#include "ace/OS_NS_stdio.h"
+
+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");
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ());
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager ();
+ poa_manager->activate ();
+
+ Server_impl* server_obj = new Server_impl(orb.in());
+ server_var server = server_obj->_this();
+ CORBA::String_var ior = orb->object_to_string (server.in ());
+
+ FILE *output_file = ACE_OS::fopen ("server.ior", "w");
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ orb->run ();
+ orb->destroy ();
+ }
+ catch(...)
+ {
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2316_Regression/svc.conf b/TAO/orbsvcs/tests/Bug_2316_Regression/svc.conf
new file mode 100644
index 00000000000..65508eb6d59
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2316_Regression/svc.conf
@@ -0,0 +1,4 @@
+# $Id$
+dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() ""
+static Resource_Factory "-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory"
+dynamic PortableGroup_Loader Service_Object * TAO_PortableGroup:_make_TAO_PortableGroup_Loader() ""
diff --git a/TAO/orbsvcs/tests/Bug_2377_Regression/Bug_2377_Regression.mpc b/TAO/orbsvcs/tests/Bug_2377_Regression/Bug_2377_Regression.mpc
new file mode 100644
index 00000000000..6616beb3c5d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2377_Regression/Bug_2377_Regression.mpc
@@ -0,0 +1,9 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Test) : orbsvcsexe, taoidldefaults, portablegroup, portableserver {
+ exename = uipmc_test
+ Source_Files {
+ Hello.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2377_Regression/Hello.cpp b/TAO/orbsvcs/tests/Bug_2377_Regression/Hello.cpp
new file mode 100644
index 00000000000..03cb59b88e1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2377_Regression/Hello.cpp
@@ -0,0 +1,340 @@
+//
+// $Id$
+//
+
+#include "HelloS.h"
+
+#include "ace/SString.h"
+#include "ace/Log_Msg.h"
+#include "ace/Task.h"
+#include "ace/Mutex.h"
+#include "ace/streams.h"
+#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/debug.h"
+#include "tao/corba.h"
+#include "orbsvcs/PortableGroup/MIOP.h"
+#include "orbsvcs/PortableGroup/GOA.h"
+
+#define CLIENT_SLEEP_TIME 100 /* in milliseconds */
+#define NB_HELLO_CLIENT_THREAD 8
+#define NB_HELLO_CALLS 100
+
+void
+sleep(int millisec)
+{
+ ACE_Time_Value tv(millisec / 1000, (millisec % 1000) * 1000);
+
+ ACE_OS::sleep ((const ACE_Time_Value &) tv);
+}
+
+class MessageLog
+{
+ private:
+ bool *sent;
+ bool *recv;
+ int extent;
+
+ public:
+ MessageLog(int num)
+ {
+ extent = num + 1;
+ sent = new bool[extent];
+ recv = new bool[extent];
+
+ int i;
+
+ for (i = 0; i < extent; i++)
+ {
+ sent[i] = false;
+ recv[i] = false;
+ }
+ }
+
+ void
+ register_message_send(int message_num)
+ {
+ sent[message_num] = true;
+ }
+
+ void
+ register_message_recv(int message_num)
+ {
+ recv[message_num] = true;
+ }
+
+ bool
+ lost_messages()
+ {
+ bool lm = false;
+ int i;
+
+ for (i = 0; i < extent; i++)
+ {
+ if (sent[i] && !recv[i])
+ {
+ // message lost
+ lm = true;
+ break;
+ }
+ }
+ return lm;
+ }
+
+ void
+ report_lost_messages(const ACE_TCHAR *int_format_string)
+ {
+ int i;
+
+ for (i = 0; i < extent; i++)
+ {
+ if (sent[i] && !recv[i])
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ int_format_string,
+ i));
+ }
+ }
+ }
+};
+
+namespace Test
+{
+ class Hello_impl
+ : public virtual POA_Test::Hello
+ {
+ private:
+ MessageLog *logger;
+ public:
+ Hello_impl(MessageLog *log)
+ : logger(log)
+ {
+ }
+
+ void say_hello(CORBA::Short count) throw(CORBA::SystemException)
+ {
+ logger->register_message_recv(count);
+ if (TAO_debug_level == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("R")));
+ }
+ }
+ };
+}
+
+class OrbRunThread
+: public ACE_Task_Base
+{
+ public:
+ OrbRunThread(CORBA::ORB_ptr orb)
+ : m_orb(CORBA::ORB::_duplicate(orb))
+ {
+ }
+ virtual int svc()
+ {
+ m_orb->run();
+ return 1;
+ }
+ private:
+ CORBA::ORB_var m_orb;
+};
+
+class HelloClientThread
+: public ACE_Task_Base
+{
+ public:
+ HelloClientThread(Test::Hello_ptr hello, MessageLog *log)
+ : m_hello(Test::Hello::_duplicate(hello)),
+ logger(log),
+ m_count(0)
+ {
+ }
+ virtual int svc()
+ {
+ while (m_count < NB_HELLO_CALLS)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ int count;
+ {
+ // get your message number here
+ ACE_Guard < ACE_Mutex > guard(m_mutex);
+ count = m_count++;
+ if (TAO_debug_level == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("s")));
+ }
+ }
+ {
+ // send your message number here
+#ifdef SEQUENCED_SAY_HELLO_REQUIRED
+ ACE_Guard < ACE_Mutex > guard(m_mutex);
+#endif /* SEQUENCED_SAY_HELLO_REQUIRED */
+ logger->register_message_send(count);
+ m_hello->say_hello(count);
+ }
+ sleep(CLIENT_SLEEP_TIME);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Exception thrown during say_hello()\n"));
+ }
+ ACE_ENDTRY;
+ }
+ return 1;
+ }
+ private:
+ Test::Hello_var m_hello;
+ MessageLog *logger;
+ int m_count;
+ ACE_Mutex m_mutex;
+};
+
+int
+main(int argc, char *argv[])
+{
+ MessageLog *logger = 0;
+ CORBA::ORB_var orb = CORBA::ORB::_nil();
+ int exit_code = 0;
+
+ OrbRunThread *orbThread = 0;
+ Test::Hello_impl * hello_i = 0;
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("<<< %s Started - \"s\" = message sent \"R\" = message received >>>\n"), argv[0]));
+
+ ACE_TRY_NEW_ENV
+ {
+ /*** in svc.conf
+dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() ""
+static Resource_Factory "-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory"
+dynamic PortableGroup_Loader Service_Object * TAO_PortableGroup:_make_TAO_PortableGroup_Loader() ""
+static Server_Strategy_Factory "-ORBConcurrency reactive -ORBPOALock thread -ORBAllowReactivationOfSystemids 1"
+static Client_Strategy_Factory "-ORBProfileLock thread -ORBClientConnectionHandler MT"
+ ***/
+
+ // Initialize the ORB
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" - ORB_init\n")));
+ }
+ orb = CORBA::ORB_init(argc, argv);
+
+ // Get the root POA
+ CORBA::Object_var obj_root =
+ orb->resolve_initial_references("RootPOA");
+ PortableGroup::GOA_var rootPOA =
+ PortableGroup::GOA::_narrow(obj_root.in());
+
+ // Activate the POA manager
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" - POA manager activation\n")));
+ }
+ PortableServer::POAManager_var poaManager = rootPOA->the_POAManager();
+
+ poaManager->activate();
+
+ // create Message Log
+ logger = new MessageLog(NB_HELLO_CALLS);
+
+ // create Hello servant
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" - create Hello servant\n")));
+ }
+ hello_i = new Test::Hello_impl(logger);
+
+ // activate Hello Object
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" - activate Hello object\n")));
+ }
+ PortableServer::ObjectId_var obj_id =
+ rootPOA->activate_object(hello_i);
+
+ // create MIOP reference
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" - create MIOP reference\n")));
+ }
+ ACE_CString multicast_addr("corbaloc:miop:1.0@1.0-cdmwftdomain-1/225.1.1.8:5555");
+ CORBA::Object_var miop_ref =
+ orb->string_to_object(multicast_addr.c_str());
+
+ // associate MIOP reference with Hello object
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT (" - associate MIOP reference with Hello object\n")));
+ }
+ rootPOA->associate_reference_with_id(miop_ref.in(), obj_id.in ());
+
+ // create Hello reference
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" - create Hello reference\n")));
+ }
+ Test::Hello_var hello = Test::Hello::_unchecked_narrow(miop_ref.in());
+
+ // start ORB run() in a thread
+ orbThread = new OrbRunThread(orb.in());
+ orbThread->activate(THR_NEW_LWP, 1);
+
+ // create client threads
+ HelloClientThread *helloThread = new HelloClientThread(hello.in(),
+ logger);
+
+ // start client threads
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("--------------------------------------------------\n")));
+ helloThread->activate(THR_NEW_LWP, NB_HELLO_CLIENT_THREAD);
+ helloThread->wait();
+ delete helloThread;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Exception thrown during main()\n"));
+ exit_code = 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\n--------------------------------------------------\n")));
+ if (logger->lost_messages())
+ {
+ logger->report_lost_messages(ACE_TEXT ("LOST ==> say_hello() %d\n"));
+ exit_code = 1;
+ }
+ else if (exit_code == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("<<< %s - no lost messages >>>\n"), argv[0]));
+ }
+
+ delete logger;
+
+ if (orbThread != 0)
+ {
+ orb->shutdown(true);
+ orbThread->wait();
+ delete orbThread;
+ delete hello_i;
+ }
+ if (!CORBA::is_nil(orb.in()))
+ {
+ ACE_TRY_NEW_ENV
+ {
+ orb->destroy();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Exception thrown during orb check\n"));
+ exit_code = 1;
+ }
+ ACE_ENDTRY;
+ }
+ exit(exit_code);
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2377_Regression/Hello.idl b/TAO/orbsvcs/tests/Bug_2377_Regression/Hello.idl
new file mode 100644
index 00000000000..f6b6d7eb0b7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2377_Regression/Hello.idl
@@ -0,0 +1,9 @@
+// $Id$
+module Test {
+
+ interface Hello {
+ oneway void say_hello(in short count);
+ };
+
+
+};
diff --git a/TAO/orbsvcs/tests/Bug_2377_Regression/Makefile.am b/TAO/orbsvcs/tests/Bug_2377_Regression/Makefile.am
new file mode 100644
index 00000000000..0eaedade3c5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2377_Regression/Makefile.am
@@ -0,0 +1,97 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Bug_2377_Regression_Test.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES = \
+ HelloC.cpp \
+ HelloC.h \
+ HelloC.inl \
+ HelloS.cpp \
+ HelloS.h \
+ HelloS.inl \
+ HelloS_T.cpp \
+ HelloS_T.h \
+ HelloS_T.inl
+
+CLEANFILES = \
+ Hello-stamp \
+ HelloC.cpp \
+ HelloC.h \
+ HelloC.inl \
+ HelloS.cpp \
+ HelloS.h \
+ HelloS.inl \
+ HelloS_T.cpp \
+ HelloS_T.h \
+ HelloS_T.inl
+
+HelloC.cpp HelloC.h HelloC.inl HelloS.cpp HelloS.h HelloS.inl HelloS_T.cpp HelloS_T.h HelloS_T.inl: Hello-stamp
+
+Hello-stamp: $(srcdir)/Hello.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/Hello.idl
+ @touch $@
+
+noinst_PROGRAMS = uipmc_test
+
+uipmc_test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+uipmc_test_SOURCES = \
+ Hello.cpp \
+ HelloC.cpp \
+ HelloS.cpp \
+ HelloC.h \
+ HelloC.inl \
+ HelloS.h \
+ HelloS.inl \
+ HelloS_T.h \
+ HelloS_T.inl
+
+uipmc_test_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Bug_2377_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2377_Regression/run_test.pl
new file mode 100755
index 00000000000..322eeff3e7e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2377_Regression/run_test.pl
@@ -0,0 +1,32 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$dum_core = PerlACE::LocalFile ("core");
+$status = 0;
+unlink $dum_core;
+
+$HELLO = new PerlACE::Process ("uipmc_test", "");
+
+$prog = $HELLO->SpawnWaitKill (20);
+
+if ($prog != 0) {
+ print STDERR "ERROR: uipmc_test returned $prog\n";
+ $status = 1;
+}
+
+if (-e $dum_core) {
+ print STDERR "ERROR: uipmc_test core dumped\n";
+ $status = 1;
+}
+
+unlink $dum_core;
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/Bug_2377_Regression/svc.conf b/TAO/orbsvcs/tests/Bug_2377_Regression/svc.conf
new file mode 100644
index 00000000000..1510ade0e8f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2377_Regression/svc.conf
@@ -0,0 +1,5 @@
+dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() ""
+static Resource_Factory "-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory"
+dynamic PortableGroup_Loader Service_Object * TAO_PortableGroup:_make_TAO_PortableGroup_Loader() ""
+static Server_Strategy_Factory "-ORBConcurrency reactive -ORBPOALock thread -ORBAllowReactivationOfSystemids 1"
+static Client_Strategy_Factory "-ORBProfileLock thread -ORBClientConnectionHandler MT"
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_client.cpp b/TAO/orbsvcs/tests/Concurrency/CC_client.cpp
new file mode 100644
index 00000000000..93760c93800
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_client.cpp
@@ -0,0 +1,475 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests
+//
+// = FILENAME
+// CC_client.h
+//
+// = DESCRIPTION
+// This is the test class for the concurrency service. The class
+// implements a client to the concurrency service.
+// This file contains the main function for the test.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "CC_client.h"
+
+#include "tao/debug.h"
+
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/os_include/os_ctype.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_fcntl.h"
+
+ACE_RCSID(Concurrency, CC_client, "$Id$")
+
+// Constructor.
+CC_Client::CC_Client (void)
+ : naming_service_ (0),
+ cc_factory_ior_file_ (0),
+ cc_factory_key_ (0),
+ f_handle_ (ACE_INVALID_HANDLE),
+ shutdown_ (0),
+ use_naming_service_ (1),
+ run_basic_tests_ (0),
+ run_extended_tests_ (0),
+ use_script_file_ (0),
+ script_file_ (0)
+{
+}
+
+CC_Client::~CC_Client (void)
+{
+ // Free resources and close the ior files.
+ if (this->cc_factory_ior_file_)
+ ACE_OS::fclose (this->cc_factory_ior_file_);
+
+ if (this->f_handle_ != ACE_INVALID_HANDLE)
+ ACE_OS::close (this->f_handle_);
+
+ if (this->cc_factory_key_ != 0)
+ ACE_OS::free (this->cc_factory_key_);
+
+ if (naming_service_!=0)
+ delete naming_service_;
+}
+
+// Reads the lock set factory ior from a file
+
+int
+CC_Client::read_ior (char *filename)
+{
+ // Open the file for reading.
+ this->f_handle_ = ACE_OS::open (filename,0);
+
+ if (this->f_handle_ == ACE_INVALID_HANDLE)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ filename),
+ -1);
+ ACE_Read_Buffer ior_buffer (this->f_handle_);
+ this->cc_factory_key_ = ior_buffer.read ();
+
+ if (this->cc_factory_key_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to allocate memory to read ior: %p\n"),
+ -1);
+ return 0;
+}
+
+// Parses the command line arguments and returns an error status.
+
+int
+CC_Client::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "dc:sf:k:xbhe:");
+ int c;
+ int result;
+
+ if(argc_==1) // No arguments given on command line
+ {
+ print_usage();
+ return -1;
+ }
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'b': // debug flag
+ this->run_basic_tests_ = 1;
+ break;
+ case 'c':
+ this->use_script_file_ = 1;
+ this->script_file_ = ACE_OS::strdup (get_opts.opt_arg ());
+ break;
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case 'e': // debug flag
+ run_extended_tests_ = 1;
+ this->extended_tests_params_ = ACE_OS::strdup (get_opts.opt_arg ());
+ break;
+ case 'f': // read the IOR from the file.
+ result = this->read_ior (get_opts.opt_arg ());
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to read ior from %s : %p\n",
+ get_opts.opt_arg ()),
+ -1);
+ break;
+ case 'k': // read the cubit IOR from the command-line.
+ this->cc_factory_key_ =
+ ACE_OS::strdup (get_opts.opt_arg ());
+ break;
+ case 'x':
+ this->shutdown_ = 1;
+ break;
+ case 's': // Don't use the TAO Naming Service.
+ this->use_naming_service_ = 0;
+ break;
+ case 'h':
+ default:
+ print_usage ();
+ ACE_ERROR_RETURN ((LM_ERROR, ""), -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Execute client example code.
+
+int
+CC_Client::run (void)
+{
+ int tests_run = 0;
+ // Tells whether any tests have been run
+
+ int success = CC_SUCCESS;
+ // Did test succeed?
+
+ if (this->run_basic_tests_ && success == CC_SUCCESS)
+ {
+ success = run_basic_tests ();
+ if(success==CC_FAIL)
+ ACE_DEBUG((LM_DEBUG, "Basic tests did not succeed\n"));
+ tests_run = 1;
+ }
+
+ if (this->run_extended_tests_ && success == CC_SUCCESS)
+ {
+ success = run_extended_tests (this->extended_tests_params_);
+ if(success==CC_FAIL)
+ ACE_DEBUG((LM_DEBUG, "Extended tests did not succeed\n"));
+ tests_run = 1;
+ }
+
+ if(this->use_script_file_ && success == CC_SUCCESS)
+ {
+ cmdlist = new CC_CommandList();
+ FILE *f;
+
+ // Open the command file for parsing if the filename!=stdin
+ if(ACE_OS::strcmp(this->script_file_, "stdin")!=0)
+ {
+ f = ACE_OS::fopen(this->script_file_, "r");
+ if(f==0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s\n",
+ this->script_file_),
+ -1);
+ ace_cc_yyin = f;
+ }
+ ace_cc_yyparse();
+ }
+
+ // Other tests go here
+ // if (other_test_flag && success == CC_SUCCESS) ...
+
+ if (this->shutdown_)
+ // @@TAO is this needed??
+
+ if (tests_run == 0)
+ {
+ print_usage ();
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "No tests given\n"),
+ -1);
+ }
+
+ return success;
+}
+
+// This function runs basic tests concerned with only one lock set
+
+int
+CC_Client::run_basic_tests (void)
+{
+ Test_Single_Lock_With_Mode t1 (naming_service_,
+ CosConcurrencyControl::read);
+ Test_Single_Lock_With_Mode t2 (naming_service_,
+ CosConcurrencyControl::write);
+ Test_Single_Lock_With_Mode t3 (naming_service_,
+ CosConcurrencyControl::upgrade);
+ Test_Single_Lock_With_Mode t4 (naming_service_,
+ CosConcurrencyControl::intention_read);
+ Test_Single_Lock_With_Mode t5 (naming_service_,
+ CosConcurrencyControl::intention_write);
+ // This test should be run for several different lock mode, but
+ // since we do not support
+ Test_Release_Not_Held_Lock t6 (naming_service_,
+ CosConcurrencyControl::read);
+ if (t1.run () == CC_SUCCESS &&
+ t2.run () == CC_SUCCESS &&
+ t3.run () == CC_SUCCESS &&
+ t4.run () == CC_SUCCESS &&
+ t5.run () == CC_SUCCESS &&
+ t6.run () == CC_SUCCESS )
+ return CC_SUCCESS;
+ else
+ return CC_FAIL;
+}
+
+int
+CC_Client::check_extended_test_params(char *params)
+{
+ // Format (regexp): [0-9]+;.*;.*
+ int no_of_params = 0;
+ char *cp = params; // pointer to walk along the string
+ enum {TAO_START, TAO_NUMBER, TAO_ARG, TAO_ERROR} state = TAO_START;
+
+ while(*cp!='\0')
+ {
+ switch(state)
+ {
+ case TAO_START:
+ if(isdigit(*cp))
+ state = TAO_NUMBER;
+ else
+ state = TAO_ERROR;
+ break;
+
+ case TAO_NUMBER:
+ if((*cp)==';')
+ {
+ state = TAO_ARG;
+ no_of_params++;
+ }
+ else
+ if(!isdigit(*cp))
+ state = TAO_ERROR;
+ break;
+
+ case TAO_ARG:
+ if((*cp)==';')
+ {
+ no_of_params++;
+ }
+ break;
+
+ case TAO_ERROR:
+ return -1;
+ // break;
+
+ default:
+ ACE_ERROR_RETURN((LM_ERROR,
+ "CC_Client::check_extended_test_params\n"), -1);
+ }
+ cp++;
+ }
+ if (state==TAO_ERROR) // there was only one character given and it was wrong
+ return -1;
+ else
+ return no_of_params;
+}
+
+int
+CC_Client::run_extended_tests (char *params)
+{
+ int success = CC_FAIL;
+ int no_of_args = 0;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Params: %s\n",
+ params));
+
+ no_of_args = check_extended_test_params(params);
+ if(no_of_args==-1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Error in parameter string (%s). Format: '<test#>;<arg1>;<arg2>'\n", params), CC_FAIL);
+ }
+
+ ACE_DEBUG((LM_DEBUG, "Number of arguments: %i\n", no_of_args));
+
+ char *cmd = ACE_OS::strtok (params, ";");
+ char *arg1 = ACE_OS::strtok (0, ";");
+ // char *arg2 = ACE_OS::strtok (0, ";");
+
+ // A possible scenario using test 1,2, and 3 Create and lock the
+ // lock set with the name 'Name'
+ // ./CC_client -e '1;Name'
+ // Try to lock the same lock set. The process will hang
+ // ./CC_client -e '2:Name'
+ // Unlocks the lock set. Now test 2 will continue.
+ // ./CC_client -e '3:Name'
+
+ if (ACE_OS::strcmp (cmd, "1") == 0)
+ {
+ Test_Setup_LockSet t1 (naming_service_, arg1);
+ success = t1.run ();
+ }
+
+ if (ACE_OS::strcmp (cmd, "2") == 0)
+ {
+ Test_Use_Already_Created_LockSet t2 (naming_service_, arg1);
+ success = t2.run ();
+ }
+
+ if (ACE_OS::strcmp (cmd, "3") == 0)
+ {
+ Test_Unlock_Already_Created_LockSet t3 (naming_service_, arg1);
+ success = t3.run ();
+ }
+
+ return success;
+}
+
+void
+CC_Client::print_usage (void)
+{
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s"
+ " [-b]"
+ " [-c] cc-test-script"
+ " [-d]"
+ " [-f cc_factory-obj-ref-key-file]"
+ " [-k cc-obj-ref-key]"
+ " [-x]"
+ " [-s]"
+ "\n",
+ this->argv_ [0]));
+}
+
+int
+CC_Client::init_naming_service (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_NEW_RETURN (naming_service_,
+ CC_naming_service,
+ -1);
+
+ this->naming_service_->Init (this->orb_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+CC_Client::init (int argc, char **argv)
+{
+ int naming_result;
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Retrieve the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "internet"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse command line and verify parameters.
+ if (this->parse_args () == -1)
+ return -1;
+
+ if (this->use_naming_service_)
+ {
+ naming_result = this->init_naming_service ();
+ if (naming_result < 0)
+ return naming_result;
+ }
+ else
+ {
+ if (this->cc_factory_key_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: no lock set factory key specified\n",
+ this->argv_[0]),
+ -1);
+
+
+ CORBA::Object_var factory_object =
+ this->orb_->string_to_object (this->cc_factory_key_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if 0
+ // The test cannot currently run without the naming service.
+ this->factory_ =
+ CosConcurrencyControl::LockSetFactory::_narrow
+ (factory_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->factory_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "invalid factory key <%s>\n",
+ this->cc_factory_key_),
+ -1);
+#endif /* 0 */
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Factory received OK\n"));
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "CC_Client::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// This function runs the test.
+
+int
+main (int argc, char **argv)
+{
+ CC_Client cc_client;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n \t CosConcurrencyControl: client \n\n"));
+
+ if (cc_client.init (argc, argv) == -1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Did not initialize correctly\n"));
+ return 1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Running the test\n"));
+ return cc_client.run ();
+ }
+}
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_client.h b/TAO/orbsvcs/tests/Concurrency/CC_client.h
new file mode 100644
index 00000000000..a81df69daa0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_client.h
@@ -0,0 +1,142 @@
+// -*- c++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Concurrency
+//
+// = FILENAME
+// CC_client.h
+//
+// = DESCRIPTION
+// This class implements a client used to test the CosConcurrency
+// service.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "ace/Get_Opt.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosConcurrencyControlC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "CC_tests.h"
+#include "CC_naming_service.h"
+#include "CC_command.h"
+#include "CC_command.tab.h"
+
+#ifndef _CC_CLIENT_H_
+#define _CC_CLIENT_H_
+
+// Stuff to be used by the command file parser
+int ace_cc_yyparse(void);
+int line_no = 1;
+char line_buf[500];
+CC_CommandList *cmdlist;
+extern FILE *ace_cc_yyin;
+// end of parser stuff
+
+
+class CC_Client
+{
+ // = TITLE
+ // Defines a class that encapsulates the behaviour of a clien of
+ // the concurrency service.
+ //
+ // = DESCRIPTION
+ // This class declares an interface to run the test client for
+ // the concurrency service.
+public:
+ // = Initialization and termination methods.
+ CC_Client (void);
+ // Default constructor.
+
+ ~CC_Client (void);
+ // Destructor.
+
+ int run (void);
+ // Run the test.
+
+ int init (int argc, char **argv);
+ // Initialize the test with the parameters from the command line.
+
+private:
+ int init_naming_service (void);
+ // Function to initialize the naming service.
+
+ int parse_args (void);
+ // Function to parse the command line arguments.
+
+ int read_ior (char *filename);
+ // Function to read the ior from the given file.
+
+ int run_basic_tests (void);
+ // Runs the basic tests (on a single lock set). Returns CC_SUCCESS
+ // upon success CC_FAIL otherwise.
+
+ int run_extended_tests (char *params);
+ // Runs the extended tests (on more lock sets). Returns CC_SUCCESS
+ // upon success CC_FAIL otherwise.
+
+ int check_extended_test_params(char *params);
+ // Checks the parameters given to the run_extended_tests() function.
+ // returns -1 if an error is found.
+
+ CC_naming_service *naming_service_;
+ // A pointer to the naming service used for this test.
+
+ FILE *cc_factory_ior_file_;
+ // File from which to obtain the IOR.
+
+ char *cc_factory_key_;
+ // The factory key for the lock set factory.
+
+ ACE_HANDLE f_handle_;
+ // File handle to read the IOR.
+
+ int shutdown_;
+ // Flag to tell server to shutdown.
+
+ CORBA::ORB_var orb_;
+ // Remember our orb.
+
+ // CosConcurrencyControl::LockSetFactory_var factory_;
+ // factory pointer for the lock set. @@TAO maybe to be used when naming
+ // service is not used (for simple testing)
+
+ int argc_;
+ // The number of arguments passed on the command line.
+
+ char **argv_;
+ // The arguments from the command line.
+
+ int use_naming_service_;
+ // Flag to tell the client whether to use the naming service or not
+ // to find the concurrency control factory.
+
+ int run_basic_tests_;
+ // flag to tell which test should be run.
+
+ int run_extended_tests_;
+ // flag to tell which test should be run.
+
+ char *extended_tests_params_;
+ // Parameters to the extended tests. The parameters are of the
+ // following format: <test>:<parm1>:<parm2>...
+
+ int use_script_file_;
+ // Flag to tell whethter to use a script file to run the tests.
+
+ char *script_file_;
+ // The script file to run
+
+ void print_usage (void);
+ // Prints out the options to the program.
+};
+#endif /* !defined (_CC_CLIENT_H_) */
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_command.cpp b/TAO/orbsvcs/tests/Concurrency/CC_command.cpp
new file mode 100644
index 00000000000..fda16fbaa42
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_command.cpp
@@ -0,0 +1,684 @@
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests
+//
+// = FILENAME
+// CC_command.cpp
+//
+// = DESCRIPTION
+// This is the command classes for the test of the concurrency service.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "CC_command.h"
+#include "CC_test_utils.h"
+#include "CC_naming_service.h"
+#include "ace/ACE.h"
+#include "ace/Process.h"
+#include "ace/Log_Msg.h"
+#include "orbsvcs/CosConcurrencyControlC.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (Concurrency,
+ CC_command,
+ "$Id$")
+
+
+CC_Command::~CC_Command(void)
+{
+}
+
+int CC_Command::execute()
+{
+ return 0;
+}
+
+CC_Command::CC_Command(void)
+{
+}
+
+CosConcurrencyControl::LockSet_var
+CC_Command::GetLockSet (const char *lock_set_name
+ ACE_ENV_ARG_DECL)
+{
+ CosConcurrencyControl::LockSet_var ccls_ret;
+
+ ACE_TRY
+ {
+ if(ACE_OS::strcmp(lock_set_name, "")!=0)
+ {
+ CORBA::Object_var ccls_obj =
+ CC_naming_service::Instance()->get_obj_from_name ("",
+ lock_set_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ccls_ret =
+ CosConcurrencyControl::LockSet::_narrow (ccls_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // No lock set name was given. Use the global lock set.
+ if(cc_lockset_.in()==0)
+ {
+ ACE_THROW_RETURN (CORBA::UNKNOWN (), 0);
+ }
+ else
+ ccls_ret = cc_lockset_.in ();
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+
+ return ccls_ret;
+}
+
+CORBA::Exception *CC_Command::excep_ = 0;
+
+CosConcurrencyControl::LockSet_var CC_Command::cc_lockset_(0);
+
+CC_Start_Cmd::CC_Start_Cmd (const char *config_file_name)
+ : cfg_name_ (ACE_OS::strdup (config_file_name))
+{
+ // printf("CC_Start_Cmd::CC_Start_Cmd: config: %s\n", config_file_name);
+}
+
+CC_Start_Cmd::~CC_Start_Cmd()
+{
+ // cfg_name_ is allocated in the lexer with strdup
+ if (cfg_name_)
+ {
+ ACE_OS::free(cfg_name_);
+ cfg_name_ = 0;
+ }
+}
+
+int CC_Start_Cmd::execute(void)
+{
+ if (excep_)
+ {
+ printf ("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf ("Executing start command (script file: %s)\n", cfg_name_);
+
+ char cmd_line[1024];
+ int success = ACE_OS::sprintf(&cmd_line[0], "%s -c %s",
+ "./CC_client", cfg_name_);
+ if(success>=1024 || success==-1)
+ ACE_ERROR_RETURN((LM_ERROR, "Creation of process failed: %s\n",
+ cmd_line), 0);
+
+ ACE_Process new_process;
+ ACE_Process_Options options;
+ options.command_line(cmd_line);
+
+ if(new_process.spawn(options) == -1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR, "Creation of process failed: %s\n",
+ cmd_line), 0);
+ }
+ return 1; // CC_SUCCESS
+}
+
+CC_CreateLockSet_Cmd::CC_CreateLockSet_Cmd (const char *lock_set_name)
+ : name_ (ACE_OS::strdup (lock_set_name))
+{
+ // printf("CC_CreateLockSet_Cmd::CC_CreateLockSet_Cmd: lock set: %s\n",
+ // lock_set_name);
+}
+
+CC_CreateLockSet_Cmd::~CC_CreateLockSet_Cmd()
+{
+ // name_ is allocated in the lexer with strdup
+ if(name_)
+ {
+ ACE_OS::free(name_);
+ name_ = 0;
+ }
+}
+
+int CC_CreateLockSet_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf("Executing create command (lock set: %s)\n", name_);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosConcurrencyControl::LockSet_ptr lock_set =
+ CC_TestUtils::create_lock_set();
+ if(ACE_OS::strcmp(name_,"")!=0)// Do not bind an empty name
+ {
+ CC_naming_service::Instance()->bind_name(name_,
+ lock_set ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // We did not specify a name => the global lock set variable is set
+ cc_lockset_ = lock_set;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_CreateLockSet_Cmd::execute(void)");
+ }
+ ACE_ENDTRY;
+
+ return 1; // CC_SUCCESS
+}
+
+CC_Lock_Cmd::CC_Lock_Cmd (const char *lock_set_name,
+ CosConcurrencyControl::lock_mode mode)
+ : name_ (ACE_OS::strdup (lock_set_name)),
+ mode_(mode)
+{
+ // printf("CC_Lock_Cmd::CC_Lock_Cmd: lock set: %s, mode: %s\n",
+ // lock_set_name, CC_TestUtils::get_lock_mode_name(mode));
+}
+
+CC_Lock_Cmd::~CC_Lock_Cmd()
+{
+ ACE_OS::free (this->name_);
+}
+
+int CC_Lock_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf("Executing lock command (lock set: %s, mode: %s)\n",
+ name_, CC_TestUtils::get_lock_mode_name(mode_));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosConcurrencyControl::LockSet_var ccls =
+ GetLockSet(name_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ccls->lock (mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_Lock_Cmd::execute(void)");
+ return 0;
+ }
+ ACE_ENDTRY;
+ return 1; // CC_SUCCESS
+}
+
+CC_UnLock_Cmd::CC_UnLock_Cmd (const char *lock_set_name,
+ CosConcurrencyControl::lock_mode mode)
+ : name_ (ACE_OS::strdup (lock_set_name)),
+ mode_ (mode)
+{
+ // printf("CC_UnLock_Cmd::CC_UnLock_Cmd: lock set: %s, mode: %s\n",
+ // lock_set_name, CC_TestUtils::get_lock_mode_name(mode));
+}
+
+CC_UnLock_Cmd::~CC_UnLock_Cmd()
+{
+ ACE_OS::free (this->name_);
+}
+
+int CC_UnLock_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf("Executing unlock command (lock set: %s, mode: %s)\n",
+ name_, CC_TestUtils::get_lock_mode_name(mode_));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosConcurrencyControl::LockSet_var ccls = GetLockSet(name_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ccls->unlock (mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_UnLock_Cmd::execute(void)");
+ return 0;
+ }
+ ACE_ENDTRY;
+ return 1; // CC_SUCCESS
+}
+
+CC_TryLock_Cmd::CC_TryLock_Cmd (const char *lock_set_name,
+ CosConcurrencyControl::lock_mode mode)
+ : name_ (ACE_OS::strdup (lock_set_name)),
+ mode_ (mode)
+{
+ // printf("CC_TryLock_Cmd::CC_TryLock_Cmd: lock set: %s, mode %s\n",
+ // lock_set_name, CC_TestUtils::get_lock_mode_name(mode));
+}
+
+CC_TryLock_Cmd::~CC_TryLock_Cmd()
+{
+ ACE_OS::free (this->name_);
+}
+
+int CC_TryLock_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf("Executing try_lock command (lock set: %s, mode: %s)\n",
+ name_, CC_TestUtils::get_lock_mode_name(mode_));
+
+ CORBA::Boolean lock_not_held;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosConcurrencyControl::LockSet_var ccls = GetLockSet(name_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ lock_not_held = ccls->try_lock (mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (lock_not_held)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock not held\n",
+ CC_TestUtils::get_lock_mode_name (mode_)));
+ }
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock held\n",
+ CC_TestUtils::get_lock_mode_name (mode_)));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_TryLock_Cmd::execute(void)");
+ return 0;
+ }
+ ACE_ENDTRY;
+
+ return 1; // CC_SUCCESS
+}
+
+CC_ChangeMode_Cmd::
+ CC_ChangeMode_Cmd (const char *lock_set_name,
+ CosConcurrencyControl::lock_mode held_mode,
+ CosConcurrencyControl::lock_mode new_mode)
+ : name_(ACE_OS::strdup (lock_set_name)),
+ held_mode_ (held_mode),
+ new_mode_ (new_mode)
+{
+ // printf("CC_ChangeMode_Cmd::CC_ChangeMode_Cmd: lock set: %s, held mode: %s, new mode: %s\n",
+ // lock_set_name,
+ // CC_TestUtils::get_lock_mode_name(held_mode),
+ // CC_TestUtils::get_lock_mode_name(new_mode));
+}
+
+CC_ChangeMode_Cmd::~CC_ChangeMode_Cmd()
+{
+ ACE_OS::strdup (this->name_);
+}
+
+int CC_ChangeMode_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf("Executing change_mode command (lock set: %s, held_mode: %s, new_mode: %s)\n",
+ name_, CC_TestUtils::get_lock_mode_name(held_mode_),
+ CC_TestUtils::get_lock_mode_name(new_mode_));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosConcurrencyControl::LockSet_var ccls = GetLockSet(name_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ccls->change_mode (held_mode_, new_mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_ChangeMode_Cmd::execute(void)");
+ }
+ ACE_ENDTRY;
+ return 1; // CC_SUCCESS
+}
+
+CC_Sleep_Cmd::CC_Sleep_Cmd(int seconds)
+ : time_ (seconds)
+{
+}
+
+CC_Sleep_Cmd::~CC_Sleep_Cmd()
+{
+}
+
+int CC_Sleep_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf("Executing sleep command (time: %i)\n", time_);
+
+ ACE_OS::sleep(time_);
+ return 1; // CC_SUCCESS
+}
+
+CC_Repeat_Cmd::CC_Repeat_Cmd(int times)
+ : times_ (times)
+{
+}
+
+CC_Repeat_Cmd::~CC_Repeat_Cmd()
+{
+}
+
+int CC_Repeat_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf("Executing repeat command (times: %i)\n", times_);
+
+ return 1; // CC_SUCCESS
+}
+
+CC_Wait_Cmd::CC_Wait_Cmd (const char *prompt)
+ : prompt_ (ACE_OS::strdup (prompt))
+{
+}
+
+CC_Wait_Cmd::~CC_Wait_Cmd()
+{
+ ACE_OS::free (this->prompt_);
+}
+
+int CC_Wait_Cmd::execute(void)
+{
+ if (excep_)
+ {
+ printf ("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf ("Executing wait command\n");
+
+ printf ("%s", prompt_);
+ (void) ACE_OS::fgetc (stdin);
+
+ return 1; // CC_SUCCESS
+}
+
+CC_Excep_Cmd::CC_Excep_Cmd (const char *excep)
+ : ex_ (ACE_OS::strdup (excep))
+{
+ // printf("CC_Excep_Cmd::CC_Excep_Cmd: excep: %s\n", excep);
+}
+
+CC_Excep_Cmd::~CC_Excep_Cmd(void)
+{
+ ACE_OS::free (this->ex_);
+}
+
+int
+CC_Excep_Cmd::execute(void)
+{
+ printf ("Executing excep command (expected: %s)\n", ex_);
+ // First we check to see if an exception has occured. If not we fail
+ // because we expected to see one
+ if(excep_==0)
+ return 0; // CC_FAIL
+
+ // If there is an exception check that it's the expected one
+ if(ACE_OS::strcmp(excep_->_rep_id (), ex_)==0)
+ {
+ delete excep_;
+ excep_ = 0;
+ return 1; // CC_SUCCESS
+ }
+ else
+ {
+ printf ("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+}
+
+CC_Dummy_Cmd::CC_Dummy_Cmd(void)
+{
+}
+
+CC_Dummy_Cmd::~CC_Dummy_Cmd(void)
+{
+}
+
+int
+CC_Dummy_Cmd::execute(void)
+{
+ return 1; // CC_SUCCESS
+}
+
+CC_Print_Cmd::CC_Print_Cmd (const char * message)
+ : msg_ (ACE_OS::strdup (message))
+{
+}
+
+CC_Print_Cmd::~CC_Print_Cmd(void)
+{
+ ACE_OS::free(msg_);
+}
+
+int
+CC_Print_Cmd::execute(void)
+{
+ printf ("%s\n", msg_);
+ return 1; // CC_SUCCESS
+}
+
+CC_Lookup_Cmd::CC_Lookup_Cmd (const char *lock_set_name)
+ : name_ (ACE_OS::strdup (lock_set_name))
+{
+}
+
+CC_Lookup_Cmd::~CC_Lookup_Cmd()
+{
+ if(name_)
+ {
+ ACE_OS::free(name_);
+ name_ = 0;
+ }
+}
+
+int
+CC_Lookup_Cmd::execute(void)
+{
+ if(excep_)
+ {
+ printf ("Exception: %s\n", excep_->_rep_id ());
+ delete excep_;
+ excep_ = 0;
+ return 0; // CC_FAIL
+ }
+
+ printf ("Executing lookup command (lock set: %s)\n", name_);
+
+ // Do the lookup if we haven't done it before
+ if(cc_lockset_.in() == 0)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Object_var ccls_obj =
+ CC_naming_service::Instance()->get_obj_from_name ("",
+ name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosConcurrencyControl::LockSet_var ccls =
+ CosConcurrencyControl::LockSet::_narrow (ccls_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ cc_lockset_ = ccls;
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_UnLock_Cmd::execute(void)");
+ }
+ ACE_ENDTRY;
+ }
+ return 1; // CC_SUCCESS
+}
+
+CC_CommandElem::CC_CommandElem(CC_Command *cmd, CC_CommandElem *next)
+ : next_ (next), cmd_ (cmd)
+{
+}
+
+CC_CommandElem::~CC_CommandElem(void)
+{
+}
+
+CC_Command *CC_CommandElem::GetCommand(void)
+{
+ return cmd_;
+}
+
+CC_CommandElem *
+CC_CommandElem::GetNext(void)
+{
+ return next_;
+}
+
+void
+CC_CommandElem::SetNext(CC_CommandElem *next)
+{
+ next_ = next;
+}
+
+CC_CommandList::CC_CommandList(void)
+ : head_ (0), last_ (0), times_ (1)
+{
+ printf("CC_CommandList::CC_CommandList\n");
+}
+
+CC_CommandList::~CC_CommandList(void)
+{
+}
+
+int
+CC_CommandList::add(CC_Command *cmd)
+{
+ if(head_==0)
+ {
+ head_ = new CC_CommandElem(cmd, 0);
+ last_ = head_;
+ }
+ else
+ {
+ CC_CommandElem *tmp = new CC_CommandElem(cmd, 0);
+ last_->SetNext(tmp);
+ last_ = tmp;
+ }
+ return 0;
+}
+
+int
+CC_CommandList::execute(void)
+{
+ CC_CommandElem *current = head_;
+
+ for(int i=0; i<times_; i++)
+ {
+ current = head_;
+ while(current!=0)
+ {
+ if(current->GetCommand()->execute()==0) // == CC_FAIL
+ {
+ return 0; // CC_FAIL
+ }
+ current = current->GetNext();
+ }
+ }
+ return 1; // CC_SUCCESS
+}
+
+void
+CC_CommandList::setrepeat(int times)
+{
+ times_ = times;
+}
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_command.h b/TAO/orbsvcs/tests/Concurrency/CC_command.h
new file mode 100644
index 00000000000..735d38d7c21
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_command.h
@@ -0,0 +1,475 @@
+// -*- c++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Concurrency
+//
+// = FILENAME
+// CC_command.h
+//
+// = DESCRIPTION
+// This file implements the command possible to execute on the
+// concurrency service's lock set interface. The file also contains
+// an implementation of a command list used by the command parser to
+// store the commands to be executed.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/CosConcurrencyControlC.h"
+
+#ifndef _CC_COMMAND_H_
+#define _CC_COMMAND_H_
+
+class CC_Command
+ // = TITLE
+ // Defines an abstact class for the commands towards the lock set
+ //
+ // = DESCRIPTION
+ // This class declares an interface to run a test towards one or more
+ // lock sets in the concurrency service. The class provides a virtual
+ // execute method that is common for all its subclasses. It is also the
+ // the base class for the auxillary commands start, wait, and sleep.
+{
+ public:
+ virtual ~CC_Command(void);
+ // Destructor
+
+ virtual int execute() = 0;
+ // Abstract execute method
+
+ protected:
+ CosConcurrencyControl::LockSet_var
+ GetLockSet (const char *lock_set_name
+ ACE_ENV_ARG_DECL);
+ // Function to look up the lock set we are operating on, or if the
+ // name is "" return the global lock set variable
+
+ CC_Command(void);
+ // Default constructor. We do not want instances of this class
+
+ static CORBA::Exception *excep_;
+ // The last exception raised in one of the test commands. This variable
+ // is checked by all commands in order to determine if an exception has
+ // been raised. This is necessary because sometimes we want to check that
+ // an event caused an exception (done by the CC_Excep_Cmd command class)
+ // as part of the testing.
+
+ static CosConcurrencyControl::LockSet_var cc_lockset_;
+ // This is the default lock set. The variable is either set by a create
+ // command without name or by the lookup command.
+
+ private:
+};
+
+class CC_Start_Cmd : public CC_Command
+ // = TITLE
+ // Defines a class for the start command
+ //
+ // = DESCRIPTION
+ // This class represents the start command. The start command is used
+ // to start a new process with another script file in order to test the
+ // aspects of the concurrency service that requires several processes
+ // running at the same time.
+{
+ public:
+ CC_Start_Cmd (const char *config_file_name);
+ // Constructor
+
+ virtual ~CC_Start_Cmd();
+ // Destructor
+
+ virtual int execute(void);
+ // Start the child process. The current version does not wait for the
+ // process to terminate.
+
+private:
+ char *cfg_name_;
+ // The name of the script file
+};
+
+class CC_CreateLockSet_Cmd : public CC_Command
+ // = TITLE
+ // Defines a class for the create command on the lock set factory
+ //
+ // = DESCRIPTION
+ // This class represents the create command on the lock set factory.
+ // The lock set is registered in the naming service with the provided
+ // name.
+{
+ public:
+ CC_CreateLockSet_Cmd (const char *lock_set_name);
+ // Constructor
+
+ virtual ~CC_CreateLockSet_Cmd ();
+ // Destructor
+
+ virtual int execute(void);
+ // Executes the command, i.e. creates the lock set and binds the name
+ // in the naming service.
+
+private:
+ char *name_;
+ // The name used to bind in the naming service.
+};
+
+class CC_Lock_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the lock command on the lock set
+ //
+ // = DESCRIPTION
+ // This class represents the lock command on the lock set. The lock set
+ // is looked up in the naming service.
+{
+ public:
+ CC_Lock_Cmd(const char *lock_set_name,
+ CosConcurrencyControl::lock_mode mode);
+ // Constructor.
+
+ virtual ~CC_Lock_Cmd();
+ // Destructor
+
+ virtual int execute(void);
+ // Executes the command, i.e. looks up the lock set with the requested
+ // name in the naming server and executes the lock command on that lock set.
+
+private:
+ char *name_;
+ // The name to look up in the naming service.
+
+ CosConcurrencyControl::lock_mode mode_;
+ // The mode of the lock.
+};
+
+class CC_UnLock_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the unlock command on the lock set
+ //
+ // = DESCRIPTION
+ // This class represents the unlock command on the lock set. The lock set
+ // is looked up in the naming service.
+{
+ public:
+ CC_UnLock_Cmd(const char *lock_set_name,
+ CosConcurrencyControl::lock_mode mode);
+ // Constructor.
+
+ virtual ~CC_UnLock_Cmd();
+ // Destructor
+
+ virtual int execute(void);
+ // Executes the command, i.e. looks up the lock set with the requested
+ // name in the naming server and executes the unlock command on that
+ // lock set.
+
+private:
+ char *name_;
+ // The name to look up in the naming service.
+
+ CosConcurrencyControl::lock_mode mode_;
+ // The mode of the lock.
+};
+
+class CC_TryLock_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the try_lock command on the lock set
+ //
+ // = DESCRIPTION
+ // This class represents the try_lock command on the lock set. The lock set
+ // is looked up in the naming service.
+{
+ public:
+ CC_TryLock_Cmd(const char *lock_set_name,
+ CosConcurrencyControl::lock_mode mode);
+ // Constructor
+
+ virtual ~CC_TryLock_Cmd();
+ // Destructor
+
+ virtual int execute(void);
+ // Executes the command, i.e. looks up the lock set with the requested
+ // name in the naming server and executes the try_lock command on that
+ // lock set.
+
+private:
+ char *name_;
+ // The name to look up in the naming service.
+
+ CosConcurrencyControl::lock_mode mode_;
+ // The mode of the lock.
+};
+
+class CC_ChangeMode_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the change_mode command on the lock set
+ //
+ // = DESCRIPTION
+ // This class represents the change_mode command on the lock set.
+ // The lock set is looked up in the naming service.
+{
+ public:
+ CC_ChangeMode_Cmd (const char *lock_set_name,
+ CosConcurrencyControl::lock_mode held_mode,
+ CosConcurrencyControl::lock_mode new_mode);
+ // Constructor
+
+ virtual ~CC_ChangeMode_Cmd();
+ // Destructor
+
+ virtual int execute(void);
+ // Executes the command, i.e. looks up the lock set with the requested
+ // name in the naming server and executes the change_mode command on that
+ // lock set.
+
+private:
+ char *name_;
+ // The name to look up in the naming service.
+
+ CosConcurrencyControl::lock_mode held_mode_;
+ // The mode of the held lock
+
+ CosConcurrencyControl::lock_mode new_mode_;
+ // The new mode of the lock
+};
+
+class CC_Sleep_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the sleep command
+ //
+ // = DESCRIPTION
+ // This class represents the sleep command. This command is used to make
+ // the script pause for the requested number of second, e.g. to wait for
+ // another process to start.
+{
+ public:
+ CC_Sleep_Cmd(int seconds);
+ // Constructor.
+
+ virtual ~CC_Sleep_Cmd();
+ // Destructor.
+
+ virtual int execute(void);
+ // Executes the command.
+
+ private:
+ int time_;
+ // The number of seconds to sleep
+};
+
+class CC_Repeat_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the repeat command
+ //
+ // = DESCRIPTION
+ // This class represents the repeat command. This command is used to make
+ // the script repeat the test the requested number of times.
+ // The command is curently NOT implemented.
+{
+ public:
+ CC_Repeat_Cmd(int times);
+ // Constructor.
+
+ virtual ~CC_Repeat_Cmd();
+ // Destructor.
+
+ virtual int execute(void);
+ // Executes the command.
+ private:
+ int times_;
+ // The number of times the commands should be repeated
+};
+
+class CC_Wait_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the wait command
+ //
+ // = DESCRIPTION
+ // This class represents the wait command. This command is used to make
+ // the script wait for the user to press return. It is possible to print
+ // different prompts, e.g. instructions.
+{
+ public:
+ CC_Wait_Cmd (const char *prompt);
+ // Constructor.
+
+ virtual ~CC_Wait_Cmd();
+ // Destructor.
+
+ virtual int execute(void);
+ // Executes the command.
+
+private:
+ char *prompt_;
+ // The prompt to print on the screen
+};
+
+class CC_Excep_Cmd : public CC_Command
+ // = TITLE
+ // Defines a class for the excep command
+ //
+ // = DESCRIPTION
+ // This class represents the excep command. This command is used to make
+ // the script capable of dealing with cases where an exception is raised
+ // as part of the testing.
+{
+ public:
+ CC_Excep_Cmd (const char *excep);
+ // Constructor.
+
+ virtual ~CC_Excep_Cmd(void);
+ // Destructor.
+
+ virtual int execute(void);
+ // Executes the command. Checks to see if the excep_ class variable is set,
+ // and if that's the case check that it is of the expected type. If not the
+ // test fails.
+
+private:
+ char *ex_;
+ // The string representation of the expected exception
+};
+
+class CC_Dummy_Cmd: public CC_Command
+ // = TITLE
+ // Defines a class for the dummy command
+ //
+ // = DESCRIPTION
+ // This class represents the dummy command. This command is used to
+ // put in a command in the chain that does nothing.
+{
+ public:
+ CC_Dummy_Cmd(void);
+ // Constructor.
+
+ virtual ~CC_Dummy_Cmd(void);
+ // Destructor.
+
+ virtual int execute(void);
+ // Executes the command, i.e. does nothing.
+
+ private:
+};
+
+class CC_Print_Cmd: public CC_Command
+ // = TITLE
+ // Defines a class for the print command
+ //
+ // = DESCRIPTION
+ // This class represents the print command. This command is used to
+ // print a message on stdout
+{
+public:
+ CC_Print_Cmd (const char *message);
+ // Constructor.
+
+ virtual ~CC_Print_Cmd(void);
+ // Destructor.
+
+ virtual int execute(void);
+ // Executes the command.
+
+private:
+ char *msg_;
+ // Holds the message to print
+};
+
+class CC_Lookup_Cmd:public CC_Command
+ // = TITLE
+ // Defines a class for the lookup command.
+ //
+ // = DESCRIPTION
+ // This class represents the lookup command. The lock set
+ // is looked up in the naming service and the class variable
+ // cc_lockset_ is set accordingly.
+{
+public:
+ CC_Lookup_Cmd (const char *lock_set_name);
+ // Constructor
+
+ virtual ~CC_Lookup_Cmd();
+ // Destructor
+
+ virtual int execute(void);
+ // Executes the command, i.e. looks up the lock set with the requested
+ // name in the naming server and sets the cc_lockset_ variable.
+
+private:
+ char *name_;
+ // The name to look up in the naming service.
+
+};
+
+class CC_CommandElem
+ // = TITLE
+ // Defines a class for a command element
+ //
+ // = DESCRIPTION
+ // This class implements a command element used in the command list
+ // below. The class is a simple tupple holding a pointer to the command
+ // and a pointer to the next element in the list.
+{
+ public:
+ CC_CommandElem (CC_Command *cmd, CC_CommandElem *next);
+ // Constructor.
+
+ ~CC_CommandElem(void);
+ // Destructor.
+
+ CC_Command *GetCommand(void);
+ // Returns a pointer to the command in this element
+
+ CC_CommandElem *GetNext(void);
+ // Returns the pointer to the next element
+
+ void SetNext(CC_CommandElem *next);
+ // Sets the next pointer
+
+ private:
+ CC_CommandElem *next_;
+ // Pointer to the next element
+
+ CC_Command *cmd_;
+ // Pointer to the command element
+};
+
+class CC_CommandList
+ // = TITLE
+ // Defines a class for a command list
+ //
+ // = DESCRIPTION
+ // This class implements a command list used from the script parser
+ // to store the parsed commands The class implements a simple single
+ // linked list.
+{
+ public:
+ CC_CommandList(void);
+ // Constructor.
+
+ ~CC_CommandList(void);
+ // Destructor.
+
+ int add(CC_Command *cmd);
+ // Adds the command to the list
+
+ int execute(void);
+ // Executes all the commands in the list from head to tail
+
+ void setrepeat(int times);
+ // Sets the number of times to repeat the script
+
+ private:
+ CC_CommandElem *head_;
+ // The head of the command list
+
+ CC_CommandElem *last_;
+ // The last inserted element
+
+ int times_;
+ // The number of times the script should be repeated
+};
+
+#endif /* _CC_COMMAND_H_ */
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_command.l b/TAO/orbsvcs/tests/Concurrency/CC_command.l
new file mode 100644
index 00000000000..57ff98ea222
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_command.l
@@ -0,0 +1,58 @@
+/* $id$
+ * ============================================================================
+ *
+ * = LIBRARY
+ * TAO/orbsvcs/tests
+ *
+ * = FILENAME
+ * CC_command.l
+ *
+ * = DESCRIPTION
+ * This is the lex file for the concurrency service script language.
+ *
+ * = AUTHORS
+ * Torben Worm <tworm@cs.wustl.edu>
+ *
+ * ============================================================================
+ */
+%option noyywrap nounput noinput always-interactive
+%{
+#include "CC_command.h"
+#include "CC_command.tab.h"
+#include "ace/ACE.h"
+
+extern int line_no;
+extern char line_buf[500];
+%}
+
+%%
+
+; return T_TERM;
+start return T_START_CMD;
+create return T_CREATE_CMD;
+lock return T_LOCK_CMD;
+unlock return T_UNLOCK_CMD;
+try_lock return T_TRYLOCK_CMD;
+change_mode return T_CHANGEMODE_CMD;
+sleep return T_SLEEP_CMD;
+wait return T_WAIT_CMD;
+print return T_PRINT_CMD;
+repeat return T_REPEAT_CMD;
+exception return T_EXCEP_CMD;
+lookup return T_LOOKUP_CMD;
+read return T_READ;
+intention_read return T_IREAD;
+upgrade return T_UPGRADE;
+write return T_WRITE;
+intention_write return T_IWRITE;
+\".*\" { yylval.id = ACE_OS::strdup(&yytext[1]);
+ yylval.id[yyleng-2]='\0';
+ return Q_STRING; }
+[0-9]+ { yylval.num = atoi(yytext); return T_NUM; }
+[A-Za-z][A-Za-z_0-9\.:/]* { yylval.id = ACE_OS::strdup(yytext);
+ return T_IDENT; }
+^\/\/.*\n { }
+[ ]+ { }
+\n.* { line_no ++;
+ ACE_OS::strcpy(line_buf, yytext+1);
+ yyless(1); }
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_command.tab.cpp b/TAO/orbsvcs/tests/Concurrency/CC_command.tab.cpp
new file mode 100644
index 00000000000..8a67df0eb67
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_command.tab.cpp
@@ -0,0 +1,1071 @@
+// $Id$
+
+/* A Bison parser, made from CC_command.y
+ by GNU Bison version 1.28 */
+
+#define ACE_CC_YYBISON 1 /* Identify Bison output. */
+
+#define T_START_CMD 257
+#define T_CREATE_CMD 258
+#define T_LOCK_CMD 259
+#define T_UNLOCK_CMD 260
+#define T_TRYLOCK_CMD 261
+#define T_CHANGEMODE_CMD 262
+#define T_SLEEP_CMD 263
+#define T_WAIT_CMD 264
+#define T_REPEAT_CMD 265
+#define T_EXCEP_CMD 266
+#define T_PRINT_CMD 267
+#define T_LOOKUP_CMD 268
+#define T_TERM 269
+#define T_READ 270
+#define T_IREAD 271
+#define T_UPGRADE 272
+#define T_WRITE 273
+#define T_IWRITE 274
+#define T_IDENT 275
+#define Q_STRING 276
+#define T_NUM 277
+
+
+#include "CC_command.h"
+#include "ace/ACE.h"
+#include "orbsvcs/CosConcurrencyControlC.h"
+#include "ace/OS_NS_stdio.h"
+
+void ace_cc_yyerror (const char* s);
+int ace_cc_yylex(void);
+
+extern int line_no;
+extern char line_buf[500];
+extern char *ace_cc_yytext;
+extern CC_CommandList *cmdlist;
+
+typedef union {
+ CC_Command *command;
+ CosConcurrencyControl::lock_mode lock_mode;
+ char *id;
+ int num;
+} ACE_CC_YYSTYPE;
+#include <stdio.h>
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
+
+
+
+#define ACE_CC_YYFINAL 66
+#define ACE_CC_YYFLAG -32768
+#define ACE_CC_YYNTBASE 24
+
+#define ACE_CC_YYTRANSLATE(x) ((unsigned)(x) <= 277 ? ace_cc_yytranslate[x] : 31)
+
+static const char ace_cc_yytranslate[] = { 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23
+};
+
+#if ACE_CC_YYDEBUG != 0
+static const short ace_cc_yyprhs[] = { 0,
+ 0, 1, 3, 6, 8, 12, 16, 19, 24, 28,
+ 33, 37, 42, 46, 52, 57, 61, 64, 68, 72,
+ 76, 80, 84, 86, 88, 90, 92, 94, 96, 98
+};
+
+static const short ace_cc_yyrhs[] = { -1,
+ 25, 0, 25, 26, 0, 26, 0, 3, 27, 15,
+ 0, 4, 28, 15, 0, 4, 15, 0, 5, 28,
+ 30, 15, 0, 5, 30, 15, 0, 6, 28, 30,
+ 15, 0, 6, 30, 15, 0, 7, 28, 30, 15,
+ 0, 7, 30, 15, 0, 8, 28, 30, 30, 15,
+ 0, 8, 30, 30, 15, 0, 9, 23, 15, 0,
+ 10, 15, 0, 10, 22, 15, 0, 13, 22, 15,
+ 0, 14, 28, 15, 0, 11, 23, 15, 0, 12,
+ 29, 15, 0, 21, 0, 21, 0, 21, 0, 16,
+ 0, 17, 0, 18, 0, 19, 0, 20, 0
+};
+
+#endif
+
+#if ACE_CC_YYDEBUG != 0
+static const short ace_cc_yyrline[] = { 0,
+ 51, 52, 60, 61, 64, 66, 68, 70, 72, 74,
+ 76, 78, 80, 82, 84, 86, 88, 90, 92, 94,
+ 96, 99, 103, 105, 107, 109, 110, 111, 112, 113
+};
+#endif
+
+
+#if ACE_CC_YYDEBUG != 0 || defined (ACE_CC_YYERROR_VERBOSE)
+
+static const char * const ace_cc_yytname[] = { "$","error","$undefined.","T_START_CMD",
+"T_CREATE_CMD","T_LOCK_CMD","T_UNLOCK_CMD","T_TRYLOCK_CMD","T_CHANGEMODE_CMD",
+"T_SLEEP_CMD","T_WAIT_CMD","T_REPEAT_CMD","T_EXCEP_CMD","T_PRINT_CMD","T_LOOKUP_CMD",
+"T_TERM","T_READ","T_IREAD","T_UPGRADE","T_WRITE","T_IWRITE","T_IDENT","Q_STRING",
+"T_NUM","start","cmd_list","cmd","config_file_name","lock_set_name","exception_name",
+"lock_mode", NULL
+};
+#endif
+
+static const short ace_cc_yyr1[] = { 0,
+ 24, 24, 25, 25, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 27, 28, 29, 30, 30, 30, 30, 30
+};
+
+static const short ace_cc_yyr2[] = { 0,
+ 0, 1, 2, 1, 3, 3, 2, 4, 3, 4,
+ 3, 4, 3, 5, 4, 3, 2, 3, 3, 3,
+ 3, 3, 1, 1, 1, 1, 1, 1, 1, 1
+};
+
+static const short ace_cc_yydefact[] = { 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 2, 4, 23, 0, 7, 24, 0, 26,
+ 27, 28, 29, 30, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 17, 0, 0, 25, 0, 0, 0,
+ 3, 5, 6, 0, 9, 0, 11, 0, 13, 0,
+ 0, 16, 18, 21, 22, 19, 20, 8, 10, 12,
+ 0, 15, 14, 0, 0, 0
+};
+
+static const short ace_cc_yydefgoto[] = { 64,
+ 13, 14, 16, 19, 38, 26
+};
+
+static const short ace_cc_yypact[] = { 0,
+ -1, 14, 20, 20, 20, 20, 7, 4, 8, 1,
+ 10, 13, 0,-32768,-32768, 18,-32768,-32768, 27,-32768,
+-32768,-32768,-32768,-32768, 31, 28, 31, 29, 31, 30,
+ 31, 31, 37,-32768, 38, 39,-32768, 40, 41, 42,
+-32768,-32768,-32768, 43,-32768, 44,-32768, 45,-32768, 31,
+ 46,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ 47,-32768,-32768, 63, 64,-32768
+};
+
+static const short ace_cc_yypgoto[] = {-32768,
+-32768, 52,-32768, 12,-32768, -4
+};
+
+
+#define ACE_CC_YYLAST 65
+
+
+static const short ace_cc_yytable[] = { 28,
+ 30, 32, 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 25, 27, 29, 31, 34, 15,
+ 44, 37, 46, 40, 48, 35, 50, 51, 17, 33,
+ 36, 39, 42, 18, 18, 20, 21, 22, 23, 24,
+ 18, 43, 45, 47, 49, 61, 20, 21, 22, 23,
+ 24, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+ 62, 63, 65, 66, 41
+};
+
+static const short ace_cc_yycheck[] = { 4,
+ 5, 6, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 3, 4, 5, 6, 15, 21,
+ 25, 21, 27, 12, 29, 22, 31, 32, 15, 23,
+ 23, 22, 15, 21, 21, 16, 17, 18, 19, 20,
+ 21, 15, 15, 15, 15, 50, 16, 17, 18, 19,
+ 20, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+ 15, 15, 0, 0, 13
+};
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+
+/* This file comes from bison-1.28. */
+
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef ACE_CC_YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define ACE_CC_YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define ACE_CC_YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define ACE_CC_YYSTACK_USE_ALLOCA
+#include <alloca.h>
+#else /* not sparc */
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
+#include <malloc.h>
+#endif
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
+ #pragma alloca
+#define ACE_CC_YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define ACE_CC_YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* ACE_CC_YYSTACK_USE_ALLOCA not defined */
+
+#ifdef ACE_CC_YYSTACK_USE_ALLOCA
+#define ACE_CC_YYSTACK_ALLOC alloca
+#else
+#define ACE_CC_YYSTACK_ALLOC malloc
+#endif
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
+#define ace_cc_yyerrok (ace_cc_yyerrstatus = 0)
+#define ace_cc_yyclearin (ace_cc_yychar = ACE_CC_YYEMPTY)
+#define ACE_CC_YYEMPTY -2
+#define ACE_CC_YYEOF 0
+#define ACE_CC_YYACCEPT goto ace_cc_yyacceptlab
+#define ACE_CC_YYABORT goto ace_cc_yyabortlab
+#define ACE_CC_YYERROR goto ace_cc_yyerrlab1
+/* Like ACE_CC_YYERROR except do call ace_cc_yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of ACE_CC_YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define ACE_CC_YYFAIL goto ace_cc_yyerrlab
+#define ACE_CC_YYRECOVERING() (!!ace_cc_yyerrstatus)
+#define ACE_CC_YYBACKUP(token, value) \
+do \
+ if (ace_cc_yychar == ACE_CC_YYEMPTY && ace_cc_yylen == 1) \
+ { ace_cc_yychar = (token), ace_cc_yylval = (value); \
+ ace_cc_yychar1 = ACE_CC_YYTRANSLATE (ace_cc_yychar); \
+ ACE_CC_YYPOPSTACK; \
+ goto ace_cc_yybackup; \
+ } \
+ else \
+ { ace_cc_yyerror ("syntax error: cannot back up"); ACE_CC_YYERROR; } \
+while (0)
+
+#define ACE_CC_YYTERROR 1
+#define ACE_CC_YYERRCODE 256
+
+#ifndef ACE_CC_YYPURE
+#define ACE_CC_YYLEX ace_cc_yylex()
+#endif
+
+#ifdef ACE_CC_YYPURE
+#ifdef ACE_CC_YYLSP_NEEDED
+#ifdef ACE_CC_YYLEX_PARAM
+#define ACE_CC_YYLEX ace_cc_yylex(&ace_cc_yylval, &ace_cc_yylloc, ACE_CC_YYLEX_PARAM)
+#else
+#define ACE_CC_YYLEX ace_cc_yylex(&ace_cc_yylval, &ace_cc_yylloc)
+#endif
+#else /* not ACE_CC_YYLSP_NEEDED */
+#ifdef ACE_CC_YYLEX_PARAM
+#define ACE_CC_YYLEX ace_cc_yylex(&ace_cc_yylval, ACE_CC_YYLEX_PARAM)
+#else
+#define ACE_CC_YYLEX ace_cc_yylex(&ace_cc_yylval)
+#endif
+#endif /* not ACE_CC_YYLSP_NEEDED */
+#endif
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef ACE_CC_YYPURE
+
+int ace_cc_yychar; /* the lookahead symbol */
+ACE_CC_YYSTYPE ace_cc_yylval; /* the semantic value of the */
+ /* lookahead symbol */
+
+#ifdef ACE_CC_YYLSP_NEEDED
+ACE_CC_YYLTYPE ace_cc_yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int ace_cc_yynerrs; /* number of parse errors so far */
+#endif /* not ACE_CC_YYPURE */
+
+#if ACE_CC_YYDEBUG != 0
+int ace_cc_yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* ACE_CC_YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef ACE_CC_YYINITDEPTH
+#define ACE_CC_YYINITDEPTH 200
+#endif
+
+/* ACE_CC_YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if ACE_CC_YYMAXDEPTH == 0
+#undef ACE_CC_YYMAXDEPTH
+#endif
+
+#ifndef ACE_CC_YYMAXDEPTH
+#define ACE_CC_YYMAXDEPTH 10000
+#endif
+
+/* Define __ace_cc_yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __ace_cc_yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__ace_cc_yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__ace_cc_yy_memcpy (char *to, char *from, unsigned int count)
+{
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+#endif
+
+
+
+/* The user can define ACE_CC_YYPARSE_PARAM as the name of an argument to be passed
+ into ace_cc_yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef ACE_CC_YYPARSE_PARAM
+#ifdef __cplusplus
+#define ACE_CC_YYPARSE_PARAM_ARG void *ACE_CC_YYPARSE_PARAM
+#define ACE_CC_YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define ACE_CC_YYPARSE_PARAM_ARG ACE_CC_YYPARSE_PARAM
+#define ACE_CC_YYPARSE_PARAM_DECL void *ACE_CC_YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not ACE_CC_YYPARSE_PARAM */
+#define ACE_CC_YYPARSE_PARAM_ARG
+#define ACE_CC_YYPARSE_PARAM_DECL
+#endif /* not ACE_CC_YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef ACE_CC_YYPARSE_PARAM
+int ace_cc_yyparse (void *);
+#else
+int ace_cc_yyparse (void);
+#endif
+#endif
+
+int
+ace_cc_yyparse(ACE_CC_YYPARSE_PARAM_ARG)
+ ACE_CC_YYPARSE_PARAM_DECL
+{
+ register int ace_cc_yystate;
+ register int ace_cc_yyn;
+ register short *ace_cc_yyssp;
+ register ACE_CC_YYSTYPE *ace_cc_yyvsp;
+ int ace_cc_yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int ace_cc_yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+ short ace_cc_yyssa[ACE_CC_YYINITDEPTH]; /* the state stack */
+ ACE_CC_YYSTYPE ace_cc_yyvsa[ACE_CC_YYINITDEPTH]; /* the semantic value stack */
+
+ short *ace_cc_yyss = ace_cc_yyssa; /* refer to the stacks thru separate pointers */
+ ACE_CC_YYSTYPE *ace_cc_yyvs = ace_cc_yyvsa; /* to allow ace_cc_yyoverflow to reallocate them elsewhere */
+
+#ifdef ACE_CC_YYLSP_NEEDED
+ ACE_CC_YYLTYPE ace_cc_yylsa[ACE_CC_YYINITDEPTH]; /* the location stack */
+ ACE_CC_YYLTYPE *ace_cc_yyls = ace_cc_yylsa;
+ ACE_CC_YYLTYPE *ace_cc_yylsp;
+
+#define ACE_CC_YYPOPSTACK (ace_cc_yyvsp--, ace_cc_yyssp--, ace_cc_yylsp--)
+#else
+#define ACE_CC_YYPOPSTACK (ace_cc_yyvsp--, ace_cc_yyssp--)
+#endif
+
+ int ace_cc_yystacksize = ACE_CC_YYINITDEPTH;
+ int ace_cc_yyfree_stacks = 0;
+
+#ifdef ACE_CC_YYPURE
+ int ace_cc_yychar;
+ ACE_CC_YYSTYPE ace_cc_yylval;
+ int ace_cc_yynerrs;
+#ifdef ACE_CC_YYLSP_NEEDED
+ ACE_CC_YYLTYPE ace_cc_yylloc;
+#endif
+#endif
+
+ ACE_CC_YYSTYPE ace_cc_yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+ int ace_cc_yylen;
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
+
+ ace_cc_yystate = 0;
+ ace_cc_yyerrstatus = 0;
+ ace_cc_yynerrs = 0;
+ ace_cc_yychar = ACE_CC_YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ ace_cc_yyssp = ace_cc_yyss - 1;
+ ace_cc_yyvsp = ace_cc_yyvs;
+#ifdef ACE_CC_YYLSP_NEEDED
+ ace_cc_yylsp = ace_cc_yyls;
+#endif
+
+/* Push a new state, which is found in ace_cc_yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+ace_cc_yynewstate:
+
+ *++ace_cc_yyssp = ace_cc_yystate;
+
+ if (ace_cc_yyssp >= ace_cc_yyss + ace_cc_yystacksize - 1)
+ {
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ ACE_CC_YYSTYPE *ace_cc_yyvs1 = ace_cc_yyvs;
+ short *ace_cc_yyss1 = ace_cc_yyss;
+#ifdef ACE_CC_YYLSP_NEEDED
+ ACE_CC_YYLTYPE *ace_cc_yyls1 = ace_cc_yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = ace_cc_yyssp - ace_cc_yyss + 1;
+
+#ifdef ace_cc_yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef ACE_CC_YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if ace_cc_yyoverflow is a macro. */
+ ace_cc_yyoverflow("parser stack overflow",
+ &ace_cc_yyss1, size * sizeof (*ace_cc_yyssp),
+ &ace_cc_yyvs1, size * sizeof (*ace_cc_yyvsp),
+ &ace_cc_yyls1, size * sizeof (*ace_cc_yylsp),
+ &ace_cc_yystacksize);
+#else
+ ace_cc_yyoverflow("parser stack overflow",
+ &ace_cc_yyss1, size * sizeof (*ace_cc_yyssp),
+ &ace_cc_yyvs1, size * sizeof (*ace_cc_yyvsp),
+ &ace_cc_yystacksize);
+#endif
+
+ ace_cc_yyss = ace_cc_yyss1; ace_cc_yyvs = ace_cc_yyvs1;
+#ifdef ACE_CC_YYLSP_NEEDED
+ ace_cc_yyls = ace_cc_yyls1;
+#endif
+#else /* no ace_cc_yyoverflow */
+ /* Extend the stack our own way. */
+ if (ace_cc_yystacksize >= ACE_CC_YYMAXDEPTH)
+ {
+ ace_cc_yyerror("parser stack overflow");
+ if (ace_cc_yyfree_stacks)
+ {
+ free (ace_cc_yyss);
+ free (ace_cc_yyvs);
+#ifdef ACE_CC_YYLSP_NEEDED
+ free (ace_cc_yyls);
+#endif
+ }
+ return 2;
+ }
+ ace_cc_yystacksize *= 2;
+ if (ace_cc_yystacksize > ACE_CC_YYMAXDEPTH)
+ ace_cc_yystacksize = ACE_CC_YYMAXDEPTH;
+#ifndef ACE_CC_YYSTACK_USE_ALLOCA
+ ace_cc_yyfree_stacks = 1;
+#endif
+ ace_cc_yyss = (short *) ACE_CC_YYSTACK_ALLOC (ace_cc_yystacksize * sizeof (*ace_cc_yyssp));
+ __ace_cc_yy_memcpy ((char *)ace_cc_yyss, (char *)ace_cc_yyss1,
+ size * (unsigned int) sizeof (*ace_cc_yyssp));
+ ace_cc_yyvs = (ACE_CC_YYSTYPE *) ACE_CC_YYSTACK_ALLOC (ace_cc_yystacksize * sizeof (*ace_cc_yyvsp));
+ __ace_cc_yy_memcpy ((char *)ace_cc_yyvs, (char *)ace_cc_yyvs1,
+ size * (unsigned int) sizeof (*ace_cc_yyvsp));
+#ifdef ACE_CC_YYLSP_NEEDED
+ ace_cc_yyls = (ACE_CC_YYLTYPE *) ACE_CC_YYSTACK_ALLOC (ace_cc_yystacksize * sizeof (*ace_cc_yylsp));
+ __ace_cc_yy_memcpy ((char *)ace_cc_yyls, (char *)ace_cc_yyls1,
+ size * (unsigned int) sizeof (*ace_cc_yylsp));
+#endif
+#endif /* no ace_cc_yyoverflow */
+
+ ace_cc_yyssp = ace_cc_yyss + size - 1;
+ ace_cc_yyvsp = ace_cc_yyvs + size - 1;
+#ifdef ACE_CC_YYLSP_NEEDED
+ ace_cc_yylsp = ace_cc_yyls + size - 1;
+#endif
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", ace_cc_yystacksize);
+#endif
+
+ if (ace_cc_yyssp >= ace_cc_yyss + ace_cc_yystacksize - 1)
+ ACE_CC_YYABORT;
+ }
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Entering state %d\n", ace_cc_yystate);
+#endif
+
+ goto ace_cc_yybackup;
+ ace_cc_yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* ace_cc_yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ ace_cc_yyn = ace_cc_yypact[ace_cc_yystate];
+ if (ace_cc_yyn == ACE_CC_YYFLAG)
+ goto ace_cc_yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* ace_cc_yychar is either ACE_CC_YYEMPTY or ACE_CC_YYEOF
+ or a valid token in external form. */
+
+ if (ace_cc_yychar == ACE_CC_YYEMPTY)
+ {
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
+ ace_cc_yychar = ACE_CC_YYLEX;
+ }
+
+ /* Convert token to internal form (in ace_cc_yychar1) for indexing tables with */
+
+ if (ace_cc_yychar <= 0) /* This means end of input. */
+ {
+ ace_cc_yychar1 = 0;
+ ace_cc_yychar = ACE_CC_YYEOF; /* Don't call ACE_CC_YYLEX any more */
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ ace_cc_yychar1 = ACE_CC_YYTRANSLATE(ace_cc_yychar);
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", ace_cc_yychar, ace_cc_yytname[ace_cc_yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef ACE_CC_YYPRINT
+ ACE_CC_YYPRINT (stderr, ace_cc_yychar, ace_cc_yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ ace_cc_yyn += ace_cc_yychar1;
+ if (ace_cc_yyn < 0 || ace_cc_yyn > ACE_CC_YYLAST || ace_cc_yycheck[ace_cc_yyn] != ace_cc_yychar1)
+ goto ace_cc_yydefault;
+
+ ace_cc_yyn = ace_cc_yytable[ace_cc_yyn];
+
+ /* ace_cc_yyn is what to do for this token type in this state.
+ Negative => reduce, -ace_cc_yyn is rule number.
+ Positive => shift, ace_cc_yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (ace_cc_yyn < 0)
+ {
+ if (ace_cc_yyn == ACE_CC_YYFLAG)
+ goto ace_cc_yyerrlab;
+ ace_cc_yyn = -ace_cc_yyn;
+ goto ace_cc_yyreduce;
+ }
+ else if (ace_cc_yyn == 0)
+ goto ace_cc_yyerrlab;
+
+ if (ace_cc_yyn == ACE_CC_YYFINAL)
+ ACE_CC_YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", ace_cc_yychar, ace_cc_yytname[ace_cc_yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (ace_cc_yychar != ACE_CC_YYEOF)
+ ace_cc_yychar = ACE_CC_YYEMPTY;
+
+ *++ace_cc_yyvsp = ace_cc_yylval;
+#ifdef ACE_CC_YYLSP_NEEDED
+ *++ace_cc_yylsp = ace_cc_yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (ace_cc_yyerrstatus) ace_cc_yyerrstatus--;
+
+ ace_cc_yystate = ace_cc_yyn;
+ goto ace_cc_yynewstate;
+
+/* Do the default action for the current state. */
+ace_cc_yydefault:
+
+ ace_cc_yyn = ace_cc_yydefact[ace_cc_yystate];
+ if (ace_cc_yyn == 0)
+ goto ace_cc_yyerrlab;
+
+/* Do a reduction. ace_cc_yyn is the number of a rule to reduce with. */
+ace_cc_yyreduce:
+ ace_cc_yylen = ace_cc_yyr2[ace_cc_yyn];
+ if (ace_cc_yylen > 0)
+ ace_cc_yyval = ace_cc_yyvsp[1-ace_cc_yylen]; /* implement default value of the action */
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ {
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ ace_cc_yyn, ace_cc_yyrline[ace_cc_yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = ace_cc_yyprhs[ace_cc_yyn]; ace_cc_yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", ace_cc_yytname[ace_cc_yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", ace_cc_yytname[ace_cc_yyr1[ace_cc_yyn]]);
+ }
+#endif
+
+
+ switch (ace_cc_yyn) {
+
+case 2:
+{ cmdlist->add(new CC_Sleep_Cmd(0));
+ /* dummy to check exeption in the last command */
+ if(cmdlist->execute()!=0) //CC_FAIL
+ { printf(" ** Test succeded!!\n"); }
+ else
+ { printf(" ** Test FAILED!!\n"); } ;
+ break;}
+case 3:
+{ cmdlist->add(ace_cc_yyvsp[0].command); ;
+ break;}
+case 4:
+{ cmdlist->add(ace_cc_yyvsp[0].command); ;
+ break;}
+case 5:
+{ ace_cc_yyval.command = new CC_Start_Cmd(ace_cc_yyvsp[-1].id); ;
+ break;}
+case 6:
+{ ace_cc_yyval.command = new CC_CreateLockSet_Cmd(ace_cc_yyvsp[-1].id); ;
+ break;}
+case 7:
+{ ace_cc_yyval.command = new CC_CreateLockSet_Cmd(""); ;
+ break;}
+case 8:
+{ ace_cc_yyval.command = new CC_Lock_Cmd(ace_cc_yyvsp[-2].id, ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 9:
+{ ace_cc_yyval.command = new CC_Lock_Cmd("", ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 10:
+{ ace_cc_yyval.command = new CC_UnLock_Cmd(ace_cc_yyvsp[-2].id, ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 11:
+{ ace_cc_yyval.command = new CC_UnLock_Cmd("", ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 12:
+{ ace_cc_yyval.command = new CC_TryLock_Cmd(ace_cc_yyvsp[-2].id, ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 13:
+{ ace_cc_yyval.command = new CC_TryLock_Cmd("", ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 14:
+{ ace_cc_yyval.command = new CC_ChangeMode_Cmd(ace_cc_yyvsp[-3].id, ace_cc_yyvsp[-2].lock_mode, ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 15:
+{ ace_cc_yyval.command = new CC_ChangeMode_Cmd("", ace_cc_yyvsp[-2].lock_mode, ace_cc_yyvsp[-1].lock_mode); ;
+ break;}
+case 16:
+{ ace_cc_yyval.command = new CC_Sleep_Cmd(ace_cc_yyvsp[-1].num); ;
+ break;}
+case 17:
+{ ace_cc_yyval.command = new CC_Wait_Cmd(""); ;
+ break;}
+case 18:
+{ ace_cc_yyval.command = new CC_Wait_Cmd(ace_cc_yyvsp[-1].id); ;
+ break;}
+case 19:
+{ ace_cc_yyval.command = new CC_Print_Cmd(ace_cc_yyvsp[-1].id); ;
+ break;}
+case 20:
+{ ace_cc_yyval.command = new CC_Lookup_Cmd(ace_cc_yyvsp[-1].id); ;
+ break;}
+case 21:
+{ cmdlist->setrepeat(ace_cc_yyvsp[-1].num);
+ ace_cc_yyval.command = new CC_Dummy_Cmd();;
+ break;}
+case 22:
+{ ace_cc_yyval.command = new CC_Excep_Cmd(ace_cc_yyvsp[-1].id); ;
+ break;}
+case 23:
+{ace_cc_yyval.id = ace_cc_yyvsp[0].id; ;
+ break;}
+case 24:
+{ace_cc_yyval.id = ace_cc_yyvsp[0].id; ;
+ break;}
+case 25:
+{ace_cc_yyval.id = ace_cc_yyvsp[0].id; ;
+ break;}
+case 26:
+{ ace_cc_yyval.lock_mode = CosConcurrencyControl::read; ;
+ break;}
+case 27:
+{ ace_cc_yyval.lock_mode = CosConcurrencyControl::intention_read; ;
+ break;}
+case 28:
+{ ace_cc_yyval.lock_mode = CosConcurrencyControl::upgrade; ;
+ break;}
+case 29:
+{ ace_cc_yyval.lock_mode = CosConcurrencyControl::write; ;
+ break;}
+case 30:
+{ ace_cc_yyval.lock_mode = CosConcurrencyControl::intention_write; ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+
+
+ ace_cc_yyvsp -= ace_cc_yylen;
+ ace_cc_yyssp -= ace_cc_yylen;
+#ifdef ACE_CC_YYLSP_NEEDED
+ ace_cc_yylsp -= ace_cc_yylen;
+#endif
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ {
+ short *ssp1 = ace_cc_yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != ace_cc_yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ *++ace_cc_yyvsp = ace_cc_yyval;
+
+#ifdef ACE_CC_YYLSP_NEEDED
+ ace_cc_yylsp++;
+ if (ace_cc_yylen == 0)
+ {
+ ace_cc_yylsp->first_line = ace_cc_yylloc.first_line;
+ ace_cc_yylsp->first_column = ace_cc_yylloc.first_column;
+ ace_cc_yylsp->last_line = (ace_cc_yylsp-1)->last_line;
+ ace_cc_yylsp->last_column = (ace_cc_yylsp-1)->last_column;
+ ace_cc_yylsp->text = 0;
+ }
+ else
+ {
+ ace_cc_yylsp->last_line = (ace_cc_yylsp+ace_cc_yylen-1)->last_line;
+ ace_cc_yylsp->last_column = (ace_cc_yylsp+ace_cc_yylen-1)->last_column;
+ }
+#endif
+
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
+
+ ace_cc_yyn = ace_cc_yyr1[ace_cc_yyn];
+
+ ace_cc_yystate = ace_cc_yypgoto[ace_cc_yyn - ACE_CC_YYNTBASE] + *ace_cc_yyssp;
+ if (ace_cc_yystate >= 0 && ace_cc_yystate <= ACE_CC_YYLAST && ace_cc_yycheck[ace_cc_yystate] == *ace_cc_yyssp)
+ ace_cc_yystate = ace_cc_yytable[ace_cc_yystate];
+ else
+ ace_cc_yystate = ace_cc_yydefgoto[ace_cc_yyn - ACE_CC_YYNTBASE];
+
+ goto ace_cc_yynewstate;
+
+ace_cc_yyerrlab: /* here on detecting error */
+
+ if (! ace_cc_yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++ace_cc_yynerrs;
+
+#ifdef ACE_CC_YYERROR_VERBOSE
+ ace_cc_yyn = ace_cc_yypact[ace_cc_yystate];
+
+ if (ace_cc_yyn > ACE_CC_YYFLAG && ace_cc_yyn < ACE_CC_YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -ace_cc_yyn if nec to avoid negative indexes in ace_cc_yycheck. */
+ for (x = (ace_cc_yyn < 0 ? -ace_cc_yyn : 0);
+ x < (sizeof(ace_cc_yytname) / sizeof(char *)); x++)
+ if (ace_cc_yycheck[x + ace_cc_yyn] == x)
+ size += strlen(ace_cc_yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (ace_cc_yyn < 0 ? -ace_cc_yyn : 0);
+ x < (sizeof(ace_cc_yytname) / sizeof(char *)); x++)
+ if (ace_cc_yycheck[x + ace_cc_yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, ace_cc_yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ ace_cc_yyerror(msg);
+ free(msg);
+ }
+ else
+ ace_cc_yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* ACE_CC_YYERROR_VERBOSE */
+ ace_cc_yyerror("parse error");
+ }
+
+ goto ace_cc_yyerrlab1;
+ace_cc_yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (ace_cc_yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (ace_cc_yychar == ACE_CC_YYEOF)
+ ACE_CC_YYABORT;
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", ace_cc_yychar, ace_cc_yytname[ace_cc_yychar1]);
+#endif
+
+ ace_cc_yychar = ACE_CC_YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ ace_cc_yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto ace_cc_yyerrhandle;
+
+ace_cc_yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ ace_cc_yyn = ace_cc_yydefact[ace_cc_yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (ace_cc_yyn) goto ace_cc_yydefault;
+#endif
+
+ace_cc_yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (ace_cc_yyssp == ace_cc_yyss) ACE_CC_YYABORT;
+ ace_cc_yyvsp--;
+ ace_cc_yystate = *--ace_cc_yyssp;
+#ifdef ACE_CC_YYLSP_NEEDED
+ ace_cc_yylsp--;
+#endif
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ {
+ short *ssp1 = ace_cc_yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != ace_cc_yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ace_cc_yyerrhandle:
+
+ ace_cc_yyn = ace_cc_yypact[ace_cc_yystate];
+ if (ace_cc_yyn == ACE_CC_YYFLAG)
+ goto ace_cc_yyerrdefault;
+
+ ace_cc_yyn += ACE_CC_YYTERROR;
+ if (ace_cc_yyn < 0 || ace_cc_yyn > ACE_CC_YYLAST || ace_cc_yycheck[ace_cc_yyn] != ACE_CC_YYTERROR)
+ goto ace_cc_yyerrdefault;
+
+ ace_cc_yyn = ace_cc_yytable[ace_cc_yyn];
+ if (ace_cc_yyn < 0)
+ {
+ if (ace_cc_yyn == ACE_CC_YYFLAG)
+ goto ace_cc_yyerrpop;
+ ace_cc_yyn = -ace_cc_yyn;
+ goto ace_cc_yyreduce;
+ }
+ else if (ace_cc_yyn == 0)
+ goto ace_cc_yyerrpop;
+
+ if (ace_cc_yyn == ACE_CC_YYFINAL)
+ ACE_CC_YYACCEPT;
+
+#if ACE_CC_YYDEBUG != 0
+ if (ace_cc_yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++ace_cc_yyvsp = ace_cc_yylval;
+#ifdef ACE_CC_YYLSP_NEEDED
+ *++ace_cc_yylsp = ace_cc_yylloc;
+#endif
+
+ ace_cc_yystate = ace_cc_yyn;
+ goto ace_cc_yynewstate;
+
+ ace_cc_yyacceptlab:
+ /* ACE_CC_YYACCEPT comes here. */
+ if (ace_cc_yyfree_stacks)
+ {
+ free (ace_cc_yyss);
+ free (ace_cc_yyvs);
+#ifdef ACE_CC_YYLSP_NEEDED
+ free (ace_cc_yyls);
+#endif
+ }
+ return 0;
+
+ ace_cc_yyabortlab:
+ /* ACE_CC_YYABORT comes here. */
+ if (ace_cc_yyfree_stacks)
+ {
+ free (ace_cc_yyss);
+ free (ace_cc_yyvs);
+#ifdef ACE_CC_YYLSP_NEEDED
+ free (ace_cc_yyls);
+#endif
+ }
+ return 1;
+}
+
+
+void
+ace_cc_yyerror (const char *s)
+{
+ ACE_OS::printf ("%d: %s at %s in:\n%s\n",
+ line_no,
+ s,
+ ace_cc_yytext,
+ line_buf);
+ ACE_OS::exit (-1);
+}
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_command.tab.h b/TAO/orbsvcs/tests/Concurrency/CC_command.tab.h
new file mode 100644
index 00000000000..71a69f98647
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_command.tab.h
@@ -0,0 +1,32 @@
+// $Id$
+
+typedef union {
+ CC_Command *command;
+ CosConcurrencyControl::lock_mode lock_mode;
+ char *id;
+ int num;
+} ACE_CC_YYSTYPE;
+#define T_START_CMD 257
+#define T_CREATE_CMD 258
+#define T_LOCK_CMD 259
+#define T_UNLOCK_CMD 260
+#define T_TRYLOCK_CMD 261
+#define T_CHANGEMODE_CMD 262
+#define T_SLEEP_CMD 263
+#define T_WAIT_CMD 264
+#define T_REPEAT_CMD 265
+#define T_EXCEP_CMD 266
+#define T_PRINT_CMD 267
+#define T_LOOKUP_CMD 268
+#define T_TERM 269
+#define T_READ 270
+#define T_IREAD 271
+#define T_UPGRADE 272
+#define T_WRITE 273
+#define T_IWRITE 274
+#define T_IDENT 275
+#define Q_STRING 276
+#define T_NUM 277
+
+
+extern ACE_CC_YYSTYPE ace_cc_yylval;
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_command.y b/TAO/orbsvcs/tests/Concurrency/CC_command.y
new file mode 100644
index 00000000000..339c8e47084
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_command.y
@@ -0,0 +1,126 @@
+/* $Id$
+ * ============================================================================
+ *
+ * = LIBRARY
+ * TAO/orbsvcs/tests
+ *
+ * = FILENAME
+ * CC_command.y
+ *
+ * = DESCRIPTION
+ * This is the yacc file for the concurrency service script language.
+ *
+ * = AUTHORS
+ * Torben Worm <tworm@cs.wustl.edu>
+ *
+ * ============================================================================
+ */
+%{
+#include "CC_command.h"
+#include "ace/ACE.h"
+#include "orbsvcs/CosConcurrencyControlC.h"
+
+void yyerror (const char* s);
+int yylex(void);
+
+extern int line_no;
+extern char line_buf[500];
+extern char *yytext;
+extern CC_CommandList *cmdlist;
+%}
+
+%union {
+ CC_Command *command;
+ CosConcurrencyControl::lock_mode lock_mode;
+ char *id;
+ int num;
+}
+
+%token T_START_CMD T_CREATE_CMD T_LOCK_CMD T_UNLOCK_CMD T_TRYLOCK_CMD
+%token T_CHANGEMODE_CMD T_SLEEP_CMD T_WAIT_CMD T_REPEAT_CMD T_EXCEP_CMD
+%token T_PRINT_CMD T_LOOKUP_CMD T_TERM
+%token T_READ T_IREAD T_UPGRADE T_WRITE T_IWRITE
+%token <id> T_IDENT Q_STRING
+%token <num> T_NUM
+
+%type <command> cmd
+%type <id> config_file_name lock_set_name exception_name
+%type <lock_mode> lock_mode
+
+%%
+start: /* empty */
+ | cmd_list { cmdlist->add(new CC_Sleep_Cmd(0));
+ /* dummy to check exeption in the last command */
+ if(cmdlist->execute()!=0) //CC_FAIL
+ { printf(" ** Test succeded!!\n"); }
+ else
+ { printf(" ** Test FAILED!!\n"); } }
+ ;
+
+cmd_list: cmd_list cmd { cmdlist->add($2); }
+ | cmd { cmdlist->add($1); }
+ ;
+
+cmd: T_START_CMD config_file_name T_TERM
+ { $$ = new CC_Start_Cmd($2); }
+ | T_CREATE_CMD lock_set_name T_TERM
+ { $$ = new CC_CreateLockSet_Cmd($2); }
+ | T_CREATE_CMD T_TERM
+ { $$ = new CC_CreateLockSet_Cmd(""); }
+ | T_LOCK_CMD lock_set_name lock_mode T_TERM
+ { $$ = new CC_Lock_Cmd($2, $3); }
+ | T_LOCK_CMD lock_mode T_TERM
+ { $$ = new CC_Lock_Cmd("", $2); }
+ | T_UNLOCK_CMD lock_set_name lock_mode T_TERM
+ { $$ = new CC_UnLock_Cmd($2, $3); }
+ | T_UNLOCK_CMD lock_mode T_TERM
+ { $$ = new CC_UnLock_Cmd("", $2); }
+ | T_TRYLOCK_CMD lock_set_name lock_mode T_TERM
+ { $$ = new CC_TryLock_Cmd($2, $3); }
+ | T_TRYLOCK_CMD lock_mode T_TERM
+ { $$ = new CC_TryLock_Cmd("", $2); }
+ | T_CHANGEMODE_CMD lock_set_name lock_mode lock_mode T_TERM
+ { $$ = new CC_ChangeMode_Cmd($2, $3, $4); }
+ | T_CHANGEMODE_CMD lock_mode lock_mode T_TERM
+ { $$ = new CC_ChangeMode_Cmd("", $2, $3); }
+ | T_SLEEP_CMD T_NUM T_TERM
+ { $$ = new CC_Sleep_Cmd($2); }
+ | T_WAIT_CMD T_TERM
+ { $$ = new CC_Wait_Cmd(""); }
+ | T_WAIT_CMD Q_STRING T_TERM
+ { $$ = new CC_Wait_Cmd($2); }
+ | T_PRINT_CMD Q_STRING T_TERM
+ { $$ = new CC_Print_Cmd($2); }
+ | T_LOOKUP_CMD lock_set_name T_TERM
+ { $$ = new CC_Lookup_Cmd($2); }
+ | T_REPEAT_CMD T_NUM T_TERM
+ { cmdlist->setrepeat($2);
+ $$ = new CC_Dummy_Cmd();}
+ | T_EXCEP_CMD exception_name T_TERM
+ { $$ = new CC_Excep_Cmd($2); }
+ ;
+
+config_file_name: T_IDENT {$$ = $1; }
+
+lock_set_name: T_IDENT {$$ = $1; }
+
+exception_name: T_IDENT {$$ = $1; }
+
+lock_mode: T_READ { $$ = CosConcurrencyControl::read; }
+ | T_IREAD { $$ = CosConcurrencyControl::intention_read; }
+ | T_UPGRADE { $$ = CosConcurrencyControl::upgrade; }
+ | T_WRITE { $$ = CosConcurrencyControl::write; }
+ | T_IWRITE { $$ = CosConcurrencyControl::intention_write; }
+
+%%
+
+void
+yyerror (const char *s)
+{
+ ACE_OS::printf ("%d: %s at %s in:\n%s\n",
+ line_no,
+ s,
+ yytext,
+ line_buf);
+ ACE_OS::exit (-1);
+}
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_naming_service.cpp b/TAO/orbsvcs/tests/Concurrency/CC_naming_service.cpp
new file mode 100644
index 00000000000..d12cb0d1e94
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_naming_service.cpp
@@ -0,0 +1,185 @@
+// $Id
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Concurrency
+//
+// = FILENAME
+// CC_naming_service.cpp
+//
+// = DESCRIPTION
+// This class implements the naming services necessary to test the
+// concurrency service
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "CC_naming_service.h"
+#include "ace/OS_NS_string.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(Concurrency, CC_naming_service, "$Id$")
+
+CC_naming_service::CC_naming_service (CORBA::ORB_var orb
+ ACE_ENV_ARG_DECL)
+ : cc_factory_key_ (0),
+ orb_ (0),
+ factory_ (0)
+{
+ this->Init(orb ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ instance_ = this;
+}
+
+CC_naming_service::CC_naming_service(void)
+ : cc_factory_key_ (0),
+ orb_ (0),
+ factory_ (0)
+{
+}
+
+void
+CC_naming_service::Init(CORBA::ORB_var orb
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = orb;
+
+ int success = init_naming_service ();
+ if (success < 0)
+ ACE_THROW (CORBA::INTERNAL ());
+}
+
+CC_naming_service::~CC_naming_service (void)
+{
+ // if(instance_!=0)
+ // delete instance_;
+ // @TAO somthing went wrong when these lines were uncommented
+}
+
+CC_naming_service *
+CC_naming_service::Instance(void)
+{
+ if(instance_ == 0)
+ {
+ instance_ = new CC_naming_service();
+ }
+ return instance_;
+}
+
+CORBA::Object_var
+CC_naming_service::get_obj_from_name (const char *c_name,
+ const char *name
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "C: %s, N: %s\n", c_name, name));
+ CORBA::Object_var obj;
+
+ ACE_TRY
+ {
+ if (ACE_OS::strlen (c_name) == 0)
+ {
+ CosNaming::Name ns_name (1);
+ ns_name.length (1);
+ ns_name[0].id = CORBA::string_dup (name);
+ obj = my_name_client_->resolve (ns_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ CosNaming::Name ns_name (2);
+ ns_name.length (2);
+ ns_name[0].id = CORBA::string_dup (c_name);
+ ns_name[1].id = CORBA::string_dup (name);
+ obj = my_name_client_->resolve (ns_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ if (CORBA::is_nil (obj.in ()) )
+ ACE_DEBUG((LM_DEBUG,
+ "OBJ was nill (aieee)\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_Client::get_obj_from_name (...)");
+ return obj;
+ }
+ ACE_ENDTRY;
+
+ return obj;
+}
+
+void
+CC_naming_service::bind_name (const char *n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "CC_Client::bind_name\n"));
+
+ ACE_TRY
+ {
+ CosNaming::Name ns_name (1);
+ ns_name.length (1);
+ ns_name[0].id = CORBA::string_dup (n);
+ my_name_client_->bind (ns_name,
+ obj
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_Client::bind_name (...)");
+ }
+ ACE_ENDTRY;
+}
+
+CosConcurrencyControl::LockSetFactory_var
+CC_naming_service::get_lock_set_factory (void)
+{
+ return this->factory_;
+}
+
+int
+CC_naming_service::init_naming_service (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the naming services
+ if (my_name_client_.init (orb_.in ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ CORBA::Object_var factory_obj = get_obj_from_name ("CosConcurrency",
+ "LockSetFactory"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->factory_ =
+ CosConcurrencyControl::LockSetFactory::_narrow
+ (factory_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->factory_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " could not resolve lock set factory in Naming service\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_Client::init_naming_service");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CC_naming_service* CC_naming_service::instance_ = 0;
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_naming_service.h b/TAO/orbsvcs/tests/Concurrency/CC_naming_service.h
new file mode 100644
index 00000000000..597a9696840
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_naming_service.h
@@ -0,0 +1,86 @@
+// -*- c++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Concurrency
+//
+// = FILENAME
+// CC_naming_service.h
+//
+// = DESCRIPTION
+// This class implements the naming services necessary to test the
+// concurrency service.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/CosConcurrencyControlC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+
+#ifndef _CC_NAMING_SERVICE_H_
+#define _CC_NAMING_SERVICE_H_
+
+class CC_naming_service
+{
+ // = TITLE
+ // Defines a class that encapsulates the necessary naming service
+ // functions for the concurrency service.
+ //
+ // = DESCRIPTION
+ // This class declares an interface to the naming service for the
+ // concurrency service tests.
+public:
+ CC_naming_service ();
+ // Default constructor
+
+ CC_naming_service (CORBA::ORB_var orb_ ACE_ENV_ARG_DECL);
+ // Constructor
+
+ ~CC_naming_service (void);
+ // Default destructor.
+
+ void Init (CORBA::ORB_var orb_ ACE_ENV_ARG_DECL);
+ // Initialization method must be called after first call of Instance()
+ // in order to initialize the object correctly
+
+ CORBA::Object_var get_obj_from_name (const char *c_name,
+ const char *name
+ ACE_ENV_ARG_DECL);
+ // Lookup a name in the naming service (context, name)
+
+ void bind_name (const char *n,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL);
+ // Bind a name in the concurrency context.
+
+ CosConcurrencyControl::LockSetFactory_var get_lock_set_factory (void);
+ // Gets the cc lock set factory which is common for all tests.
+
+ static CC_naming_service *Instance(void);
+ // The naming service object is a singleton
+
+private:
+ int init_naming_service (void);
+ // Function to initialize the naming service.
+
+ char *cc_factory_key_;
+ // Key of factory obj ref.
+
+ CORBA::ORB_var orb_;
+ // Remember our orb.
+
+ TAO_Naming_Client my_name_client_;
+ // Name service wrapper class
+
+ CosConcurrencyControl::LockSetFactory_var factory_;
+ // factory pointer for the lock set.
+
+ static CC_naming_service *instance_;
+ // The instance of the naming service object
+};
+#endif /* !defined (_CC_NAMING_SERVICE_H_) */
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_test_utils.cpp b/TAO/orbsvcs/tests/Concurrency/CC_test_utils.cpp
new file mode 100644
index 00000000000..f88b2b65f7e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_test_utils.cpp
@@ -0,0 +1,73 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests
+//
+// = FILENAME
+// CC_test_utils.cpp
+//
+// = DESCRIPTION
+// This class provides a namespace for utility functions for the
+// concurrency service test.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "CC_test_utils.h"
+#include "CC_naming_service.h"
+#include "ace/OS.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(Concurrency, CC_test_utils, "$Id$")
+
+char *CC_TestUtils::get_lock_mode_name (CosConcurrencyControl::lock_mode mode)
+{
+ if (mode==CosConcurrencyControl::read)
+ return const_cast<char*> ("read");
+
+ if (mode==CosConcurrencyControl::write)
+ return const_cast<char*> ("write");
+
+ if (mode==CosConcurrencyControl::upgrade)
+ return const_cast<char*> ("upgrade");
+
+ if (mode==CosConcurrencyControl::intention_read)
+ return const_cast<char*> ("intention_read");
+
+ if (mode==CosConcurrencyControl::intention_write)
+ return const_cast<char*> ("intention_write");
+
+ return const_cast<char*> ("unknown lock mode");
+}
+
+CosConcurrencyControl::LockSet_ptr
+CC_TestUtils::create_lock_set (void)
+{
+ // Create the lock set and return an obj ref corresponding to the
+ // key.
+ CosConcurrencyControl::LockSet_ptr lock_set(0);
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ lock_set =
+ CC_naming_service::Instance()->get_lock_set_factory ()->create (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (lock_set))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "null lock set objref returned by factory\n"),
+ 0);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_Client::create_lock_set");
+ return 0;
+ }
+ ACE_ENDTRY;
+ return lock_set;
+}
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_test_utils.h b/TAO/orbsvcs/tests/Concurrency/CC_test_utils.h
new file mode 100644
index 00000000000..4c1a643f863
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_test_utils.h
@@ -0,0 +1,37 @@
+/* -*- C++ -*- */
+// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests
+//
+// = FILENAME
+// CC_test_utils.h
+//
+// = DESCRIPTION
+// This class provides a namespace for utility functions for the
+// concurrency service test.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/CosConcurrencyControlC.h"
+
+#ifndef _CC_TEST_UTILS_H_
+#define _CC_TEST_UTILS_H_
+
+class CC_TestUtils
+{
+ public:
+ static char *get_lock_mode_name (CosConcurrencyControl::lock_mode mode);
+ // Function to return a human readable string from a lock_mode enum.
+
+ static CosConcurrencyControl::LockSet_ptr create_lock_set (void);
+ // Creates a lock set by means of th lock set factory in the concurrency
+ // service server.
+ private:
+};
+
+#endif /* _CC_TEST_UTILS_H_ */
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_tests.cpp b/TAO/orbsvcs/tests/Concurrency/CC_tests.cpp
new file mode 100644
index 00000000000..5dfccef2eb5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_tests.cpp
@@ -0,0 +1,388 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Concurrency
+//
+// = FILENAME
+// CC_tests.h
+//
+// = DESCRIPTION
+// This class implements a number of test objects to test the
+// concurrency service.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "CC_tests.h"
+#include "ace/OS.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(Concurrency, CC_tests, "$Id$")
+
+CC_Test::CC_Test (CC_naming_service *ns)
+ : result (CC_FAIL),
+ naming_service_ (ns)
+{
+}
+
+CC_Test::~CC_Test (void)
+{
+}
+
+CosConcurrencyControl::LockSet_ptr
+CC_Test::create_lock_set (void)
+{
+ // Create the lock set and return an obj ref corresponding to the
+ // key.
+ CosConcurrencyControl::LockSet_ptr lock_set(0);
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ lock_set =
+ this->naming_service_->get_lock_set_factory ()->create (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (lock_set))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "null lock set objref returned by factory\n"),
+ 0);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CC_Client::create_lock_set");
+ return 0;
+ }
+ ACE_ENDTRY;
+ return lock_set;
+}
+
+char *
+CC_Test::get_lock_mode_name (CosConcurrencyControl::lock_mode mode)
+{
+ if (mode==CosConcurrencyControl::read)
+ return const_cast<char *> ("read");
+
+ if (mode==CosConcurrencyControl::write)
+ return const_cast<char *> ("write");
+
+ if (mode==CosConcurrencyControl::upgrade)
+ return const_cast<char *> ("upgrade");
+
+ if (mode==CosConcurrencyControl::intention_read)
+ return const_cast<char *> ("intension_read");
+
+ if (mode==CosConcurrencyControl::intention_write)
+ return const_cast<char *> ("intension_write");
+
+ return const_cast<char *> ("unknown lock mode");
+}
+
+// ================================
+// Here the tests start.
+
+Test_Single_Lock_With_Mode::Test_Single_Lock_With_Mode (CC_naming_service *naming_service,
+ CosConcurrencyControl::lock_mode mode)
+ : CC_Test (naming_service),
+ mode_ (mode)
+{
+}
+
+Test_Single_Lock_With_Mode::~Test_Single_Lock_With_Mode (void)
+{
+}
+
+int
+Test_Single_Lock_With_Mode::run (int /* times_to_run */)
+{
+ CORBA::Boolean lock_not_held;
+
+ CosConcurrencyControl::LockSet_ptr cc_lock_set_ = create_lock_set ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ cc_lock_set_->lock (mode_ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock set\n",
+ get_lock_mode_name (mode_)));
+
+ lock_not_held = cc_lock_set_->try_lock (mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (lock_not_held)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock not held\n",
+ get_lock_mode_name (mode_)));
+ return CC_FAIL;
+ }
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock held\n",
+ get_lock_mode_name (mode_)));
+
+ cc_lock_set_->unlock (mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock released\n",
+ get_lock_mode_name (mode_)));
+
+ lock_not_held = cc_lock_set_->try_lock (mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (lock_not_held)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock not held\n",
+ get_lock_mode_name (mode_)));
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock held\n",
+ get_lock_mode_name (mode_)));
+ return CC_FAIL;
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test_Single_Lock_With_Mode::run");
+ return CC_FAIL;
+ }
+ ACE_ENDTRY;
+
+ CORBA::release (cc_lock_set_);
+
+ return CC_SUCCESS;
+}
+
+// ================================
+
+Test_Setup_LockSet::Test_Setup_LockSet (CC_naming_service *naming_service,
+ char *name)
+ : CC_Test (naming_service),
+ my_name_ (name)
+{
+}
+
+Test_Setup_LockSet::~Test_Setup_LockSet (void)
+{
+}
+
+int
+Test_Setup_LockSet::run (int /* times_to_run */)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosConcurrencyControl::LockSet_ptr cc_lock_set_ =
+ create_lock_set ();
+ this->naming_service_->bind_name (my_name_, cc_lock_set_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Name bound\n"));
+
+ cc_lock_set_->lock (CosConcurrencyControl::read
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Read lock set\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test_Against_Other_LockSet::run");
+ return CC_FAIL;
+ }
+ ACE_ENDTRY;
+
+ return CC_SUCCESS;
+}
+
+// ================================
+
+Test_Use_Already_Created_LockSet::
+Test_Use_Already_Created_LockSet (CC_naming_service *naming_service,
+ char *name)
+ : CC_Test (naming_service),
+ my_name_ (name)
+{
+}
+
+Test_Use_Already_Created_LockSet::~Test_Use_Already_Created_LockSet (void)
+{
+}
+
+int
+Test_Use_Already_Created_LockSet::run (int /* times_to_run */)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Object_var ccls_obj =
+ this->naming_service_->get_obj_from_name (const_cast<char *> (""),
+ my_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosConcurrencyControl::LockSet_var ccls =
+ CosConcurrencyControl::LockSet::_narrow (ccls_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ccls->lock (CosConcurrencyControl::read
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test_Against_Other_LockSet::run");
+ return CC_FAIL;
+ }
+ ACE_ENDTRY;
+
+ return CC_SUCCESS;
+}
+
+// ================================
+
+Test_Unlock_Already_Created_LockSet::
+Test_Unlock_Already_Created_LockSet (CC_naming_service *naming_service,
+ char *name)
+ : CC_Test (naming_service),
+ my_name_ (name)
+{
+}
+
+Test_Unlock_Already_Created_LockSet::~Test_Unlock_Already_Created_LockSet (void)
+{
+}
+
+int
+Test_Unlock_Already_Created_LockSet::run (int /* times_to_run */)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::Object_var ccls_obj =
+ this->naming_service_->get_obj_from_name (const_cast<char *> (""), my_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosConcurrencyControl::LockSet_var ccls =
+ CosConcurrencyControl::LockSet::_narrow (ccls_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ccls->unlock (CosConcurrencyControl::read
+ ACE_ENV_ARG_PARAMETER);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test_Unlock_Already_Created_LockSet::run");
+ return CC_FAIL;
+ }
+ ACE_ENDTRY;
+
+ return CC_SUCCESS;
+}
+
+// ================================
+
+Test_Release_Not_Held_Lock::Test_Release_Not_Held_Lock (CC_naming_service *naming_service,
+ CosConcurrencyControl::lock_mode mode)
+ : CC_Test (naming_service),
+ mode_ (mode)
+{
+}
+
+Test_Release_Not_Held_Lock::~Test_Release_Not_Held_Lock (void)
+{
+}
+
+int
+Test_Release_Not_Held_Lock::run (int /* times_to_run */)
+{
+ CORBA::Boolean lock_not_held;
+
+ // Create the lock set
+ CosConcurrencyControl::LockSet_ptr cc_lock_set_ = create_lock_set ();
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // lock the lock
+ cc_lock_set_->lock (mode_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock set\n",
+ get_lock_mode_name (mode_)));
+
+ // check to see if the lock is held
+ lock_not_held = cc_lock_set_->try_lock (mode_
+ ACE_ENV_ARG_PARAMETER);
+
+ if (lock_not_held)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock not held\n",
+ get_lock_mode_name (mode_)));
+ return CC_FAIL;
+ }
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock held\n",
+ get_lock_mode_name (mode_)));
+
+ // release the lock
+ cc_lock_set_->unlock (mode_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s lock released\n",
+ get_lock_mode_name (mode_)));
+
+ // release the lock again. this should raise an exception
+ cc_lock_set_->unlock (mode_
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "attemptet to release %s lock\n",
+ get_lock_mode_name (mode_)));
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH(CosConcurrencyControl::LockNotHeld, userex)
+ {
+ // We should end here
+ ACE_UNUSED_ARG (userex);
+ ACE_DEBUG((LM_DEBUG, "CosConcurrencyControl::LockNotHeld\n"));
+ return CC_SUCCESS;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test_Release_Not_Held_Lock::run");
+ return CC_FAIL;
+ }
+ ACE_ENDTRY;
+
+ CORBA::release (cc_lock_set_);
+
+ return CC_FAIL;
+}
diff --git a/TAO/orbsvcs/tests/Concurrency/CC_tests.h b/TAO/orbsvcs/tests/Concurrency/CC_tests.h
new file mode 100644
index 00000000000..9f0083fd2ad
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/CC_tests.h
@@ -0,0 +1,183 @@
+// -*- c++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Concurrency
+//
+// = FILENAME
+// CC_tests.h
+//
+// = DESCRIPTION
+// This class implements a number of test objects to test the
+// concurrency service.
+//
+// = AUTHORS
+// Torben Worm <tworm@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/CosConcurrencyControlC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "CC_naming_service.h"
+
+#ifndef _CC_TESTS_H_
+#define _CC_TESTS_H_
+
+// Return codes for the tests
+enum
+{
+ CC_FAIL,
+ CC_SUCCESS = 1
+};
+
+class CC_Test
+{
+ // = TITLE
+ // Defines an abstract base class for a test
+ //
+ // = DESCRIPTION
+ // This class declares an interface to run the test of the
+ // concurrency service.
+public:
+ CC_Test (CC_naming_service *ns);
+ // Default constructor
+
+ virtual ~CC_Test (void);
+ // Destructor
+
+ virtual int run (int times_to_run = 1) = 0;
+ // Run the test times_to_run number of times. Returns CC_SUCCESS on
+ // success CC_FAIL otherwise.
+
+ CosConcurrencyControl::LockSet_ptr create_lock_set (void);
+ // Create a new lock set using the default global lock set factory
+ // from the naming service.
+
+ char *get_lock_mode_name (CosConcurrencyControl::lock_mode mode);
+ // Returns a human readable string from the lock mode enum.
+
+protected:
+ int result;
+ // The result of the test being performed.
+
+ CC_naming_service *naming_service_;
+ // The naming service beeing used to register and look up locks
+};
+
+class Test_Single_Lock_With_Mode : public CC_Test
+{
+ // = TITLE
+ // This is a simple test that checks that it is possible to set
+ // the lock in the desired mode, try it, and release it.
+public:
+ Test_Single_Lock_With_Mode (CC_naming_service *naming_service,
+ CosConcurrencyControl::lock_mode mode);
+ // Default constructor. The naming service must be initialized
+ // before calling this method. The mode is the mode of the lock to
+ // be tested.
+
+ virtual ~Test_Single_Lock_With_Mode (void);
+ // Destructor
+
+ virtual int run (int times_to_run = 1);
+ // Runs the test the specified number of times.
+
+private:
+ CosConcurrencyControl::lock_mode mode_;
+ // The lock mode of the lock being tested
+};
+
+class Test_Setup_LockSet : public CC_Test
+{
+ // = TITLE
+ // This class creates a read lock, registeres it with the naming
+ // service and locks it.
+public:
+ Test_Setup_LockSet (CC_naming_service *naming_service_,
+ char *name);
+ // Default constructor. The naming service must be initialized
+ // before calling this method. The name is the name the lock will be
+ // registered under in the naming service.
+
+ virtual ~Test_Setup_LockSet (void);
+ // Destructor
+
+ virtual int run (int times_to_run = 1);
+ // Runs the test the specified number of times.
+
+private:
+ char *my_name_;
+ // The name of the lock
+};
+
+class Test_Use_Already_Created_LockSet : public CC_Test
+{
+ // = TITLE
+ // This class looks up the lock in the naming service and locks
+ // it.
+public:
+ Test_Use_Already_Created_LockSet (CC_naming_service *naming_service_,
+ char *name);
+ // Default constructor. The naming service must be initialized
+ // before calling this method. The name is the name the lock will be
+ // looked up under in the naming service.
+
+ virtual ~Test_Use_Already_Created_LockSet (void);
+ // Destructor
+
+ virtual int run (int times_to_run = 1);
+ // Runs the test the specified number of times.
+
+private:
+ char *my_name_;
+ // The name of the lock
+};
+
+class Test_Unlock_Already_Created_LockSet : public CC_Test
+{
+ // = TITLE
+ // This class looks up the lock in the naming service and unlocks
+ // it.
+public:
+ Test_Unlock_Already_Created_LockSet (CC_naming_service *naming_service_,
+ char *name);
+ // Default constructor. The naming service must be initialized
+ // before calling this method. The name is the name the lock will be
+ // looked up under in the naming service.
+
+ virtual ~Test_Unlock_Already_Created_LockSet (void);
+ // Destructor
+
+ virtual int run (int times_to_run = 1);
+ // Runs the test the specified number of times.
+
+private:
+ char *my_name_;
+ // The name of the lock
+};
+
+class Test_Release_Not_Held_Lock : public CC_Test
+{
+ // = TITLE
+ // This class tests that the LockNotHeld exception is thrown if a
+ // not held lock is released.
+public:
+ Test_Release_Not_Held_Lock (CC_naming_service *naming_service_,
+ CosConcurrencyControl::lock_mode mode_);
+ // Default constructor. The naming service must be initialized
+ // before calling this method. The mode is the mode of the lock
+
+ virtual ~Test_Release_Not_Held_Lock (void);
+ // Destructor
+
+ virtual int run (int times_to_run = 1);
+ // Runs the test the specified number of times.
+
+private:
+ CosConcurrencyControl::lock_mode mode_;
+ // The lock mode of the lock being tested
+};
+
+#endif /* !defined (_CC_TESTS_H_) */
diff --git a/TAO/orbsvcs/tests/Concurrency/Concurrency.mpc b/TAO/orbsvcs/tests/Concurrency/Concurrency.mpc
new file mode 100644
index 00000000000..e2242dffa83
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/Concurrency.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(CC client) : orbsvcsexe, concurrency, naming, svc_utils, iortable, portableserver {
+ exename = CC_client
+}
diff --git a/TAO/orbsvcs/tests/Concurrency/Makefile.am b/TAO/orbsvcs/tests/Concurrency/Makefile.am
new file mode 100644
index 00000000000..d73d8319cc3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/Makefile.am
@@ -0,0 +1,59 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.CC_client.am
+
+noinst_PROGRAMS = CC_client
+
+CC_client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+CC_client_SOURCES = \
+ CC_client.cpp \
+ CC_command.cpp \
+ CC_command.tab.cpp \
+ CC_naming_service.cpp \
+ CC_test_utils.cpp \
+ CC_tests.cpp \
+ lex.CC_command.cpp \
+ CC_client.h \
+ CC_command.h \
+ CC_command.tab.h \
+ CC_naming_service.h \
+ CC_test_utils.h \
+ CC_tests.h
+
+CC_client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosConcurrency.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Concurrency/README b/TAO/orbsvcs/tests/Concurrency/README
new file mode 100644
index 00000000000..07fd0ced426
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/README
@@ -0,0 +1,111 @@
+$Id$
+
+This is the readme file for the tests of the concurrency service.
+
+The test program has been changed to use a configuration file instead of
+hard coded test procedures. The old test procedures are left in the
+program for backwards compatibility, but they will be removed at a later
+point in time.
+
+The description of the old tests is in the readme file for the
+concurrency service in the directory:
+ $TAO_ROOT/orbsvcs/Concurrency_Control
+please consult this file for a decription of these tests.
+
+The new tests are described by this simle test language:
+
+start: /* empty */
+ | cmd_list
+ ;
+
+cmd_list: cmd_list cmd
+ | cmd
+ ;
+
+cmd: start <config_file_name> ;
+ | create <lock_set_name> ;
+ | create ;
+ | lock <lock_set_name> <lock_mode> ;
+ | lock <lock_mode> ;
+ | unlock <lock_set_name> <lock_mode> ;
+ | unlock <lock_mode> ;
+ | try_lock <lock_set_name> <lock_mode> ;
+ | try_lock <lock_mode> ;
+ | change_mode <lock_set_name> <lock_mode> <lock_mode> ;
+ | change_mode <lock_mode> <lock_mode> ;
+ | lookup <lock_set_name> ;
+ | sleep <int> ;
+ | repeat <int> ;
+ | wait ;
+ | wait <prompt> ;
+ ;
+
+lock_mode: read | intention_read | upgrade | write | intention_write
+
+prompt: " string "
+
+If the lock set name is left out the default lock set is used. The
+repeat command just sets a global variable in the test, i.e. the last
+repeat command is the one that will take effect - the whole script is
+run the specified number of times.
+
+An example of a script (assuming it's called 'test.cfg' - comments are
+not supported):
+
+ // Start a new CC_client with test.txt as script file
+ start test.txt;
+ // Create the lock set "ls1" and register it in the naming service
+ create ls1;
+ // Lock the read lock in the lock set
+ lock ls1 read;
+ // Try the read lock
+ try_lock ls1 read;
+ // sleep two seconds
+ sleep 2;
+ // Wait for the user to press enter
+ wait;
+ // Unlock the read lock in the ls1 lock set
+ unlock ls1 read;
+ // Change the mode of the read lock in the ls1 lock set to write mode
+ change_mode ls1 read write;
+
+The test can be run with the command ./CC_client -c test.cfg.
+
+There are currentlig the following tests in the
+ $TAO_ROOT/orbsvcs/tests/Concurrency
+directory:
+ basic_tests.cfg The same as running ./CC_client -b
+ extended_tests.cfg The same as running ./CC_client -e '1;test'
+ ./CC_client -e '2;test'
+ ./CC_client -e '3;test'
+ test.dinphil Dining philosophers. Uses test.phil[1-5]
+
+----------------------------------------
+
+THE IMPLEMENTATION
+
+The implementation of the concurrency service tests is located in
+the $TAO_ROOT/orbsvcs/tests/Concurrency directory and consists of
+the following files:
+
+ CC_client.{h,cpp} contain initialization and the main function.
+
+ CC_tests.{h,cpp} The old tests [-b] and [-e] options to CC_client
+
+ CC_command.{h,cpp} The commands that can be used in the scripting
+ language are implemented in these files. The list of
+ commands to execute is also implemented here.
+
+ CC_command.l The lex file for the script language.
+
+ CC_command.y The yacc file for the script language.
+
+ CC_command.tab.{h,cpp} and lex.CC_command.cpp Derived files from
+ the lex and yacc files.
+
+ CC_naming_service.{h,cpp} A wrapper class around the necessary
+ naming service functinallity for the tests.
+
+ CC_test_utils.{h,cpp} provides a namespace for utility functions.
+
+ test.* Test scripts for the concurrency service. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp b/TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp
new file mode 100644
index 00000000000..d301a466f67
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp
@@ -0,0 +1,1702 @@
+// $Id$
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp
+ */
+
+#define FLEX_SCANNER
+#define ACE_CC_YY_FLEX_MAJOR_VERSION 2
+#define ACE_CC_YY_FLEX_MINOR_VERSION 5
+
+#include "ace/OS_NS_string.h"
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include /**/ <stdlib.h>
+
+/* Use prototypes in function declarations. */
+#define ACE_CC_YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define ACE_CC_YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define ACE_CC_YY_USE_PROTOS
+#define ACE_CC_YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include /**/ <io.h>
+#include /**/ <stdlib.h>
+#define ACE_CC_YY_USE_CONST
+#define ACE_CC_YY_USE_PROTOS
+#endif
+
+#ifdef ACE_CC_YY_USE_CONST
+#define ace_cc_yyconst const
+#else
+#define ace_cc_yyconst
+#endif
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+#define ACE_CC_YY_PROTO(proto) proto
+#else
+#define ACE_CC_YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define ACE_CC_YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define ACE_CC_YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN ace_cc_yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The ACE_CC_YYSTATE alias is for lex
+ * compatibility.
+ */
+#define ACE_CC_YY_START ((ace_cc_yy_start - 1) / 2)
+#define ACE_CC_YYSTATE ACE_CC_YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define ACE_CC_YY_STATE_EOF(state) (ACE_CC_YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define ACE_CC_YY_NEW_FILE ace_cc_yyrestart( ace_cc_yyin )
+
+#define ACE_CC_YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define ACE_CC_YY_BUF_SIZE 16384
+
+typedef struct ace_cc_yy_buffer_state *ACE_CC_YY_BUFFER_STATE;
+
+extern int ace_cc_yyleng;
+extern FILE *ace_cc_yyin, *ace_cc_yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * ace_cc_yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the ace_cc_yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define ace_cc_yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up ace_cc_yytext. */ \
+ *ace_cc_yy_cp = ace_cc_yy_hold_char; \
+ ACE_CC_YY_RESTORE_ACE_CC_YY_MORE_OFFSET \
+ ace_cc_yy_c_buf_p = ace_cc_yy_cp = ace_cc_yy_bp + n - ACE_CC_YY_MORE_ADJ; \
+ ACE_CC_YY_DO_BEFORE_ACTION; /* set up ace_cc_yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) ace_cc_yyunput( c, ace_cc_yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int ace_cc_yy_size_t;
+
+
+struct ace_cc_yy_buffer_state
+ {
+ FILE *ace_cc_yy_input_file;
+
+ char *ace_cc_yy_ch_buf; /* input buffer */
+ char *ace_cc_yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ ace_cc_yy_size_t ace_cc_yy_buf_size;
+
+ /* Number of characters read into ace_cc_yy_ch_buf, not including EOB
+ * characters.
+ */
+ int ace_cc_yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int ace_cc_yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int ace_cc_yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int ace_cc_yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int ace_cc_yy_fill_buffer;
+
+ int ace_cc_yy_buffer_status;
+#define ACE_CC_YY_BUFFER_NEW 0
+#define ACE_CC_YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as ACE_CC_YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via ace_cc_yyrestart()), so that the user can continue scanning by
+ * just pointing ace_cc_yyin at a new input file.
+ */
+#define ACE_CC_YY_BUFFER_EOF_PENDING 2
+ };
+
+static ACE_CC_YY_BUFFER_STATE ace_cc_yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define ACE_CC_YY_CURRENT_BUFFER ace_cc_yy_current_buffer
+
+
+/* ace_cc_yy_hold_char holds the character lost when ace_cc_yytext is formed. */
+static char ace_cc_yy_hold_char;
+
+static int ace_cc_yy_n_chars; /* number of characters read into ace_cc_yy_ch_buf */
+
+
+int ace_cc_yyleng;
+
+/* Points to current character in buffer. */
+static char *ace_cc_yy_c_buf_p = (char *) 0;
+static int ace_cc_yy_init = 1; /* whether we need to initialize */
+static int ace_cc_yy_start = 0; /* start state number */
+
+#define ace_cc_yywrap() 1
+/* Flag which is used to allow ace_cc_yywrap()'s to do buffer switches
+ * instead of setting up a fresh ace_cc_yyin. A bit of a hack ...
+ */
+#if (ace_cc_yywrap() != 1)
+static int ace_cc_yy_did_buffer_switch_on_eof;
+#endif
+
+void ace_cc_yyrestart ACE_CC_YY_PROTO(( FILE *input_file ));
+
+void ace_cc_yy_switch_to_buffer ACE_CC_YY_PROTO(( ACE_CC_YY_BUFFER_STATE new_buffer ));
+void ace_cc_yy_load_buffer_state ACE_CC_YY_PROTO(( void ));
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_create_buffer ACE_CC_YY_PROTO(( FILE *file, int size ));
+void ace_cc_yy_delete_buffer ACE_CC_YY_PROTO(( ACE_CC_YY_BUFFER_STATE b ));
+void ace_cc_yy_init_buffer ACE_CC_YY_PROTO(( ACE_CC_YY_BUFFER_STATE b, FILE *file ));
+void ace_cc_yy_flush_buffer ACE_CC_YY_PROTO(( ACE_CC_YY_BUFFER_STATE b ));
+#define ACE_CC_YY_FLUSH_BUFFER ace_cc_yy_flush_buffer( ace_cc_yy_current_buffer )
+
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_buffer ACE_CC_YY_PROTO(( char *base, ace_cc_yy_size_t size ));
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_string ACE_CC_YY_PROTO(( ace_cc_yyconst char *ace_cc_yy_str ));
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_bytes ACE_CC_YY_PROTO(( ace_cc_yyconst char *bytes, int len ));
+
+static void *ace_cc_yy_flex_alloc ACE_CC_YY_PROTO(( ace_cc_yy_size_t ));
+static void *ace_cc_yy_flex_realloc ACE_CC_YY_PROTO(( void *, ace_cc_yy_size_t ));
+static void ace_cc_yy_flex_free ACE_CC_YY_PROTO(( void * ));
+
+#define ace_cc_yy_new_buffer ace_cc_yy_create_buffer
+
+#define ace_cc_yy_set_interactive(is_interactive) \
+ { \
+ if ( ! ace_cc_yy_current_buffer ) \
+ ace_cc_yy_current_buffer = ace_cc_yy_create_buffer( ace_cc_yyin, ACE_CC_YY_BUF_SIZE ); \
+ ace_cc_yy_current_buffer->ace_cc_yy_is_interactive = is_interactive; \
+ }
+
+#define ace_cc_yy_set_bol(at_bol) \
+ { \
+ if ( ! ace_cc_yy_current_buffer ) \
+ ace_cc_yy_current_buffer = ace_cc_yy_create_buffer( ace_cc_yyin, ACE_CC_YY_BUF_SIZE ); \
+ ace_cc_yy_current_buffer->ace_cc_yy_at_bol = at_bol; \
+ }
+
+#define ACE_CC_YY_AT_BOL() (ace_cc_yy_current_buffer->ace_cc_yy_at_bol)
+
+
+#define ACE_CC_YY_SKIP_ACE_CC_YYWRAP
+typedef unsigned char ACE_CC_YY_CHAR;
+FILE *ace_cc_yyin = (FILE *) 0, *ace_cc_yyout = (FILE *) 0;
+typedef int ace_cc_yy_state_type;
+extern char *ace_cc_yytext;
+#define ace_cc_yytext_ptr ace_cc_yytext
+
+static ace_cc_yy_state_type ace_cc_yy_get_previous_state ACE_CC_YY_PROTO(( void ));
+static ace_cc_yy_state_type ace_cc_yy_try_NUL_trans ACE_CC_YY_PROTO(( ace_cc_yy_state_type current_state ));
+static int ace_cc_yy_get_next_buffer ACE_CC_YY_PROTO(( void ));
+static void ace_cc_yy_fatal_error ACE_CC_YY_PROTO(( ace_cc_yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up ace_cc_yytext.
+ */
+#define ACE_CC_YY_DO_BEFORE_ACTION \
+ ace_cc_yytext_ptr = ace_cc_yy_bp; \
+ ace_cc_yyleng = (int) (ace_cc_yy_cp - ace_cc_yy_bp); \
+ ace_cc_yy_hold_char = *ace_cc_yy_cp; \
+ *ace_cc_yy_cp = '\0'; \
+ ace_cc_yy_c_buf_p = ace_cc_yy_cp;
+
+#define ACE_CC_YY_NUM_RULES 25
+#define ACE_CC_YY_END_OF_BUFFER 26
+static ace_cc_yyconst short int ace_cc_yy_accept[124] =
+ { 0,
+ 0, 0, 26, 25, 24, 23, 25, 20, 1, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 25, 24, 23, 0, 19, 20, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 0, 21, 21, 21, 21, 21, 21, 21, 21,
+ 21, 21, 21, 21, 21, 21, 21, 21, 0, 22,
+ 21, 21, 21, 21, 4, 21, 21, 14, 21, 21,
+ 21, 21, 21, 21, 9, 21, 21, 21, 21, 21,
+ 21, 10, 21, 8, 2, 21, 21, 21, 17, 21,
+ 3, 21, 21, 13, 11, 21, 5, 21, 21, 21,
+
+ 21, 21, 16, 21, 21, 21, 6, 21, 12, 21,
+ 21, 21, 7, 21, 21, 21, 21, 21, 21, 15,
+ 21, 18, 0
+ } ;
+
+static ace_cc_yyconst int ace_cc_yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 1, 4, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 5, 6, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 5, 8, 1,
+ 1, 1, 1, 1, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 1, 1, 1, 1, 10, 1, 11, 9, 12, 13,
+
+ 14, 9, 15, 16, 17, 9, 18, 19, 20, 21,
+ 22, 23, 9, 24, 25, 26, 27, 9, 28, 29,
+ 30, 9, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static ace_cc_yyconst int ace_cc_yy_meta[31] =
+ { 0,
+ 1, 2, 1, 1, 3, 3, 3, 1, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
+ } ;
+
+static ace_cc_yyconst short int ace_cc_yy_base[128] =
+ { 0,
+ 0, 136, 141, 143, 0, 137, 135, 131, 143, 0,
+ 15, 108, 115, 113, 110, 119, 14, 108, 11, 24,
+ 125, 0, 127, 125, 124, 120, 0, 115, 111, 112,
+ 97, 24, 105, 26, 107, 109, 89, 99, 102, 99,
+ 98, 112, 92, 101, 97, 96, 91, 90, 86, 93,
+ 91, 90, 79, 92, 79, 76, 73, 72, 95, 143,
+ 81, 69, 71, 72, 0, 65, 65, 0, 79, 66,
+ 62, 68, 74, 74, 0, 70, 69, 68, 55, 54,
+ 56, 0, 52, 0, 0, 55, 58, 62, 0, 64,
+ 0, 56, 55, 0, 0, 59, 0, 56, 49, 46,
+
+ 45, 48, 0, 43, 43, 42, 0, 49, 0, 51,
+ 46, 14, 0, 45, 30, 40, 30, 32, 18, 0,
+ 29, 0, 143, 49, 52, 38, 55
+ } ;
+
+static ace_cc_yyconst short int ace_cc_yy_def[128] =
+ { 0,
+ 123, 1, 123, 123, 124, 123, 125, 123, 123, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+ 123, 124, 123, 125, 125, 123, 126, 126, 126, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 127, 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126, 127, 123,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
+ 126, 126, 0, 123, 123, 123, 123
+ } ;
+
+static ace_cc_yyconst short int ace_cc_yy_nxt[174] =
+ { 0,
+ 4, 5, 6, 7, 4, 4, 8, 9, 10, 4,
+ 10, 11, 10, 12, 10, 10, 13, 10, 14, 10,
+ 10, 10, 15, 16, 17, 18, 19, 20, 10, 10,
+ 28, 38, 35, 39, 40, 47, 50, 114, 29, 36,
+ 27, 115, 122, 121, 120, 48, 119, 41, 51, 22,
+ 118, 22, 24, 117, 24, 59, 59, 59, 116, 113,
+ 112, 111, 110, 109, 108, 107, 106, 105, 104, 103,
+ 102, 101, 100, 99, 98, 97, 96, 95, 94, 93,
+ 92, 91, 90, 89, 88, 87, 86, 85, 84, 83,
+ 82, 81, 80, 79, 78, 77, 60, 76, 75, 74,
+
+ 73, 72, 71, 70, 69, 68, 67, 66, 65, 64,
+ 63, 62, 61, 60, 58, 57, 56, 55, 54, 53,
+ 52, 49, 46, 45, 44, 43, 26, 25, 25, 23,
+ 42, 37, 34, 33, 32, 31, 30, 26, 25, 23,
+ 123, 21, 3, 123, 123, 123, 123, 123, 123, 123,
+ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
+ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
+ 123, 123, 123
+ } ;
+
+static ace_cc_yyconst short int ace_cc_yy_chk[174] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 11, 19, 17, 19, 20, 32, 34, 112, 11, 17,
+ 126, 112, 121, 119, 118, 32, 117, 20, 34, 124,
+ 116, 124, 125, 115, 125, 127, 127, 127, 114, 111,
+ 110, 108, 106, 105, 104, 102, 101, 100, 99, 98,
+ 96, 93, 92, 90, 88, 87, 86, 83, 81, 80,
+ 79, 78, 77, 76, 74, 73, 72, 71, 70, 69,
+ 67, 66, 64, 63, 62, 61, 59, 58, 57, 56,
+
+ 55, 54, 53, 52, 51, 50, 49, 48, 47, 46,
+ 45, 44, 43, 42, 41, 40, 39, 38, 37, 36,
+ 35, 33, 31, 30, 29, 28, 26, 25, 24, 23,
+ 21, 18, 16, 15, 14, 13, 12, 8, 7, 6,
+ 3, 2, 123, 123, 123, 123, 123, 123, 123, 123,
+ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
+ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
+ 123, 123, 123
+ } ;
+
+static ace_cc_yy_state_type ace_cc_yy_last_accepting_state;
+static char *ace_cc_yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define ace_cc_yymore() ace_cc_yymore_used_but_not_detected
+#define ACE_CC_YY_MORE_ADJ 0
+#define ACE_CC_YY_RESTORE_ACE_CC_YY_MORE_OFFSET
+char *ace_cc_yytext;
+#define INITIAL 0
+/* $Id$
+ * ============================================================================
+ *
+ * = LIBRARY
+ * TAO/orbsvcs/tests
+ *
+ * = FILENAME
+ * CC_command.l
+ *
+ * = DESCRIPTION
+ * This is the lex file for the concurrency service script language.
+ *
+ * = AUTHORS
+ * Torben Worm <tworm@cs.wustl.edu>
+ *
+ * ============================================================================
+ */
+#define ACE_CC_YY_NO_UNPUT 1
+#define ACE_CC_YY_NO_INPUT 1
+#define ACE_CC_YY_ALWAYS_INTERACTIVE 1
+#include "CC_command.h"
+#include "CC_command.tab.h"
+#include "ace/ACE.h"
+
+extern int line_no;
+extern char line_buf[500];
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef ACE_CC_YY_SKIP_ACE_CC_YYWRAP
+#ifdef __cplusplus
+extern "C" int ace_cc_yywrap ACE_CC_YY_PROTO(( void ));
+#else
+extern int ace_cc_yywrap ACE_CC_YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef ACE_CC_YY_NO_UNPUT
+static void ace_cc_yyunput ACE_CC_YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef ace_cc_yytext_ptr
+static void ace_cc_yy_flex_strncpy ACE_CC_YY_PROTO(( char *, ace_cc_yyconst char *, int ));
+#endif
+
+#ifdef ACE_CC_YY_NEED_STRLEN
+static int ace_cc_yy_flex_strlen ACE_CC_YY_PROTO(( ace_cc_yyconst char * ));
+#endif
+
+#ifndef ACE_CC_YY_NO_INPUT
+#ifdef __cplusplus
+static int ace_cc_yyinput ACE_CC_YY_PROTO(( void ));
+#else
+static int input ACE_CC_YY_PROTO(( void ));
+#endif
+#endif
+
+#if ACE_CC_YY_STACK_USED
+static int ace_cc_yy_start_stack_ptr = 0;
+static int ace_cc_yy_start_stack_depth = 0;
+static int *ace_cc_yy_start_stack = 0;
+#ifndef ACE_CC_YY_NO_PUSH_STATE
+static void ace_cc_yy_push_state ACE_CC_YY_PROTO(( int new_state ));
+#endif
+#ifndef ACE_CC_YY_NO_POP_STATE
+static void ace_cc_yy_pop_state ACE_CC_YY_PROTO(( void ));
+#endif
+#ifndef ACE_CC_YY_NO_TOP_STATE
+static int ace_cc_yy_top_state ACE_CC_YY_PROTO(( void ));
+#endif
+
+#else
+#define ACE_CC_YY_NO_PUSH_STATE 1
+#define ACE_CC_YY_NO_POP_STATE 1
+#define ACE_CC_YY_NO_TOP_STATE 1
+#endif
+
+#ifdef ACE_CC_YY_MALLOC_DECL
+ACE_CC_YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include /**/ <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef ACE_CC_YY_READ_BUF_SIZE
+#define ACE_CC_YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ACE_CC_ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ACE_CC_ECHO (void) fwrite( ace_cc_yytext, ace_cc_yyleng, 1, ace_cc_yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or ACE_CC_YY_NULL,
+ * is returned in "result".
+ */
+#ifndef ACE_CC_YY_INPUT
+#define ACE_CC_YY_INPUT(buf,result,max_size) \
+ if ( ace_cc_yy_current_buffer->ace_cc_yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( ace_cc_yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( ace_cc_yyin ) ) \
+ ACE_CC_YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, ace_cc_yyin )) == 0) \
+ && ferror( ace_cc_yyin ) ) \
+ ACE_CC_YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "ace_cc_yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef ace_cc_yyterminate
+#define ace_cc_yyterminate() return ACE_CC_YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef ACE_CC_YY_START_STACK_INCR
+#define ACE_CC_YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef ACE_CC_YY_FATAL_ERROR
+#define ACE_CC_YY_FATAL_ERROR(msg) ace_cc_yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef ACE_CC_YY_DECL
+#define ACE_CC_YY_DECL int ace_cc_yylex ACE_CC_YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after ace_cc_yytext and ace_cc_yyleng
+ * have been set up.
+ */
+#ifndef ACE_CC_YY_USER_ACTION
+#define ACE_CC_YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef ACE_CC_YY_BREAK
+#define ACE_CC_YY_BREAK break;
+#endif
+
+#define ACE_CC_YY_RULE_SETUP \
+ if ( ace_cc_yyleng > 0 ) \
+ ace_cc_yy_current_buffer->ace_cc_yy_at_bol = \
+ (ace_cc_yytext[ace_cc_yyleng - 1] == '\n'); \
+ ACE_CC_YY_USER_ACTION
+
+ACE_CC_YY_DECL
+ {
+ register ace_cc_yy_state_type ace_cc_yy_current_state;
+ register char *ace_cc_yy_cp = NULL, *ace_cc_yy_bp = NULL;
+ register int ace_cc_yy_act;
+
+
+
+
+ if ( ace_cc_yy_init )
+ {
+ ace_cc_yy_init = 0;
+
+#ifdef ACE_CC_YY_USER_INIT
+ ACE_CC_YY_USER_INIT;
+#endif
+
+ if ( ! ace_cc_yy_start )
+ ace_cc_yy_start = 1; /* first start state */
+
+ if ( ! ace_cc_yyin )
+ ace_cc_yyin = stdin;
+
+ if ( ! ace_cc_yyout )
+ ace_cc_yyout = stdout;
+
+ if ( ! ace_cc_yy_current_buffer )
+ ace_cc_yy_current_buffer =
+ ace_cc_yy_create_buffer( ace_cc_yyin, ACE_CC_YY_BUF_SIZE );
+
+ ace_cc_yy_load_buffer_state();
+ }
+
+ ace_cc_yy_cp = ace_cc_yy_bp = 0; /* To avoid g++ warning about
+ possible uninitialized use. */
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ ace_cc_yy_cp = ace_cc_yy_c_buf_p;
+
+ /* Support of ace_cc_yytext. */
+ *ace_cc_yy_cp = ace_cc_yy_hold_char;
+
+ /* ace_cc_yy_bp points to the position in ace_cc_yy_ch_buf of the start of
+ * the current run.
+ */
+ ace_cc_yy_bp = ace_cc_yy_cp;
+
+ ace_cc_yy_current_state = ace_cc_yy_start;
+ ace_cc_yy_current_state += ACE_CC_YY_AT_BOL();
+ace_cc_yy_match:
+ do
+ {
+ register ACE_CC_YY_CHAR ace_cc_yy_c = ace_cc_yy_ec[ACE_CC_YY_SC_TO_UI(*ace_cc_yy_cp)];
+ if ( ace_cc_yy_accept[ace_cc_yy_current_state] )
+ {
+ ace_cc_yy_last_accepting_state = ace_cc_yy_current_state;
+ ace_cc_yy_last_accepting_cpos = ace_cc_yy_cp;
+ }
+ while ( ace_cc_yy_chk[ace_cc_yy_base[ace_cc_yy_current_state] + ace_cc_yy_c] != ace_cc_yy_current_state )
+ {
+ ace_cc_yy_current_state = (int) ace_cc_yy_def[ace_cc_yy_current_state];
+ if ( ace_cc_yy_current_state >= 124 )
+ ace_cc_yy_c = ace_cc_yy_meta[(unsigned int) ace_cc_yy_c];
+ }
+ ace_cc_yy_current_state = ace_cc_yy_nxt[ace_cc_yy_base[ace_cc_yy_current_state] + (unsigned int) ace_cc_yy_c];
+ ++ace_cc_yy_cp;
+ }
+ while ( ace_cc_yy_base[ace_cc_yy_current_state] != 143 );
+
+ace_cc_yy_find_action:
+ ace_cc_yy_act = ace_cc_yy_accept[ace_cc_yy_current_state];
+ if ( ace_cc_yy_act == 0 )
+ { /* have to back up */
+ ace_cc_yy_cp = ace_cc_yy_last_accepting_cpos;
+ ace_cc_yy_current_state = ace_cc_yy_last_accepting_state;
+ ace_cc_yy_act = ace_cc_yy_accept[ace_cc_yy_current_state];
+ }
+
+ ACE_CC_YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( ace_cc_yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of ACE_CC_YY_DO_BEFORE_ACTION */
+ *ace_cc_yy_cp = ace_cc_yy_hold_char;
+ ace_cc_yy_cp = ace_cc_yy_last_accepting_cpos;
+ ace_cc_yy_current_state = ace_cc_yy_last_accepting_state;
+ goto ace_cc_yy_find_action;
+
+case 1:
+ACE_CC_YY_RULE_SETUP
+return T_TERM;
+ /* ACE_CC_YY_BREAK */
+case 2:
+ACE_CC_YY_RULE_SETUP
+return T_START_CMD;
+ /* ACE_CC_YY_BREAK */
+case 3:
+ACE_CC_YY_RULE_SETUP
+return T_CREATE_CMD;
+ /* ACE_CC_YY_BREAK */
+case 4:
+ACE_CC_YY_RULE_SETUP
+return T_LOCK_CMD;
+ /* ACE_CC_YY_BREAK */
+case 5:
+ACE_CC_YY_RULE_SETUP
+return T_UNLOCK_CMD;
+ /* ACE_CC_YY_BREAK */
+case 6:
+ACE_CC_YY_RULE_SETUP
+return T_TRYLOCK_CMD;
+ /* ACE_CC_YY_BREAK */
+case 7:
+ACE_CC_YY_RULE_SETUP
+return T_CHANGEMODE_CMD;
+ /* ACE_CC_YY_BREAK */
+case 8:
+ACE_CC_YY_RULE_SETUP
+return T_SLEEP_CMD;
+ /* ACE_CC_YY_BREAK */
+case 9:
+ACE_CC_YY_RULE_SETUP
+return T_WAIT_CMD;
+ /* ACE_CC_YY_BREAK */
+case 10:
+ACE_CC_YY_RULE_SETUP
+return T_PRINT_CMD;
+ /* ACE_CC_YY_BREAK */
+case 11:
+ACE_CC_YY_RULE_SETUP
+return T_REPEAT_CMD;
+ /* ACE_CC_YY_BREAK */
+case 12:
+ACE_CC_YY_RULE_SETUP
+return T_EXCEP_CMD;
+ /* ACE_CC_YY_BREAK */
+case 13:
+ACE_CC_YY_RULE_SETUP
+return T_LOOKUP_CMD;
+ /* ACE_CC_YY_BREAK */
+case 14:
+ACE_CC_YY_RULE_SETUP
+return T_READ;
+ /* ACE_CC_YY_BREAK */
+case 15:
+ACE_CC_YY_RULE_SETUP
+return T_IREAD;
+ /* ACE_CC_YY_BREAK */
+case 16:
+ACE_CC_YY_RULE_SETUP
+return T_UPGRADE;
+ /* ACE_CC_YY_BREAK */
+case 17:
+ACE_CC_YY_RULE_SETUP
+return T_WRITE;
+ /* ACE_CC_YY_BREAK */
+case 18:
+ACE_CC_YY_RULE_SETUP
+return T_IWRITE;
+ /* ACE_CC_YY_BREAK */
+case 19:
+ACE_CC_YY_RULE_SETUP
+{ ace_cc_yylval.id = ACE_OS::strdup(&ace_cc_yytext[1]);
+ ace_cc_yylval.id[ace_cc_yyleng-2]='\0';
+ return Q_STRING; }
+ /* ACE_CC_YY_BREAK */
+case 20:
+ACE_CC_YY_RULE_SETUP
+{ ace_cc_yylval.num = atoi(ace_cc_yytext); return T_NUM; }
+ /* ACE_CC_YY_BREAK */
+case 21:
+ACE_CC_YY_RULE_SETUP
+{ ace_cc_yylval.id = ACE_OS::strdup(ace_cc_yytext);
+ return T_IDENT; }
+ /* ACE_CC_YY_BREAK */
+case 22:
+ACE_CC_YY_RULE_SETUP
+{ }
+ ACE_CC_YY_BREAK
+case 23:
+ACE_CC_YY_RULE_SETUP
+{ }
+ ACE_CC_YY_BREAK
+case 24:
+ACE_CC_YY_RULE_SETUP
+{ line_no ++;
+ ACE_OS::strcpy(line_buf, ace_cc_yytext+1);
+ ace_cc_yyless(1); }
+ ACE_CC_YY_BREAK
+case 25:
+ACE_CC_YY_RULE_SETUP
+ACE_CC_ECHO;
+ ACE_CC_YY_BREAK
+case ACE_CC_YY_STATE_EOF(INITIAL):
+ ace_cc_yyterminate();
+
+ case ACE_CC_YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int ace_cc_yy_amount_of_matched_text = (int) (ace_cc_yy_cp - ace_cc_yytext_ptr) - 1;
+
+ /* Undo the effects of ACE_CC_YY_DO_BEFORE_ACTION. */
+ *ace_cc_yy_cp = ace_cc_yy_hold_char;
+ ACE_CC_YY_RESTORE_ACE_CC_YY_MORE_OFFSET
+
+ if ( ace_cc_yy_current_buffer->ace_cc_yy_buffer_status == ACE_CC_YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed ace_cc_yyin at a new source and called
+ * ace_cc_yylex(). If so, then we have to assure
+ * consistency between ace_cc_yy_current_buffer and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ ace_cc_yy_n_chars = ace_cc_yy_current_buffer->ace_cc_yy_n_chars;
+ ace_cc_yy_current_buffer->ace_cc_yy_input_file = ace_cc_yyin;
+ ace_cc_yy_current_buffer->ace_cc_yy_buffer_status = ACE_CC_YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for ace_cc_yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since ace_cc_yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( ace_cc_yy_c_buf_p <= &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars] )
+ { /* This was really a NUL. */
+ ace_cc_yy_state_type ace_cc_yy_next_state;
+
+ ace_cc_yy_c_buf_p = ace_cc_yytext_ptr + ace_cc_yy_amount_of_matched_text;
+
+ ace_cc_yy_current_state = ace_cc_yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * ace_cc_yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ ace_cc_yy_next_state = ace_cc_yy_try_NUL_trans( ace_cc_yy_current_state );
+
+ ace_cc_yy_bp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;
+
+ if ( ace_cc_yy_next_state )
+ {
+ /* Consume the NUL. */
+ ace_cc_yy_cp = ++ace_cc_yy_c_buf_p;
+ ace_cc_yy_current_state = ace_cc_yy_next_state;
+ goto ace_cc_yy_match;
+ }
+
+ else
+ {
+ ace_cc_yy_cp = ace_cc_yy_c_buf_p;
+ goto ace_cc_yy_find_action;
+ }
+ }
+
+ else switch ( ace_cc_yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+#if (ace_cc_yywrap() != 1)
+ ace_cc_yy_did_buffer_switch_on_eof = 0;
+#endif
+
+ if ( ace_cc_yywrap() )
+ {
+ /* Note: because we've taken care in
+ * ace_cc_yy_get_next_buffer() to have set up
+ * ace_cc_yytext, we can now set up
+ * ace_cc_yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * ACE_CC_YY_NULL, it'll still work - another
+ * ACE_CC_YY_NULL will get returned.
+ */
+ ace_cc_yy_c_buf_p = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;
+
+ ace_cc_yy_act = ACE_CC_YY_STATE_EOF(ACE_CC_YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+#if (ace_cc_yywrap() != 1)
+ if ( ! ace_cc_yy_did_buffer_switch_on_eof )
+ ACE_CC_YY_NEW_FILE;
+#endif
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ ace_cc_yy_c_buf_p =
+ ace_cc_yytext_ptr + ace_cc_yy_amount_of_matched_text;
+
+ ace_cc_yy_current_state = ace_cc_yy_get_previous_state();
+
+ ace_cc_yy_cp = ace_cc_yy_c_buf_p;
+ ace_cc_yy_bp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;
+ goto ace_cc_yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ ace_cc_yy_c_buf_p =
+ &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars];
+
+ ace_cc_yy_current_state = ace_cc_yy_get_previous_state();
+
+ ace_cc_yy_cp = ace_cc_yy_c_buf_p;
+ ace_cc_yy_bp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;
+ goto ace_cc_yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ ACE_CC_YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of ace_cc_yylex */
+
+
+/* ace_cc_yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int ace_cc_yy_get_next_buffer()
+ {
+ register char *dest = ace_cc_yy_current_buffer->ace_cc_yy_ch_buf;
+ register char *source = ace_cc_yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( ace_cc_yy_c_buf_p > &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars + 1] )
+ ACE_CC_YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( ace_cc_yy_current_buffer->ace_cc_yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( ace_cc_yy_c_buf_p - ace_cc_yytext_ptr - ACE_CC_YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (ace_cc_yy_c_buf_p - ace_cc_yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( ace_cc_yy_current_buffer->ace_cc_yy_buffer_status == ACE_CC_YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ ace_cc_yy_current_buffer->ace_cc_yy_n_chars = ace_cc_yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ ace_cc_yy_current_buffer->ace_cc_yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef ACE_CC_YY_USES_REJECT
+ ACE_CC_YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ ACE_CC_YY_BUFFER_STATE b = ace_cc_yy_current_buffer;
+
+ int ace_cc_yy_c_buf_p_offset =
+ (int) (ace_cc_yy_c_buf_p - b->ace_cc_yy_ch_buf);
+
+ if ( b->ace_cc_yy_is_our_buffer )
+ {
+ int new_size = b->ace_cc_yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->ace_cc_yy_buf_size += b->ace_cc_yy_buf_size / 8;
+ else
+ b->ace_cc_yy_buf_size *= 2;
+
+ b->ace_cc_yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ ace_cc_yy_flex_realloc( (void *) b->ace_cc_yy_ch_buf,
+ b->ace_cc_yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->ace_cc_yy_ch_buf = 0;
+
+ if ( ! b->ace_cc_yy_ch_buf )
+ ACE_CC_YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ ace_cc_yy_c_buf_p = &b->ace_cc_yy_ch_buf[ace_cc_yy_c_buf_p_offset];
+
+ num_to_read = ace_cc_yy_current_buffer->ace_cc_yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > ACE_CC_YY_READ_BUF_SIZE )
+ num_to_read = ACE_CC_YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ ACE_CC_YY_INPUT( (&ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[number_to_move]),
+ ace_cc_yy_n_chars, num_to_read );
+
+ ace_cc_yy_current_buffer->ace_cc_yy_n_chars = ace_cc_yy_n_chars;
+ }
+
+ if ( ace_cc_yy_n_chars == 0 )
+ {
+ if ( number_to_move == ACE_CC_YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ ace_cc_yyrestart( ace_cc_yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ ace_cc_yy_current_buffer->ace_cc_yy_buffer_status =
+ ACE_CC_YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ ace_cc_yy_n_chars += number_to_move;
+ ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars] = ACE_CC_YY_END_OF_BUFFER_CHAR;
+ ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars + 1] = ACE_CC_YY_END_OF_BUFFER_CHAR;
+
+ ace_cc_yytext_ptr = &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+/* ace_cc_yy_get_previous_state - get the state just before the EOB char was reached */
+
+static ace_cc_yy_state_type ace_cc_yy_get_previous_state()
+ {
+ register ace_cc_yy_state_type ace_cc_yy_current_state;
+ register char *ace_cc_yy_cp;
+
+ ace_cc_yy_current_state = ace_cc_yy_start;
+ ace_cc_yy_current_state += ACE_CC_YY_AT_BOL();
+
+ for ( ace_cc_yy_cp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ; ace_cc_yy_cp < ace_cc_yy_c_buf_p; ++ace_cc_yy_cp )
+ {
+ register ACE_CC_YY_CHAR ace_cc_yy_c = (*ace_cc_yy_cp ? ace_cc_yy_ec[ACE_CC_YY_SC_TO_UI(*ace_cc_yy_cp)] : 1);
+ if ( ace_cc_yy_accept[ace_cc_yy_current_state] )
+ {
+ ace_cc_yy_last_accepting_state = ace_cc_yy_current_state;
+ ace_cc_yy_last_accepting_cpos = ace_cc_yy_cp;
+ }
+ while ( ace_cc_yy_chk[ace_cc_yy_base[ace_cc_yy_current_state] + ace_cc_yy_c] != ace_cc_yy_current_state )
+ {
+ ace_cc_yy_current_state = (int) ace_cc_yy_def[ace_cc_yy_current_state];
+ if ( ace_cc_yy_current_state >= 124 )
+ ace_cc_yy_c = ace_cc_yy_meta[(unsigned int) ace_cc_yy_c];
+ }
+ ace_cc_yy_current_state = ace_cc_yy_nxt[ace_cc_yy_base[ace_cc_yy_current_state] + (unsigned int) ace_cc_yy_c];
+ }
+
+ return ace_cc_yy_current_state;
+ }
+
+
+/* ace_cc_yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = ace_cc_yy_try_NUL_trans( current_state );
+ */
+
+#ifdef ACE_CC_YY_USE_PROTOS
+static ace_cc_yy_state_type ace_cc_yy_try_NUL_trans( ace_cc_yy_state_type ace_cc_yy_current_state )
+#else
+static ace_cc_yy_state_type ace_cc_yy_try_NUL_trans( ace_cc_yy_current_state )
+ace_cc_yy_state_type ace_cc_yy_current_state;
+#endif
+ {
+ register int ace_cc_yy_is_jam;
+ register char *ace_cc_yy_cp = ace_cc_yy_c_buf_p;
+
+ register ACE_CC_YY_CHAR ace_cc_yy_c = 1;
+ if ( ace_cc_yy_accept[ace_cc_yy_current_state] )
+ {
+ ace_cc_yy_last_accepting_state = ace_cc_yy_current_state;
+ ace_cc_yy_last_accepting_cpos = ace_cc_yy_cp;
+ }
+ while ( ace_cc_yy_chk[ace_cc_yy_base[ace_cc_yy_current_state] + ace_cc_yy_c] != ace_cc_yy_current_state )
+ {
+ ace_cc_yy_current_state = (int) ace_cc_yy_def[ace_cc_yy_current_state];
+ if ( ace_cc_yy_current_state >= 124 )
+ ace_cc_yy_c = ace_cc_yy_meta[(unsigned int) ace_cc_yy_c];
+ }
+ ace_cc_yy_current_state = ace_cc_yy_nxt[ace_cc_yy_base[ace_cc_yy_current_state] + (unsigned int) ace_cc_yy_c];
+ ace_cc_yy_is_jam = (ace_cc_yy_current_state == 123);
+
+ return ace_cc_yy_is_jam ? 0 : ace_cc_yy_current_state;
+ }
+
+
+#ifndef ACE_CC_YY_NO_UNPUT
+#ifdef ACE_CC_YY_USE_PROTOS
+static void ace_cc_yyunput( int c, register char *ace_cc_yy_bp )
+#else
+static void ace_cc_yyunput( c, ace_cc_yy_bp )
+int c;
+register char *ace_cc_yy_bp;
+#endif
+ {
+ register char *ace_cc_yy_cp = ace_cc_yy_c_buf_p;
+
+ /* undo effects of setting up ace_cc_yytext */
+ *ace_cc_yy_cp = ace_cc_yy_hold_char;
+
+ if ( ace_cc_yy_cp < ace_cc_yy_current_buffer->ace_cc_yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = ace_cc_yy_n_chars + 2;
+ register char *dest = &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[
+ ace_cc_yy_current_buffer->ace_cc_yy_buf_size + 2];
+ register char *source =
+ &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[number_to_move];
+
+ while ( source > ace_cc_yy_current_buffer->ace_cc_yy_ch_buf )
+ *--dest = *--source;
+
+ ace_cc_yy_cp += (int) (dest - source);
+ ace_cc_yy_bp += (int) (dest - source);
+ ace_cc_yy_current_buffer->ace_cc_yy_n_chars =
+ ace_cc_yy_n_chars = ace_cc_yy_current_buffer->ace_cc_yy_buf_size;
+
+ if ( ace_cc_yy_cp < ace_cc_yy_current_buffer->ace_cc_yy_ch_buf + 2 )
+ ACE_CC_YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--ace_cc_yy_cp = (char) c;
+
+
+ ace_cc_yytext_ptr = ace_cc_yy_bp;
+ ace_cc_yy_hold_char = *ace_cc_yy_cp;
+ ace_cc_yy_c_buf_p = ace_cc_yy_cp;
+ }
+#endif /* ifndef ACE_CC_YY_NO_UNPUT */
+
+#ifndef ACE_CC_YY_NO_INPUT
+#ifdef __cplusplus
+static int ace_cc_yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *ace_cc_yy_c_buf_p = ace_cc_yy_hold_char;
+
+ if ( *ace_cc_yy_c_buf_p == ACE_CC_YY_END_OF_BUFFER_CHAR )
+ {
+ /* ace_cc_yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( ace_cc_yy_c_buf_p < &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars] )
+ /* This was really a NUL. */
+ *ace_cc_yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = ace_cc_yy_c_buf_p - ace_cc_yytext_ptr;
+ ++ace_cc_yy_c_buf_p;
+
+ switch ( ace_cc_yy_get_next_buffer() )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because ace_cc_yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ ace_cc_yyrestart( ace_cc_yyin );
+
+ /* fall through */
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( ace_cc_yywrap() )
+ return EOF;
+
+ /* if ( ! ace_cc_yy_did_buffer_switch_on_eof )
+ ACE_CC_YY_NEW_FILE;
+#ifdef __cplusplus
+ return ace_cc_yyinput();
+#else
+ return input();
+ #endif */
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ ace_cc_yy_c_buf_p = ace_cc_yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) ace_cc_yy_c_buf_p; /* cast for 8-bit char's */
+ *ace_cc_yy_c_buf_p = '\0'; /* preserve ace_cc_yytext */
+ ace_cc_yy_hold_char = *++ace_cc_yy_c_buf_p;
+
+ ace_cc_yy_current_buffer->ace_cc_yy_at_bol = (c == '\n');
+
+ return c;
+ }
+#endif /* ! ACE_CC_YY_NO_INPUT */
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+void ace_cc_yyrestart( FILE *input_file )
+#else
+void ace_cc_yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! ace_cc_yy_current_buffer )
+ ace_cc_yy_current_buffer = ace_cc_yy_create_buffer( ace_cc_yyin, ACE_CC_YY_BUF_SIZE );
+
+ ace_cc_yy_init_buffer( ace_cc_yy_current_buffer, input_file );
+ ace_cc_yy_load_buffer_state();
+ }
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+void ace_cc_yy_switch_to_buffer( ACE_CC_YY_BUFFER_STATE new_buffer )
+#else
+void ace_cc_yy_switch_to_buffer( new_buffer )
+ACE_CC_YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( ace_cc_yy_current_buffer == new_buffer )
+ return;
+
+ if ( ace_cc_yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *ace_cc_yy_c_buf_p = ace_cc_yy_hold_char;
+ ace_cc_yy_current_buffer->ace_cc_yy_buf_pos = ace_cc_yy_c_buf_p;
+ ace_cc_yy_current_buffer->ace_cc_yy_n_chars = ace_cc_yy_n_chars;
+ }
+
+ ace_cc_yy_current_buffer = new_buffer;
+ ace_cc_yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (ace_cc_yywrap()) processing, but the only time this flag
+ * is looked at is after ace_cc_yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+#if (ace_cc_yywrap() != 1)
+ ace_cc_yy_did_buffer_switch_on_eof = 1;
+#endif
+ }
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+void ace_cc_yy_load_buffer_state( void )
+#else
+void ace_cc_yy_load_buffer_state()
+#endif
+ {
+ ace_cc_yy_n_chars = ace_cc_yy_current_buffer->ace_cc_yy_n_chars;
+ ace_cc_yytext_ptr = ace_cc_yy_c_buf_p = ace_cc_yy_current_buffer->ace_cc_yy_buf_pos;
+ ace_cc_yyin = ace_cc_yy_current_buffer->ace_cc_yy_input_file;
+ ace_cc_yy_hold_char = *ace_cc_yy_c_buf_p;
+ }
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_create_buffer( FILE *file, int size )
+#else
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ ACE_CC_YY_BUFFER_STATE b;
+
+ b = (ACE_CC_YY_BUFFER_STATE) ace_cc_yy_flex_alloc( sizeof( struct ace_cc_yy_buffer_state ) );
+ if ( ! b )
+ ACE_CC_YY_FATAL_ERROR( "out of dynamic memory in ace_cc_yy_create_buffer()" );
+
+ b->ace_cc_yy_buf_size = size;
+
+ /* ace_cc_yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->ace_cc_yy_ch_buf = (char *) ace_cc_yy_flex_alloc( b->ace_cc_yy_buf_size + 2 );
+ if ( ! b->ace_cc_yy_ch_buf )
+ ACE_CC_YY_FATAL_ERROR( "out of dynamic memory in ace_cc_yy_create_buffer()" );
+
+ b->ace_cc_yy_is_our_buffer = 1;
+
+ ace_cc_yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+void ace_cc_yy_delete_buffer( ACE_CC_YY_BUFFER_STATE b )
+#else
+void ace_cc_yy_delete_buffer( b )
+ACE_CC_YY_BUFFER_STATE b;
+#endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == ace_cc_yy_current_buffer )
+ ace_cc_yy_current_buffer = (ACE_CC_YY_BUFFER_STATE) 0;
+
+ if ( b->ace_cc_yy_is_our_buffer )
+ ace_cc_yy_flex_free( (void *) b->ace_cc_yy_ch_buf );
+
+ ace_cc_yy_flex_free( (void *) b );
+ }
+
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+void ace_cc_yy_init_buffer( ACE_CC_YY_BUFFER_STATE b, FILE *file )
+#else
+void ace_cc_yy_init_buffer( b, file )
+ACE_CC_YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+ {
+ ace_cc_yy_flush_buffer( b );
+
+ b->ace_cc_yy_input_file = file;
+ b->ace_cc_yy_fill_buffer = 1;
+
+#if ACE_CC_YY_ALWAYS_INTERACTIVE
+ b->ace_cc_yy_is_interactive = 1;
+#else
+#if ACE_CC_YY_NEVER_INTERACTIVE
+ b->ace_cc_yy_is_interactive = 0;
+#else
+ b->ace_cc_yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+ }
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+void ace_cc_yy_flush_buffer( ACE_CC_YY_BUFFER_STATE b )
+#else
+void ace_cc_yy_flush_buffer( b )
+ACE_CC_YY_BUFFER_STATE b;
+#endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->ace_cc_yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->ace_cc_yy_ch_buf[0] = ACE_CC_YY_END_OF_BUFFER_CHAR;
+ b->ace_cc_yy_ch_buf[1] = ACE_CC_YY_END_OF_BUFFER_CHAR;
+
+ b->ace_cc_yy_buf_pos = &b->ace_cc_yy_ch_buf[0];
+
+ b->ace_cc_yy_at_bol = 1;
+ b->ace_cc_yy_buffer_status = ACE_CC_YY_BUFFER_NEW;
+
+ if ( b == ace_cc_yy_current_buffer )
+ ace_cc_yy_load_buffer_state();
+ }
+
+
+#ifndef ACE_CC_YY_NO_SCAN_BUFFER
+#ifdef ACE_CC_YY_USE_PROTOS
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_buffer( char *base, ace_cc_yy_size_t size )
+#else
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_buffer( base, size )
+char *base;
+ace_cc_yy_size_t size;
+#endif
+ {
+ ACE_CC_YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != ACE_CC_YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != ACE_CC_YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (ACE_CC_YY_BUFFER_STATE) ace_cc_yy_flex_alloc( sizeof( struct ace_cc_yy_buffer_state ) );
+ if ( ! b )
+ ACE_CC_YY_FATAL_ERROR( "out of dynamic memory in ace_cc_yy_scan_buffer()" );
+
+ b->ace_cc_yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->ace_cc_yy_buf_pos = b->ace_cc_yy_ch_buf = base;
+ b->ace_cc_yy_is_our_buffer = 0;
+ b->ace_cc_yy_input_file = 0;
+ b->ace_cc_yy_n_chars = b->ace_cc_yy_buf_size;
+ b->ace_cc_yy_is_interactive = 0;
+ b->ace_cc_yy_at_bol = 1;
+ b->ace_cc_yy_fill_buffer = 0;
+ b->ace_cc_yy_buffer_status = ACE_CC_YY_BUFFER_NEW;
+
+ ace_cc_yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef ACE_CC_YY_NO_SCAN_STRING
+#ifdef ACE_CC_YY_USE_PROTOS
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_string( ace_cc_yyconst char *ace_cc_yy_str )
+#else
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_string( ace_cc_yy_str )
+ace_cc_yyconst char *ace_cc_yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; ace_cc_yy_str[len]; ++len )
+ ;
+
+ return ace_cc_yy_scan_bytes( ace_cc_yy_str, len );
+ }
+#endif
+
+
+#ifndef ACE_CC_YY_NO_SCAN_BYTES
+#ifdef ACE_CC_YY_USE_PROTOS
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_bytes( ace_cc_yyconst char *bytes, int len )
+#else
+ACE_CC_YY_BUFFER_STATE ace_cc_yy_scan_bytes( bytes, len )
+ace_cc_yyconst char *bytes;
+int len;
+#endif
+ {
+ ACE_CC_YY_BUFFER_STATE b;
+ char *buf;
+ ace_cc_yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) ace_cc_yy_flex_alloc( n );
+ if ( ! buf )
+ ACE_CC_YY_FATAL_ERROR( "out of dynamic memory in ace_cc_yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = ACE_CC_YY_END_OF_BUFFER_CHAR;
+
+ b = ace_cc_yy_scan_buffer( buf, n );
+ if ( ! b )
+ ACE_CC_YY_FATAL_ERROR( "bad buffer in ace_cc_yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->ace_cc_yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef ACE_CC_YY_NO_PUSH_STATE
+#ifdef ACE_CC_YY_USE_PROTOS
+static void ace_cc_yy_push_state( int new_state )
+#else
+static void ace_cc_yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( ace_cc_yy_start_stack_ptr >= ace_cc_yy_start_stack_depth )
+ {
+ ace_cc_yy_size_t new_size;
+
+ ace_cc_yy_start_stack_depth += ACE_CC_YY_START_STACK_INCR;
+ new_size = ace_cc_yy_start_stack_depth * sizeof( int );
+
+ if ( ! ace_cc_yy_start_stack )
+ ace_cc_yy_start_stack = (int *) ace_cc_yy_flex_alloc( new_size );
+
+ else
+ ace_cc_yy_start_stack = (int *) ace_cc_yy_flex_realloc(
+ (void *) ace_cc_yy_start_stack, new_size );
+
+ if ( ! ace_cc_yy_start_stack )
+ ACE_CC_YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ ace_cc_yy_start_stack[ace_cc_yy_start_stack_ptr++] = ACE_CC_YY_START;
+
+ BEGIN(new_state);
+ }
+#endif
+
+
+#ifndef ACE_CC_YY_NO_POP_STATE
+static void ace_cc_yy_pop_state()
+ {
+ if ( --ace_cc_yy_start_stack_ptr < 0 )
+ ACE_CC_YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(ace_cc_yy_start_stack[ace_cc_yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef ACE_CC_YY_NO_TOP_STATE
+static int ace_cc_yy_top_state()
+ {
+ return ace_cc_yy_start_stack[ace_cc_yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef ACE_CC_YY_EXIT_FAILURE
+#define ACE_CC_YY_EXIT_FAILURE 2
+#endif
+
+#ifdef ACE_CC_YY_USE_PROTOS
+static void ace_cc_yy_fatal_error( ace_cc_yyconst char msg[] )
+#else
+static void ace_cc_yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( ACE_CC_YY_EXIT_FAILURE );
+ }
+
+
+
+/* Redefine ace_cc_yyless() so it works in section 3 code. */
+
+#undef ace_cc_yyless
+#define ace_cc_yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up ace_cc_yytext. */ \
+ ace_cc_yytext[ace_cc_yyleng] = ace_cc_yy_hold_char; \
+ ace_cc_yy_c_buf_p = ace_cc_yytext + n; \
+ ace_cc_yy_hold_char = *ace_cc_yy_c_buf_p; \
+ *ace_cc_yy_c_buf_p = '\0'; \
+ ace_cc_yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef ace_cc_yytext_ptr
+#ifdef ACE_CC_YY_USE_PROTOS
+static void ace_cc_yy_flex_strncpy( char *s1, ace_cc_yyconst char *s2, int n )
+#else
+static void ace_cc_yy_flex_strncpy( s1, s2, n )
+char *s1;
+ace_cc_yyconst char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+#ifdef ACE_CC_YY_NEED_STRLEN
+#ifdef ACE_CC_YY_USE_PROTOS
+static int ace_cc_yy_flex_strlen( ace_cc_yyconst char *s )
+#else
+static int ace_cc_yy_flex_strlen( s )
+ace_cc_yyconst char *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
+
+#ifdef ACE_CC_YY_USE_PROTOS
+static void *ace_cc_yy_flex_alloc( ace_cc_yy_size_t size )
+#else
+static void *ace_cc_yy_flex_alloc( size )
+ace_cc_yy_size_t size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef ACE_CC_YY_USE_PROTOS
+static void *ace_cc_yy_flex_realloc( void *ptr, ace_cc_yy_size_t size )
+#else
+static void *ace_cc_yy_flex_realloc( ptr, size )
+void *ptr;
+ace_cc_yy_size_t size;
+#endif
+ {
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+ }
+
+#ifdef ACE_CC_YY_USE_PROTOS
+static void ace_cc_yy_flex_free( void *ptr )
+#else
+static void ace_cc_yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ACE_MALLOC_T (ptr) );
+ }
+
+#if ACE_CC_YY_MAIN
+int main()
+ {
+ ace_cc_yylex();
+ return 0;
+ }
+#endif
diff --git a/TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp.diff b/TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp.diff
new file mode 100644
index 00000000000..9beb6741b18
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/lex.CC_command.cpp.diff
@@ -0,0 +1,209 @@
+--- lex.CC_command.cpp.orig Mon Nov 12 19:05:12 2001
++++ lex.CC_command.cpp Mon Nov 12 19:14:49 2001
+@@ -220,10 +220,13 @@
+ static int ace_cc_yy_init = 1; /* whether we need to initialize */
+ static int ace_cc_yy_start = 0; /* start state number */
+
++#define ace_cc_yywrap() 1
+ /* Flag which is used to allow ace_cc_yywrap()'s to do buffer switches
+ * instead of setting up a fresh ace_cc_yyin. A bit of a hack ...
+ */
++#if (ace_cc_yywrap() != 1)
+ static int ace_cc_yy_did_buffer_switch_on_eof;
++#endif
+
+ void ace_cc_yyrestart ACE_CC_YY_PROTO(( FILE *input_file ));
+
+@@ -262,7 +265,6 @@
+ #define ACE_CC_YY_AT_BOL() (ace_cc_yy_current_buffer->ace_cc_yy_at_bol)
+
+
+-#define ace_cc_yywrap() 1
+ #define ACE_CC_YY_SKIP_ACE_CC_YYWRAP
+ typedef unsigned char ACE_CC_YY_CHAR;
+ FILE *ace_cc_yyin = (FILE *) 0, *ace_cc_yyout = (FILE *) 0;
+@@ -644,6 +646,8 @@
+ ace_cc_yy_load_buffer_state();
+ }
+
++ ace_cc_yy_cp = ace_cc_yy_bp = 0; /* To avoid g++ warning about
++ possible uninitialized use. */
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ ace_cc_yy_cp = ace_cc_yy_c_buf_p;
+@@ -705,90 +709,90 @@
+ case 1:
+ ACE_CC_YY_RULE_SETUP
+ return T_TERM;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 2:
+ ACE_CC_YY_RULE_SETUP
+ return T_START_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 3:
+ ACE_CC_YY_RULE_SETUP
+ return T_CREATE_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 4:
+ ACE_CC_YY_RULE_SETUP
+ return T_LOCK_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 5:
+ ACE_CC_YY_RULE_SETUP
+ return T_UNLOCK_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 6:
+ ACE_CC_YY_RULE_SETUP
+ return T_TRYLOCK_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 7:
+ ACE_CC_YY_RULE_SETUP
+ return T_CHANGEMODE_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 8:
+ ACE_CC_YY_RULE_SETUP
+ return T_SLEEP_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 9:
+ ACE_CC_YY_RULE_SETUP
+ return T_WAIT_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 10:
+ ACE_CC_YY_RULE_SETUP
+ return T_PRINT_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 11:
+ ACE_CC_YY_RULE_SETUP
+ return T_REPEAT_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 12:
+ ACE_CC_YY_RULE_SETUP
+ return T_EXCEP_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 13:
+ ACE_CC_YY_RULE_SETUP
+ return T_LOOKUP_CMD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 14:
+ ACE_CC_YY_RULE_SETUP
+ return T_READ;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 15:
+ ACE_CC_YY_RULE_SETUP
+ return T_IREAD;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 16:
+ ACE_CC_YY_RULE_SETUP
+ return T_UPGRADE;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 17:
+ ACE_CC_YY_RULE_SETUP
+ return T_WRITE;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 18:
+ ACE_CC_YY_RULE_SETUP
+ return T_IWRITE;
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 19:
+ ACE_CC_YY_RULE_SETUP
+ { ace_cc_yylval.id = ACE_OS::strdup(&ace_cc_yytext[1]);
+ ace_cc_yylval.id[ace_cc_yyleng-2]='\0';
+ return Q_STRING; }
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 20:
+ ACE_CC_YY_RULE_SETUP
+ { ace_cc_yylval.num = atoi(ace_cc_yytext); return T_NUM; }
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 21:
+ ACE_CC_YY_RULE_SETUP
+ { ace_cc_yylval.id = ACE_OS::strdup(ace_cc_yytext);
+ return T_IDENT; }
+- ACE_CC_YY_BREAK
++ /* ACE_CC_YY_BREAK */
+ case 22:
+ ACE_CC_YY_RULE_SETUP
+ { }
+@@ -882,7 +886,9 @@
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
++#if (ace_cc_yywrap() != 1)
+ ace_cc_yy_did_buffer_switch_on_eof = 0;
++#endif
+
+ if ( ace_cc_yywrap() )
+ {
+@@ -903,8 +909,10 @@
+
+ else
+ {
++#if (ace_cc_yywrap() != 1)
+ if ( ! ace_cc_yy_did_buffer_switch_on_eof )
+ ACE_CC_YY_NEW_FILE;
++#endif
+ }
+ break;
+ }
+@@ -1188,7 +1196,7 @@
+ }
+ #endif /* ifndef ACE_CC_YY_NO_UNPUT */
+
+-
++#ifndef ACE_CC_YY_NO_INPUT
+ #ifdef __cplusplus
+ static int ace_cc_yyinput()
+ #else
+@@ -1237,13 +1245,13 @@
+ if ( ace_cc_yywrap() )
+ return EOF;
+
+- if ( ! ace_cc_yy_did_buffer_switch_on_eof )
++ /* if ( ! ace_cc_yy_did_buffer_switch_on_eof )
+ ACE_CC_YY_NEW_FILE;
+ #ifdef __cplusplus
+ return ace_cc_yyinput();
+ #else
+ return input();
+-#endif
++ #endif */
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+@@ -1261,6 +1269,7 @@
+
+ return c;
+ }
++#endif /* ! ACE_CC_YY_NO_INPUT */
+
+
+ #ifdef ACE_CC_YY_USE_PROTOS
+@@ -1304,7 +1313,9 @@
+ * is looked at is after ace_cc_yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
++#if (ace_cc_yywrap() != 1)
+ ace_cc_yy_did_buffer_switch_on_eof = 1;
++#endif
+ }
+
+
diff --git a/TAO/orbsvcs/tests/Concurrency/test.basic b/TAO/orbsvcs/tests/Concurrency/test.basic
new file mode 100644
index 00000000000..3673cebe927
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.basic
@@ -0,0 +1,21 @@
+create test;
+lock test read;
+try_lock test read;
+unlock test read;
+unlock test read;
+lock test write;
+try_lock test write;
+unlock test write;
+lock test upgrade;
+try_lock test upgrade;
+unlock test upgrade;
+lock test intention_read;
+try_lock test intention_read;
+unlock test intention_read;
+unlock test intention_read;
+lock test intention_write;
+try_lock test intention_write;
+unlock test intention_write;
+create ls2;
+unlock ls2 write;
+exception IDL:omg.org/CosConcurrencyControl/LockNotHeld:1.0;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.dinphil b/TAO/orbsvcs/tests/Concurrency/test.dinphil
new file mode 100644
index 00000000000..81b02f90ee7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.dinphil
@@ -0,0 +1,12 @@
+print "Creating lock sets";
+create fork1;
+create fork2;
+create fork3;
+create fork4;
+create fork5;
+print "Running the tests";
+start test.phil1;
+start test.phil2;
+start test.phil3;
+start test.phil4;
+start test.phil5;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.e1 b/TAO/orbsvcs/tests/Concurrency/test.e1
new file mode 100644
index 00000000000..1c1e4517680
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.e1
@@ -0,0 +1,2 @@
+wait "Press return";
+unlock ls1 write;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.extended b/TAO/orbsvcs/tests/Concurrency/test.extended
new file mode 100644
index 00000000000..330f03e39c5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.extended
@@ -0,0 +1,4 @@
+create ls1;
+lock ls1 write;
+wait "Run test.e1 - then press return";
+lock ls1 write;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.phil1 b/TAO/orbsvcs/tests/Concurrency/test.phil1
new file mode 100644
index 00000000000..19d25e04ef9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.phil1
@@ -0,0 +1,6 @@
+repeat 100;
+lock fork2 write;
+lock fork1 write;
+print "Phil 1 eating";
+unlock fork2 write;
+unlock fork1 write;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.phil2 b/TAO/orbsvcs/tests/Concurrency/test.phil2
new file mode 100644
index 00000000000..7f02934cf4d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.phil2
@@ -0,0 +1,6 @@
+repeat 100;
+lock fork2 write;
+lock fork3 write;
+print "Phil 2 eating";
+unlock fork2 write;
+unlock fork3 write;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.phil3 b/TAO/orbsvcs/tests/Concurrency/test.phil3
new file mode 100644
index 00000000000..4d808e88ac7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.phil3
@@ -0,0 +1,6 @@
+repeat 100;
+lock fork3 write;
+lock fork4 write;
+print "Phil 3 eating";
+unlock fork3 write;
+unlock fork4 write;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.phil4 b/TAO/orbsvcs/tests/Concurrency/test.phil4
new file mode 100644
index 00000000000..36910b9a9aa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.phil4
@@ -0,0 +1,6 @@
+repeat 100;
+lock fork4 write;
+lock fork5 write;
+print "Phil 4 eating";
+unlock fork4 write;
+unlock fork5 write;
diff --git a/TAO/orbsvcs/tests/Concurrency/test.phil5 b/TAO/orbsvcs/tests/Concurrency/test.phil5
new file mode 100644
index 00000000000..b5f5058eac6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Concurrency/test.phil5
@@ -0,0 +1,6 @@
+repeat 100;
+lock fork5 write;
+lock fork1 write;
+print "Phil 5 eating";
+unlock fork5 write;
+unlock fork1 write;
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/CosEvent_Basic.mpc b/TAO/orbsvcs/tests/CosEvent/Basic/CosEvent_Basic.mpc
new file mode 100644
index 00000000000..85a9ef71ef9
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/CosEvent_Basic.mpc
@@ -0,0 +1,45 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Disconnect): basiceventtestexe {
+ exename = Disconnect
+ Source_Files {
+ Disconnect.cpp
+ }
+}
+
+project(*MT_Disconnect): basiceventtestexe {
+ exename = MT_Disconnect
+ Source_Files {
+ MT_Disconnect.cpp
+ }
+}
+
+project(*Push_Event): basiceventtestexe {
+ exename = Push_Event
+ Source_Files {
+ Push_Event.cpp
+ }
+}
+
+project(*Pull_Push_Event): basiceventtestexe {
+ exename = Pull_Push_Event
+ Source_Files {
+ Pull_Push_Event.cpp
+ }
+}
+
+project(*Shutdown): basiceventtestexe {
+ exename = Shutdown
+ Source_Files {
+ Shutdown.cpp
+ }
+}
+
+project(*Random): basiceventtestexe {
+ exename = Random
+ Source_Files {
+ Random.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/Disconnect.cpp b/TAO/orbsvcs/tests/CosEvent/Basic/Disconnect.cpp
new file mode 100644
index 00000000000..5e8ce733528
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/Disconnect.cpp
@@ -0,0 +1,204 @@
+// $Id$
+
+#include "Counting_Supplier.h"
+#include "Counting_Consumer.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+
+ACE_RCSID (CEC_Tests,
+ Disconnect,
+ "$Id$")
+
+static void run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL);
+
+int
+main (int argc, char* argv[])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ run_test (poa.in (), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ run_test (poa.in (), 1 ACE_ENV_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;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+void
+deactivate_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL)
+{
+ TAO_CEC_EventChannel_Attributes attributes (poa, poa);
+ attributes.disconnect_callbacks = use_callbacks;
+
+ TAO_CEC_EventChannel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // and the supplier admin..
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ int iterations = 100;
+
+ CEC_Counting_Supplier supplier_0;
+ CEC_Counting_Supplier supplier_1;
+ CEC_Counting_Consumer consumer_0 ("Consumer/0");
+ CEC_Counting_Consumer consumer_1 ("Consumer/1");
+
+ for (int i = 0; i != iterations; ++i)
+ {
+ supplier_0.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ supplier_1.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_1.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ supplier_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ consumer_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ supplier_0.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&supplier_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&consumer_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&ec_impl ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong count_0 = 1;
+ CORBA::ULong count_1 = 0;
+ if (use_callbacks)
+ {
+ count_0 += iterations;
+ count_1 += iterations / 2;
+ }
+
+ if (consumer_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 0 (%d)\n",
+ consumer_0.disconnect_count, count_0,
+ use_callbacks));
+ if (supplier_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 0 (%d)\n",
+ supplier_0.disconnect_count, count_0,
+ use_callbacks));
+
+ if (consumer_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 1 (%d)\n",
+ consumer_1.disconnect_count, count_1,
+ use_callbacks));
+ if (supplier_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 1 (%d)\n",
+ supplier_1.disconnect_count, count_1,
+ use_callbacks));
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.cpp b/TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.cpp
new file mode 100644
index 00000000000..0c94a7bdb15
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.cpp
@@ -0,0 +1,236 @@
+// $Id$
+
+#include "MT_Disconnect.h"
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+
+ACE_RCSID (CEC_Tests,
+ MT_Disconnect,
+ "$Id$")
+
+static void run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL);
+
+int
+main (int argc, char* argv[])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ run_test (poa.in (), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ run_test (poa.in (), 1 ACE_ENV_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;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+void
+deactivate_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL)
+{
+ TAO_CEC_EventChannel_Attributes attributes (poa, poa);
+ attributes.disconnect_callbacks = use_callbacks;
+
+ TAO_CEC_EventChannel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ MTD_Task task (event_channel.in (), use_callbacks);
+
+ if (task.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate the tasks\n"));
+ }
+
+ // Wait for all the threads to complete and the return
+ ACE_Thread_Manager::instance ()->wait ();
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&ec_impl ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+MTD_Task::MTD_Task (CosEventChannelAdmin::EventChannel_ptr ec,
+ int callbacks)
+ : event_channel (CosEventChannelAdmin::EventChannel::_duplicate (ec)),
+ use_callbacks (callbacks)
+{
+}
+
+
+int
+MTD_Task::svc ()
+{
+ for (int i = 0; i < 10; ++i)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ this->run_iteration (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ }
+ return 0;
+}
+
+void
+MTD_Task::run_iteration (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Obtain the consumer admin..
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // and the supplier admin..
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ int iterations = 100;
+
+ CEC_Counting_Supplier supplier_0;
+ CEC_Counting_Supplier supplier_1;
+ CEC_Counting_Consumer consumer_0 ("Consumer/0");
+ CEC_Counting_Consumer consumer_1 ("Consumer/1");
+
+ for (int i = 0; i != iterations; ++i)
+ {
+ supplier_0.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ supplier_1.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_1.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ supplier_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ consumer_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ deactivate_servant (&supplier_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&consumer_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong count_0 = 0;
+ CORBA::ULong count_1 = 0;
+ if (use_callbacks)
+ {
+ count_0 += iterations;
+ count_1 += iterations / 2;
+ }
+
+ if (consumer_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 0 (%d)\n",
+ consumer_0.disconnect_count, count_0,
+ use_callbacks));
+ if (supplier_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 0 (%d)\n",
+ supplier_0.disconnect_count, count_0,
+ use_callbacks));
+
+ if (consumer_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 1 (%d)\n",
+ consumer_1.disconnect_count, count_1,
+ use_callbacks));
+ if (supplier_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 1 (%d)\n",
+ supplier_1.disconnect_count, count_1,
+ use_callbacks));
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.h b/TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.h
new file mode 100644
index 00000000000..1248ee1b8ff
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/MT_Disconnect.h
@@ -0,0 +1,49 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Cos Event Channel tests
+//
+// = FILENAME
+// MT_Disconnect.h
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef CEC_MT_DISCONNECT_H
+#define CEC_MT_DISCONNECT_H
+
+#include "ace/Task.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class MTD_Task : public ACE_Task_Base
+{
+public:
+ MTD_Task (CosEventChannelAdmin::EventChannel_ptr ec,
+ int use_callbacks);
+ // Create the task...
+
+ // = Check the ACE_Task_Base documentation.
+ int svc (void);
+
+ void run_iteration (ACE_ENV_SINGLE_ARG_DECL);
+ // Run a single iteration of the test
+
+private:
+ CosEventChannelAdmin::EventChannel_var event_channel;
+ // The event channel used on the test
+
+ int use_callbacks;
+ // Does the event channel send any callback messages when a client
+ // diconnects
+};
+
+#endif /* EC_DISCONNECT_H */
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/Makefile.am b/TAO/orbsvcs/tests/CosEvent/Basic/Makefile.am
new file mode 100644
index 00000000000..4677afe69e4
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/Makefile.am
@@ -0,0 +1,286 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.CosEvent_Basic_Disconnect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Disconnect
+
+Disconnect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Disconnect_SOURCES = \
+ Disconnect.cpp \
+ MT_Disconnect.h \
+ Random.h
+
+Disconnect_LDADD = \
+ $(top_builddir)/orbsvcs/tests/CosEvent/lib/libCECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.CosEvent_Basic_MT_Disconnect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += MT_Disconnect
+
+MT_Disconnect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+MT_Disconnect_SOURCES = \
+ MT_Disconnect.cpp \
+ MT_Disconnect.h
+
+MT_Disconnect_LDADD = \
+ $(top_builddir)/orbsvcs/tests/CosEvent/lib/libCECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.CosEvent_Basic_Pull_Push_Event.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Pull_Push_Event
+
+Pull_Push_Event_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Pull_Push_Event_SOURCES = \
+ Pull_Push_Event.cpp \
+ MT_Disconnect.h \
+ Random.h
+
+Pull_Push_Event_LDADD = \
+ $(top_builddir)/orbsvcs/tests/CosEvent/lib/libCECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.CosEvent_Basic_Push_Event.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Push_Event
+
+Push_Event_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Push_Event_SOURCES = \
+ Push_Event.cpp \
+ MT_Disconnect.h \
+ Random.h
+
+Push_Event_LDADD = \
+ $(top_builddir)/orbsvcs/tests/CosEvent/lib/libCECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.CosEvent_Basic_Random.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Random
+
+Random_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Random_SOURCES = \
+ Random.cpp \
+ Random.h
+
+Random_LDADD = \
+ $(top_builddir)/orbsvcs/tests/CosEvent/lib/libCECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.CosEvent_Basic_Shutdown.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Shutdown
+
+Shutdown_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Shutdown_SOURCES = \
+ Shutdown.cpp \
+ MT_Disconnect.h \
+ Random.h
+
+Shutdown_LDADD = \
+ $(top_builddir)/orbsvcs/tests/CosEvent/lib/libCECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/Pull_Push_Event.cpp b/TAO/orbsvcs/tests/CosEvent/Basic/Pull_Push_Event.cpp
new file mode 100644
index 00000000000..abaa9184f9b
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/Pull_Push_Event.cpp
@@ -0,0 +1,232 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (CEC_Tests_Basic,
+ Pull_Push_Event,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_CEC_EventChannel_Attributes attributes (poa.in (),
+ poa.in ());
+
+ TAO_CEC_EventChannel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ const int milliseconds = 50;
+
+ CEC_Counting_Supplier supplier_00;
+
+ supplier_00.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Supplier supplier_01;
+
+ supplier_01.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Pull_Counting_Supplier supplier_10;
+
+ supplier_10.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Pull_Counting_Supplier supplier_11;
+
+ supplier_11.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+ CEC_Counting_Consumer consumer_00 ("Consumer/00");
+ consumer_00.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Pull_Counting_Consumer consumer_01 ("Consumer/01");
+ consumer_01.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Pull_Counting_Consumer consumer_10 ("Consumer/10");
+ consumer_10.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Supplier_Task task_00 (&supplier_00,
+ milliseconds);
+ CEC_Counting_Supplier_Task task_01 (&supplier_01,
+ 3 * milliseconds);
+
+ if (task_00.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 00\n"));
+ }
+ if (task_01.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 01\n"));
+ }
+
+ // ****************************************************************
+
+ CEC_Counting_Consumer_Task consumer_task_01 (&consumer_01,
+ 5 * milliseconds);
+ if (consumer_task_01.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 01\n"));
+ }
+
+ // ****************************************************************
+
+ CEC_Counting_Consumer_Task consumer_task_10 (&consumer_10,
+ 10);
+ if (consumer_task_10.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 10\n"));
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (15, 0);
+ ACE_OS::sleep (tv);
+
+ task_00.stop ();
+ task_01.stop ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Events pulled (so far) by Consumer/01 = %d\n",
+ consumer_task_01.pull_count ()));
+
+ tv = ACE_Time_Value (5, 0);
+ ACE_OS::sleep (tv);
+
+ consumer_task_10.stop ();
+ consumer_task_01.stop ();
+
+ // Wait for all the threads to complete and the return
+ ACE_Thread_Manager::instance ()->wait ();
+
+ // ****************************************************************
+
+ consumer_10.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer_01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier_11.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_10.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (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;
+
+ // ****************************************************************
+
+ CORBA::ULong expected =
+ task_00.push_count ()
+ + task_01.push_count ()
+ + supplier_10.event_count
+ + supplier_11.event_count;
+
+ consumer_00.dump_results (expected, 5);
+
+ expected =
+ consumer_task_01.pull_count ();
+ consumer_01.dump_results (expected, 5);
+ expected =
+ consumer_task_10.pull_count ();
+ consumer_10.dump_results (expected, 5);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/Push_Event.cpp b/TAO/orbsvcs/tests/CosEvent/Basic/Push_Event.cpp
new file mode 100644
index 00000000000..3ff9f720233
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/Push_Event.cpp
@@ -0,0 +1,196 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (CEC_Tests_Basic,
+ Push_Event,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_CEC_EventChannel_Attributes attributes (poa.in (),
+ poa.in ());
+
+ TAO_CEC_EventChannel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ const int milliseconds = 50;
+
+ CEC_Counting_Supplier supplier_00;
+
+ supplier_00.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Supplier supplier_01;
+
+ supplier_01.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Supplier supplier_10;
+
+ supplier_10.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Supplier supplier_11;
+
+ supplier_11.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+ CEC_Counting_Consumer consumer_00 ("Consumer/00");
+ consumer_00.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Consumer consumer_01 ("Consumer/01");
+ consumer_01.connect (consumer_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Supplier_Task task_00 (&supplier_00, milliseconds);
+ CEC_Counting_Supplier_Task task_01 (&supplier_01, milliseconds);
+ CEC_Counting_Supplier_Task task_10 (&supplier_10, milliseconds);
+ CEC_Counting_Supplier_Task task_11 (&supplier_11, milliseconds);
+
+ if (task_00.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 00\n"));
+ }
+ if (task_01.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 01\n"));
+ }
+ if (task_10.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 10\n"));
+ }
+ if (task_11.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate task 11\n"));
+ }
+
+ ACE_Time_Value tv (5, 0);
+ ACE_OS::sleep (tv);
+
+ task_00.stop ();
+ task_01.stop ();
+ task_10.stop ();
+ task_11.stop ();
+
+ // Wait for all the threads to complete and the return
+ ACE_Thread_Manager::instance ()->wait ();
+
+ // ****************************************************************
+
+ consumer_01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier_11.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_10.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (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;
+
+ // ****************************************************************
+
+ CORBA::ULong expected =
+ task_00.push_count ()
+ + task_01.push_count ()
+ + task_10.push_count ()
+ + task_11.push_count ();
+
+ consumer_00.dump_results (expected, 5);
+ consumer_01.dump_results (expected, 5);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/Random.cpp b/TAO/orbsvcs/tests/CosEvent/Basic/Random.cpp
new file mode 100644
index 00000000000..0c5aea70a2f
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/Random.cpp
@@ -0,0 +1,514 @@
+// $Id$
+
+#include "Random.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (CEC_Tests,
+ Random,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ RND_Driver driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+void
+deactivate_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var oid =
+ poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+RND_Driver::RND_Driver (void)
+ : nsuppliers_ (4),
+ nconsumers_ (4),
+ max_recursion_ (1)
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+}
+
+int
+RND_Driver::run (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg, "-suppliers") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ int n = ACE_OS::atoi (opt);
+ if (n >= 1)
+ this->nsuppliers_ = n;
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (ACE_OS::strcasecmp (arg, "-consumers") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ int n = ACE_OS::atoi (opt);
+ if (n >= 1)
+ this->nconsumers_ = n;
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (ACE_OS::strcasecmp (arg, "-max_recursion") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ int n = ACE_OS::atoi (opt);
+ if (n >= 0)
+ this->max_recursion_ = n;
+ arg_shifter.consume_arg ();
+ }
+ }
+ else
+ arg_shifter.ignore_arg ();
+ }
+
+ // ****************************************************************
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_CEC_EventChannel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_CEC_EventChannel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ this->consumer_admin_ =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ this->supplier_admin_ =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ this->supplier_.connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ ACE_NEW_RETURN (this->consumers_,
+ RND_Consumer*[this->nconsumers_],
+ 1);
+ for (int i = 0; i != this->nconsumers_; ++i)
+ {
+ ACE_NEW_RETURN (this->consumers_[i],
+ RND_Consumer (this),
+ 1);
+
+ CORBA::Object_var obj =
+ this->consumers_[i]->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_NEW_RETURN (this->suppliers_,
+ RND_Supplier*[this->nsuppliers_],
+ 1);
+ for (int j = 0; j != this->nsuppliers_; ++j)
+ {
+ ACE_NEW_RETURN (this->suppliers_[j],
+ RND_Supplier,
+ 1);
+ this->suppliers_[j]->activate ();
+
+ CORBA::Object_var obj =
+ this->suppliers_[j]->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ for (int event_count = 0; event_count != 500; ++event_count)
+ {
+ ACE_Time_Value tv (0, 50000);
+ orb->run (tv);
+ this->supplier_.push_new_event (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_Thread_Manager::instance ()->wait ();
+
+ // ****************************************************************
+
+ {
+ for (int k = 0; k != this->nsuppliers_; ++k)
+ {
+ deactivate_servant (this->suppliers_[k]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->suppliers_[k]->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ delete[] this->suppliers_;
+ this->suppliers_ = 0;
+ }
+
+ // ****************************************************************
+
+ // We destroy now to verify that the callbacks work and do not
+ // produce any problems.
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ {
+ for (int k = 0; k != this->nconsumers_; ++k)
+ {
+ deactivate_servant (this->consumers_[k]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->consumers_[k]->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ delete[] this->consumers_;
+ this->consumers_ = 0;
+ }
+
+ // ****************************************************************
+
+ deactivate_servant (&ec_impl
+ ACE_ENV_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;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Random");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+RND_Driver::timer (const CORBA::Any &e
+ ACE_ENV_ARG_DECL)
+{
+ int r = ACE_OS::rand ();
+ if (r < 0)
+ r = -r;
+
+ int n = r% 20;
+
+ switch (n)
+ {
+ case 0:
+ case 1:
+ {
+ CORBA::Long recursion;
+ e >>= recursion;
+ // ACE_DEBUG ((LM_DEBUG, "Pushing an event\n"));
+ if (recursion < this->max_recursion_)
+ {
+ CORBA::Any new_event;
+ recursion++;
+ new_event <<= recursion;
+ this->supplier_.push (new_event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ break;
+
+ default:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ // ACE_DEBUG ((LM_DEBUG, "Received event\n"));
+ break;
+
+ case 6:
+ {
+ int n = ACE_OS::rand () % this->nsuppliers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Connecting supplier %d\n", n));
+
+ this->suppliers_[n]->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+
+ case 7:
+ {
+ int n = ACE_OS::rand () % this->nconsumers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Connecting consumer %d\n", n));
+
+ this->consumers_[n]->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+
+ case 8:
+ {
+ int n = ACE_OS::rand () % this->nsuppliers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Disconnecting supplier %d\n", n));
+
+ this->suppliers_[n]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+
+ case 9:
+ {
+ int n = ACE_OS::rand () % this->nconsumers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Disconnecting consumer %d\n", n));
+
+ this->consumers_[n]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+ }
+}
+
+void
+RND_Driver::event (const CORBA::Any &e
+ ACE_ENV_ARG_DECL)
+{
+ this->timer (e ACE_ENV_ARG_PARAMETER);
+}
+
+// ****************************************************************
+
+void
+RND_Consumer::connect (CosEventChannelAdmin::ConsumerAdmin_ptr admin
+ ACE_ENV_ARG_DECL)
+{
+ CosEventChannelAdmin::ProxyPushSupplier_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ {
+ this->proxy_ = admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ proxy =
+ CosEventChannelAdmin::ProxyPushSupplier::_duplicate(this->proxy_.in ());
+ }
+ CosEventComm::PushConsumer_var me =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ proxy->connect_push_consumer (me.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RND_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ return;
+ this->proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->proxy_ =
+ CosEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+void
+RND_Consumer::push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->driver_->event (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+RND_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+// ****************************************************************
+
+void
+RND_Supplier::connect (CosEventChannelAdmin::SupplierAdmin_ptr admin
+ ACE_ENV_ARG_DECL)
+{
+ CosEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ {
+ this->proxy_ = admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ proxy =
+ CosEventChannelAdmin::ProxyPushConsumer::_duplicate(this->proxy_.in ());
+ }
+ CosEventComm::PushSupplier_var me;
+
+ int r = ACE_OS::rand () % 2;
+ if (r == 0)
+ {
+ me = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ proxy->connect_push_supplier (me.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RND_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ return;
+ this->proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->proxy_ =
+ CosEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+RND_Supplier::push_new_event (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any event;
+ CORBA::Long recursion = 0;
+ event <<= recursion;
+
+ this->push (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+RND_Supplier::push (CORBA::Any &event
+ ACE_ENV_ARG_DECL)
+{
+ CosEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ return;
+
+ proxy =
+ CosEventChannelAdmin::ProxyPushConsumer::_duplicate(this->proxy_.in ());
+ }
+
+ proxy->push (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+RND_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+int
+RND_Supplier::svc (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Thread %t started\n"));
+ int percent = 10;
+ int niterations = 5000;
+ for (int i = 0; i != niterations; ++i)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_Time_Value tv (0, 10000);
+ ACE_OS::sleep (tv);
+
+ this->push_new_event (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ if (i * 100 / niterations >= percent)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Thread %t %d%%\n", percent));
+ percent += 10;
+ }
+ }
+ ACE_DEBUG ((LM_DEBUG, "Thread %t completed\n"));
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/Random.h b/TAO/orbsvcs/tests/CosEvent/Basic/Random.h
new file mode 100644
index 00000000000..0b26ea73695
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/Random.h
@@ -0,0 +1,184 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS COS Event Channel tests
+//
+// = FILENAME
+// Random.h
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef EC_RANDOM_H
+#define EC_RANDOM_H
+
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosEventChannelAdminS.h"
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class RND_Driver;
+
+class RND_Consumer
+ : public POA_CosEventComm::PushConsumer
+{
+ // = TITLE
+ // Simple consumer object
+ //
+ // = DESCRIPTION
+ //
+public:
+ RND_Consumer (RND_Driver *driver);
+ // Constructor
+
+ void push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void connect (CosEventChannelAdmin::ConsumerAdmin_ptr admin
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ RND_Driver *driver_;
+ // The driver
+
+ CosEventChannelAdmin::ProxyPushSupplier_var proxy_;
+ // The supplier.
+
+ TAO_SYNCH_MUTEX lock_;
+ // Synch
+};
+
+inline
+RND_Consumer::RND_Consumer (RND_Driver *driver)
+ : driver_ (driver)
+{
+}
+
+// ****************************************************************
+
+class RND_Timer : public RND_Consumer
+{
+public:
+ RND_Timer (RND_Driver *driver);
+
+ void push (const CORBA::Any &event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+inline
+RND_Timer::RND_Timer (RND_Driver *driver)
+ : RND_Consumer (driver)
+{
+}
+
+// ****************************************************************
+
+class RND_Supplier
+ : public POA_CosEventComm::PushSupplier
+ , public ACE_Task_Base
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ //
+public:
+ RND_Supplier (void);
+ // Constructor
+
+ void connect (CosEventChannelAdmin::SupplierAdmin_ptr admin
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ void push_new_event (ACE_ENV_SINGLE_ARG_DECL);
+ void push (CORBA::Any &event
+ ACE_ENV_ARG_DECL);
+ // Push a single event...
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual int svc (void);
+ // Active method
+
+private:
+ CosEventChannelAdmin::ProxyPushConsumer_var proxy_;
+ // The supplier.
+
+ TAO_SYNCH_MUTEX lock_;
+ // Synch
+};
+
+inline
+RND_Supplier::RND_Supplier (void)
+{
+}
+
+// ****************************************************************
+
+class RND_Driver
+{
+public:
+ RND_Driver (void);
+
+ int run (int argc, char *argv[]);
+ // Run the test
+
+ void timer (const CORBA::Any &e
+ ACE_ENV_ARG_DECL);
+ // The main timer has expired
+
+ void event (const CORBA::Any &e
+ ACE_ENV_ARG_DECL);
+ // One of the consumers has received an event
+
+private:
+ RND_Driver (const RND_Driver &);
+ RND_Driver& operator= (const RND_Driver &);
+
+private:
+ RND_Supplier supplier_;
+ // The supplier
+
+ int nsuppliers_;
+ // Number of suppliers
+
+ RND_Supplier **suppliers_;
+ // The suppliers
+
+ int nconsumers_;
+ // Number of consumers
+
+ RND_Consumer **consumers_;
+ // The consumers
+
+ int max_recursion_;
+ // Maximum recursion
+
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* EC_RANDOM_H */
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/Shutdown.cpp b/TAO/orbsvcs/tests/CosEvent/Basic/Shutdown.cpp
new file mode 100644
index 00000000000..85ec4180e9f
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/Shutdown.cpp
@@ -0,0 +1,181 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+#include "orbsvcs/CosEvent/CEC_EventChannel.h"
+#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
+
+ACE_RCSID( CEC_Tests_Basic,
+ Shutdown,
+ "$Id$")
+
+static void run_test (PortableServer::POA_ptr poa,
+ int with_callbacks
+ ACE_ENV_ARG_DECL);
+
+int
+main (int argc, char* argv[])
+{
+ TAO_CEC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ run_test (poa.in (), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ run_test (poa.in (), 1 ACE_ENV_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;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+deactivate_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+static void
+run_test (PortableServer::POA_ptr poa,
+ int with_callbacks
+ ACE_ENV_ARG_DECL)
+{
+ TAO_CEC_EventChannel_Attributes attributes (poa,
+ poa);
+ attributes.disconnect_callbacks = with_callbacks;
+
+ TAO_CEC_EventChannel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain the supplier admin..
+ CosEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ CEC_Counting_Consumer **consumer = 0;
+ CEC_Counting_Supplier **supplier = 0;
+
+ const int n = 200;
+ ACE_NEW (consumer, CEC_Counting_Consumer*[n]);
+ ACE_NEW (supplier, CEC_Counting_Supplier*[n]);
+
+ int i = 0;
+ for (i = 0; i != n; ++i)
+ {
+ char consumer_name[64];
+ ACE_OS::sprintf (consumer_name, "Consumer/%4.4d", i);
+ ACE_NEW (consumer[i],
+ CEC_Counting_Consumer (consumer_name));
+
+ ACE_NEW (supplier[i], CEC_Counting_Supplier ());
+ }
+
+ for (i = 0; i != n; ++i)
+ {
+ consumer[i]->connect (consumer_admin.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier[i]->connect (supplier_admin.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // ****************************************************************
+
+ // Destroy the event channel, *before* disconnecting the
+ // clients.
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ for (i = 0; i != n; ++i)
+ {
+ if (consumer[i]->disconnect_count != 1)
+ ACE_DEBUG ((LM_DEBUG,
+ "ERRROR unexpected "
+ "disconnect count (%d) in Consumer/%04.4d\n",
+ consumer[i]->disconnect_count,
+ i));
+
+ if (supplier[i]->disconnect_count != 1)
+ ACE_DEBUG ((LM_DEBUG,
+ "ERRROR unexpected "
+ "disconnect count (%d) in Supplier/%04.4d\n",
+ supplier[i]->disconnect_count,
+ i));
+ }
+
+ // ****************************************************************
+
+ for (i = 0; i != n; ++i)
+ {
+ deactivate_servant (supplier[i] ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ delete supplier[i];
+
+ deactivate_servant (consumer[i] ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ delete consumer[i];
+ }
+ delete[] supplier;
+ delete[] consumer;
+
+ deactivate_servant (&ec_impl ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/basiceventtestexe.mpb b/TAO/orbsvcs/tests/CosEvent/Basic/basiceventtestexe.mpb
new file mode 100644
index 00000000000..87f5e92c38e
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/basiceventtestexe.mpb
@@ -0,0 +1,13 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, messaging, taoserver, event_serv, naming, svc_utils, iortable {
+ after += CosEvent_Test_Lib
+ libs += CECTests
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl b/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl
new file mode 100755
index 00000000000..359318a505c
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/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;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs the client and all the other servers that
+# are needed
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$svc_pull_conf = PerlACE::LocalFile ("svc.pull$PerlACE::svcconf_ext");
+
+sub RunTest ($$$)
+{
+ my $message = shift;
+ my $program = shift;
+ my $arguments = shift;
+
+ my $TEST = new PerlACE::Process ($program, $arguments);
+
+ print STDERR "\n\n$message\n";
+
+ my $test = $TEST->SpawnWaitKill (240);
+
+ if ($test != 0) {
+ print STDERR "ERROR: Test returned $test\n";
+ $status = 1;
+ }
+}
+
+RunTest ("\n\nShutdown EC with clients still attached\n",
+ "Shutdown",
+ "");
+
+RunTest ("\n\nDisconnect callbacks test\n",
+ "Disconnect",
+ "");
+
+RunTest ("\n\nMT Disconnects test\n",
+ "MT_Disconnect",
+ "");
+
+RunTest ("\n\nPush Events\n",
+ "Push_Event",
+ "");
+
+RunTest ("\n\nPull-Push Events\n",
+ "Pull_Push_Event",
+ "-ORBSvcConf $svc_pull_conf");
+
+RunTest ("\n\nRandom\n",
+ "Random",
+ "");
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf b/TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf
new file mode 100644
index 00000000000..42dae9435e6
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf
@@ -0,0 +1,2 @@
+# $Id$
+static CEC_Factory "-CECReactivePullingPeriod 10000"
diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf.xml b/TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf.xml
new file mode 100644
index 00000000000..14073ec2a16
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Basic/svc.pull.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/CosEvent/Basic/svc.pull.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="CEC_Factory" params="-CECReactivePullingPeriod 10000"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/CosEvent/Makefile.am b/TAO/orbsvcs/tests/CosEvent/Makefile.am
new file mode 100644
index 00000000000..19f692f256b
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Makefile.am
@@ -0,0 +1,14 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ lib \
+ Basic
+
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/README b/TAO/orbsvcs/tests/CosEvent/Timeout/README
new file mode 100644
index 00000000000..6b415c9ba00
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Timeout/README
@@ -0,0 +1,40 @@
+# $Id$
+
+CosEvent timeout feature test
+
+*Purpose:
+
+Demonstrates the timeout feature (see cosevent.conf in this directory) of the
+CosEvent service. This feature was created because the reactive consumer/
+supplier control is lacking in the following way. A consumer may become
+unresponsive during a push() upcall. If the consumer is at all multithreaded,
+then the reactive control's ping operation will still succeed. Timeouts
+(via the Messaging library's relative round-trip timeout policy) allow the
+event service to disconnect an unresponsive client (consumer or supplier).
+Notice in run_test.pl that the CosEvent_Service executable's new -b option
+is used to enable callbacks on disconnect. This was previously only availble
+through code.
+
+*Running:
+
+> run_test.pl
+
+*Sample output:
+
+Found the EchoEventChannel.
+Consumer connected
+Ready to receive events...
+Supplier starting...
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Received event containing 40 bytes.
+TestEventConsumer_i::push(): Simulating hung consumer
+TestEventConsumer_i::disconnect_push_consumer()
+TestEventConsumer_i::push(): Done
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.cpp b/TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.cpp
new file mode 100644
index 00000000000..d143251cf90
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.cpp
@@ -0,0 +1,78 @@
+// $Id$
+
+#include "TestEventConsumer_i.h"
+
+#include "ace/Log_Msg.h"
+
+
+TestEventConsumer_i::TestEventConsumer_i (CORBA::ORB_ptr orb, bool hang)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ hang_ (hang),
+ count_ (0),
+ orbtask_ (orb),
+ cond_ (this->mtx_),
+ shutdown_ (false)
+{
+}
+
+void
+TestEventConsumer_i::activate ()
+{
+ this->orbtask_.activate ();
+}
+
+int
+TestEventConsumer_i::ORB_task::svc ()
+{
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestEventConsumer_i ORB_task starting\n")));
+ try
+ {
+ this->orb_->run ();
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestEventConsumer_i ORB_task "
+ "exiting\n")));
+ }
+ catch (CORBA::SystemException &e)
+ {
+ ACE_PRINT_EXCEPTION (e, ACE_TEXT ("TestEventConsumer_i ORB_task: "
+ "Caught CORBA::Exception:"));
+ }
+ return 0;
+}
+
+
+void
+TestEventConsumer_i::push (const CORBA::Any & data)
+ throw (CORBA::SystemException, CosEventComm::Disconnected)
+{
+ // Extract event data from the any.
+ const char *eventData;
+ if (data >>= eventData)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestEventConsumer_i::push(): Received "
+ "event containing %d bytes.\n"),
+ ACE_OS::strlen (eventData)));
+ if (this->hang_ && ++this->count_ == 10)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestEventConsumer_i::push(): "
+ "Simulating hung consumer\n")));
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->mtx_);
+ while (!this->shutdown_)
+ this->cond_.wait ();
+ }
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TestEventConsumer_i::push Done\n")
+ ));
+ }
+ }
+}
+
+void
+TestEventConsumer_i::disconnect_push_consumer ()
+ throw (CORBA::SystemException)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TestEventConsumer_i::disconnect_push_consumer()\n")));
+ this->orb_->shutdown ();
+ this->shutdown_ = true;
+ this->cond_.signal ();
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.h b/TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.h
new file mode 100644
index 00000000000..2f97247ece0
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Timeout/TestEventConsumer_i.h
@@ -0,0 +1,46 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef TestEventConsumer_i_h_
+#define TestEventConsumer_i_h_
+
+#include "orbsvcs/CosEventCommS.h"
+
+#include "ace/Task.h"
+#include "ace/Condition_T.h"
+
+class TestEventConsumer_i : public virtual POA_CosEventComm::PushConsumer
+{
+public:
+ TestEventConsumer_i (CORBA::ORB_ptr orb, bool hang);
+
+ // Override operations from PushConsumer interface.
+ virtual void push (const CORBA::Any & data)
+ throw (CORBA::SystemException, CosEventComm::Disconnected);
+
+ virtual void disconnect_push_consumer () throw (CORBA::SystemException);
+
+ void activate ();
+
+ struct ORB_task : ACE_Task_Base
+ {
+ ORB_task (CORBA::ORB_ptr orb) : orb_ (CORBA::ORB::_duplicate (orb))
+ {}
+
+ CORBA::ORB_var orb_;
+
+ int svc ();
+ };
+
+private:
+ CORBA::ORB_var orb_;
+ bool hang_;
+ unsigned count_;
+ ORB_task orbtask_;
+
+ TAO_SYNCH_MUTEX mtx_;
+ ACE_Condition<TAO_SYNCH_MUTEX> cond_;
+ bool shutdown_;
+};
+
+#endif
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/Timeout.mpc b/TAO/orbsvcs/tests/CosEvent/Timeout/Timeout.mpc
new file mode 100644
index 00000000000..f78ee0c0f12
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Timeout/Timeout.mpc
@@ -0,0 +1,4 @@
+//$Id$
+project(*Timeout): orbsvcsexe, naming, event, event_skel, messaging, threads {
+ exename = TimeoutTest
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp b/TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp
new file mode 100644
index 00000000000..9b0b4e8f62d
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Timeout/TimeoutTestMain.cpp
@@ -0,0 +1,177 @@
+// $Id$
+
+#include "TestEventConsumer_i.h"
+
+#include "orbsvcs/CosEventCommC.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "ace/Task.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_unistd.h"
+
+namespace
+{
+ const char *forty_bytes = "1234567890123456789012345678901234567890";
+}
+
+struct SupplierTask : ACE_Task_Base
+{
+ static const int N_ITERATIONS = 15;
+
+ SupplierTask (CosEventChannelAdmin::ProxyPushConsumer_ptr ppc,
+ CORBA::ORB_ptr orb)
+ : consumer_ (CosEventChannelAdmin::ProxyPushConsumer::_duplicate (ppc)),
+ orb_ (CORBA::ORB::_duplicate (orb))
+ {
+ }
+
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer_;
+ CORBA::ORB_var orb_;
+
+ int svc()
+ {
+ // Create an event (just a string in this case).
+ CORBA::String_var eventData = forty_bytes;
+ int delay_ms = 500;
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Supplier starting...\n")));
+
+ for (int i = 0; i < N_ITERATIONS; ++i)
+ {
+ // Insert the event data into an any.
+ CORBA::Any any;
+ any <<= eventData.in ();
+
+ // Now push the event to the consumer
+ this->consumer_->push (any);
+
+ ACE_Time_Value event_delay (0, 1000 * delay_ms);
+ ACE_OS::sleep (event_delay);
+ }
+ this->orb_->destroy ();
+ return 0;
+ }
+};
+
+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 ());
+
+ obj = root_context->resolve_str ("CosEventService");
+
+ // Downcast the object reference to an EventChannel reference.
+ CosEventChannelAdmin::EventChannel_var ec =
+ CosEventChannelAdmin::EventChannel::_narrow (obj.in ());
+ if (CORBA::is_nil (ec.in ()))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Could not narrow the EventChannel.\n")));
+ return 1;
+ }
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Found the EventChannel.\n")));
+
+ bool consumer = false;
+ bool supplier = false;
+ bool hang = false;
+ for (int i=1; i < argc; ++i)
+ {
+ if (0 == ACE_OS::strcasecmp (argv[i], ACE_TEXT ("-consumer")))
+ consumer = true;
+ else if (0 == ACE_OS::strcasecmp (argv[i], ACE_TEXT ("-supplier")))
+ supplier = true;
+ else if (0 == ACE_OS::strcasecmp (argv[i], ACE_TEXT ("-hang")))
+ hang = true;
+ }
+
+ TestEventConsumer_i servant (orb.in (), hang);
+
+ if (consumer)
+ {
+ // 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 ());
+
+ // Get a ConsumerAdmin object from the EventChannel.
+ CosEventChannelAdmin::ConsumerAdmin_var consumerAdmin =
+ ec->for_consumers ();
+
+ // Get a ProxyPushSupplier from the ConsumerAdmin.
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumerAdmin->obtain_push_supplier ();
+
+ // Connect to the ProxyPushSupplier, passing our PushConsumer object
+ // reference to it.
+ supplier->connect_push_consumer (consumer.in ());
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Consumer connected\n")));
+
+ // Activate the POA via its POAManager.
+ PortableServer::POAManager_var poa_manager = poa->the_POAManager ();
+ poa_manager->activate ();
+ servant.activate ();
+ }
+
+ SupplierTask *pST = 0;
+ if (supplier)
+ {
+ // The supplier will use its own ORB.
+ CORBA::String_var ec_str = orb->object_to_string (ec.in ());
+
+ int no_args = 0;
+ CORBA::ORB_var s_orb = CORBA::ORB_init (no_args, 0,
+ "Supplier_pure_client_ORB");
+
+ CORBA::Object_var s_ec_obj = s_orb->string_to_object (ec_str.in ());
+
+ CosEventChannelAdmin::EventChannel_var s_ec =
+ CosEventChannelAdmin::EventChannel::_narrow (s_ec_obj.in ());
+
+ // Get a SupplierAdmin object from the EventChannel.
+ CosEventChannelAdmin::SupplierAdmin_var supplierAdmin =
+ s_ec->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 ());
+
+ ACE_NEW_RETURN (pST, SupplierTask (consumer.in (), s_orb.in ()), -1);
+ pST->activate ();
+ }
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Ready to receive events...\n")));
+
+ // Enter the ORB event loop.
+ orb->run ();
+
+ ACE_Thread_Manager::instance ()->wait ();
+ orb->destroy ();
+ return 0;
+ }
+ catch (CORBA::Exception &ex)
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ ACE_TEXT ("TimeoutTest: Caught CORBA::Exception:"));
+ }
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/cosevent.conf b/TAO/orbsvcs/tests/CosEvent/Timeout/cosevent.conf
new file mode 100644
index 00000000000..1fa9bf39317
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Timeout/cosevent.conf
@@ -0,0 +1,3 @@
+# $Id$
+static CEC_Factory "-CECSupplierControl reactive -CECConsumerControl reactive -CECDispatching mt -CECConsumerOperationTimeout 3000000 -CECSupplierOperationTimeout 3000000"
+static Server_Strategy_Factory "-ORBConcurrency thread-per-connection"
diff --git a/TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl b/TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl
new file mode 100755
index 00000000000..489b16188e3
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl
@@ -0,0 +1,66 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+# $Id$
+
+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";
+
+$status = 0;
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+# start Naming Service
+
+$NameService = "$ENV{ACE_ROOT}/TAO/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{ACE_ROOT}/TAO/orbsvcs/CosEvent_Service/CosEvent_Service";
+$ES = new PerlACE::Process($EventService, "-ORBSvcConf cosevent.conf "
+ ."-b -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;
+}
+
+
+$S = new PerlACE::Process("TimeoutTest", "-supplier -consumer -hang "
+ . $arg_ns_ref);
+$ret = $S->SpawnWaitKill(30);
+if ($ret != 0) {
+ print STDERR "ERROR: application returned $ret\n";
+ $status = 1;
+}
+
+$ret = $ES->Kill();
+if ($ret != 0) {
+ print STDERR "ERROR: event channel returned $ret\n";
+ $status = 1;
+}
+
+$ret = $NS->Kill();
+if ($ret != 0) {
+ print STDERR "ERROR: name service returned $ret\n";
+ $status = 1;
+}
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/CosEvent/lib/CosEvent_lib.mpc b/TAO/orbsvcs/tests/CosEvent/lib/CosEvent_lib.mpc
new file mode 100644
index 00000000000..8ac7b79bce9
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/lib/CosEvent_lib.mpc
@@ -0,0 +1,10 @@
+// -*- MPC -*-
+// $Id$
+
+project(CosEvent Test Lib): orbsvcslib, event_skel, svc_utils, iortable, portableserver {
+ sharedname = CECTests
+ dynamicflags = CEC_TEST_BUILD_DLL
+ Header_Files {
+ cectest_export.h
+ }
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.cpp b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.cpp
new file mode 100644
index 00000000000..a00607b040b
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.cpp
@@ -0,0 +1,292 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID(CEC_Tests, CEC_Count_Consumer, "$Id$")
+
+CEC_Counting_Consumer::CEC_Counting_Consumer (const char* name)
+ : event_count (0),
+ disconnect_count (0),
+ name_ (name)
+{
+}
+
+void
+CEC_Counting_Consumer::connect (CosEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+{
+ // The canonical protocol to connect to the EC
+
+ CosEventComm::PushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ this->supplier_proxy_->connect_push_consumer (consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+CEC_Counting_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ PortableServer::POA_var consumer_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var consumer_id =
+ consumer_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_poa->deactivate_object (consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ CosEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+void
+CEC_Counting_Consumer::dump_results (int expected_count, int tolerance)
+{
+ int diff = this->event_count - expected_count;
+ if (diff > tolerance || diff < -tolerance)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ERROR - %s unexpected number of events <%d>\n",
+ this->name_,
+ this->event_count));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s - number of events <%d> within margins\n",
+ this->name_,
+ this->event_count));
+ }
+}
+
+void
+CEC_Counting_Consumer::push (const CORBA::Any&
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->event_count ++;
+#if 0
+ if (this->event_count % 10 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%P|%t): %d events received\n",
+ this->name_,
+ this->event_count));
+ }
+#endif /* 0 */
+}
+
+void
+CEC_Counting_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->disconnect_count++;
+ this->supplier_proxy_ =
+ CosEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+// ****************************************************************
+
+CEC_Pull_Counting_Consumer::CEC_Pull_Counting_Consumer (const char* name)
+ : event_count (0),
+ disconnect_count (0),
+ name_ (name)
+{
+}
+
+void
+CEC_Pull_Counting_Consumer::connect (CosEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+{
+ // The canonical protocol to connect to the EC
+
+ CosEventComm::PullConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ this->supplier_proxy_ =
+ consumer_admin->obtain_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ this->supplier_proxy_->connect_pull_consumer (consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+CEC_Pull_Counting_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ this->supplier_proxy_->disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ PortableServer::POA_var consumer_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var consumer_id =
+ consumer_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_poa->deactivate_object (consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ CosEventChannelAdmin::ProxyPullSupplier::_nil ();
+}
+
+CORBA::Any*
+CEC_Pull_Counting_Consumer::pull (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ return 0;
+ }
+ this->event_count++;
+ return this->supplier_proxy_->pull (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CORBA::Any*
+CEC_Pull_Counting_Consumer::try_pull (CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ has_event = 0;
+ return 0;
+ }
+
+ CORBA::Any_var event =
+ this->supplier_proxy_->try_pull (has_event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (has_event)
+ this->event_count++;
+
+ return event._retn ();
+}
+
+void
+CEC_Pull_Counting_Consumer::dump_results (int expected_count, int tolerance)
+{
+ int diff = this->event_count - expected_count;
+ if (diff > tolerance || diff < -tolerance)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ERROR - %s unexpected number of events <%d>\n",
+ this->name_,
+ this->event_count));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s - number of events <%d> within margins\n",
+ this->name_,
+ this->event_count));
+ }
+}
+
+void
+CEC_Pull_Counting_Consumer::disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->disconnect_count++;
+ this->supplier_proxy_ =
+ CosEventChannelAdmin::ProxyPullSupplier::_nil ();
+}
+
+// ****************************************************************
+
+CEC_Counting_Consumer_Task::
+ CEC_Counting_Consumer_Task (CEC_Pull_Counting_Consumer *s,
+ int milliseconds)
+ : consumer_ (s),
+ stop_flag_ (0),
+ pull_count_ (0),
+ milliseconds_ (milliseconds)
+{
+}
+
+int
+CEC_Counting_Consumer_Task::svc ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+CEC_Counting_Consumer_Task::stop (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->stop_flag_ = 1;
+}
+
+CORBA::ULong
+CEC_Counting_Consumer_Task::pull_count (void)
+{
+ return this->pull_count_;
+}
+
+void
+CEC_Counting_Consumer_Task::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any event;
+ event <<= CORBA::Long(0);
+
+ int stop = 0;
+ do {
+ CORBA::Boolean has_event;
+ CORBA::Any_var event =
+ this->consumer_->try_pull (has_event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->milliseconds_ != 0)
+ {
+ ACE_Time_Value tv (0, 1000 * this->milliseconds_);
+ ACE_OS::sleep (tv);
+ }
+ else
+ {
+ // Sleep for a short time to avoid spinning... kind of klugy
+ ACE_OS::sleep (0);
+ }
+
+ if (has_event)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->pull_count_++;
+ }
+
+ stop = this->stop_flag_;
+ } while (stop == 0);
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.h b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.h
new file mode 100644
index 00000000000..d3ec2cbbb33
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Consumer.h
@@ -0,0 +1,155 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Cos Event Channel testsuite
+//
+// = FILENAME
+// Counting_Consumer
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef CEC_COUNTING_CONSUMER_H
+#define CEC_COUNTING_CONSUMER_H
+
+#include "cectest_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "ace/Task.h"
+
+class CEC_Test_Export CEC_Counting_Consumer : public POA_CosEventComm::PushConsumer
+{
+ // = TITLE
+ // Simple consumer object to implement EC tests.
+ //
+ // = DESCRIPTION
+ // This is a simple consumer that counts the events it receives.
+ //
+public:
+ CEC_Counting_Consumer (const char* name);
+ // Constructor
+
+ void connect (CosEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Simple connect/disconnect methods..
+
+ void dump_results (int expected_count, int tolerance);
+ // Print out an error message if the event count is too far from the
+ // expected count.
+
+ // = The CosEventComm::PushConsumer methods
+
+ virtual void push (const CORBA::Any& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+ CORBA::ULong event_count;
+ // Keep track of the number of events received.
+
+ CORBA::ULong disconnect_count;
+ // Keep track of the number of disconnect calls received.
+
+protected:
+ CosEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // The proxy
+
+ const char* name_;
+ // The name
+};
+
+// ****************************************************************
+
+class CEC_Test_Export CEC_Pull_Counting_Consumer : public POA_CosEventComm::PullConsumer
+{
+ // = TITLE
+ // Simple consumer object to implement EC tests.
+ //
+ // = DESCRIPTION
+ // This is a simple consumer that counts the events it receives.
+ //
+public:
+ CEC_Pull_Counting_Consumer (const char* name);
+ // Constructor
+
+ void connect (CosEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Simple connect/disconnect methods..
+
+ void dump_results (int expected_count, int tolerance);
+ // Print out an error message if the event count is too far from the
+ // expected count.
+
+ CORBA::Any *pull (ACE_ENV_SINGLE_ARG_DECL);
+ CORBA::Any *try_pull (CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL);
+
+ // = The CosEventComm::PullConsumer methods
+ virtual void disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+ CORBA::ULong event_count;
+ // Keep track of the number of events received.
+
+ CORBA::ULong disconnect_count;
+ // Keep track of the number of disconnect calls received.
+
+protected:
+ CosEventChannelAdmin::ProxyPullSupplier_var supplier_proxy_;
+ // The proxy
+
+ const char* name_;
+ // The name
+};
+
+// ****************************************************************
+
+class CEC_Test_Export CEC_Counting_Consumer_Task : public ACE_Task_Base
+{
+public:
+ CEC_Counting_Consumer_Task (CEC_Pull_Counting_Consumer *consumer,
+ int milliseconds = 0);
+ // Create the task...
+
+ // = Check the ACE_Task_Base documentation.
+ int svc (void);
+
+ void stop (void);
+ CORBA::ULong pull_count (void);
+
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run a single iteration of the test
+
+private:
+ CEC_Pull_Counting_Consumer *consumer_;
+ // The consumer we are turning into an active object
+
+ int stop_flag_;
+ // Set to 1 when the test must stop
+
+ CORBA::ULong pull_count_;
+ // Count the number of pull() calls
+
+ int milliseconds_;
+ // If not zero then pause for <milliseconds> before sending each
+ // event.
+
+ TAO_SYNCH_MUTEX lock_;
+};
+
+#endif /* ECT_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.cpp b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.cpp
new file mode 100644
index 00000000000..b1f8e946266
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.cpp
@@ -0,0 +1,257 @@
+// $Id$
+
+#include "Counting_Supplier.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID(CEC_Tests, CEC_Count_Supplier, "$Id$")
+
+CEC_Counting_Supplier::CEC_Counting_Supplier (void)
+ : event_count (0),
+ disconnect_count (0)
+{
+}
+
+void
+CEC_Counting_Supplier::connect (
+ CosEventChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL)
+{
+ CosEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ this->consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ this->consumer_proxy_->connect_push_supplier (supplier.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+CEC_Counting_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ this->consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ PortableServer::POA_var supplier_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var supplier_id =
+ supplier_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_poa->deactivate_object (supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ CosEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+CEC_Counting_Supplier::push (const CORBA::Any&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ CORBA::Any event;
+ event <<= CORBA::Long(0);
+
+ this->consumer_proxy_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->event_count++;
+}
+
+void
+CEC_Counting_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->disconnect_count++;
+ this->consumer_proxy_ =
+ CosEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+// ****************************************************************
+
+CEC_Counting_Supplier_Task::
+ CEC_Counting_Supplier_Task (CEC_Counting_Supplier *s,
+ int milliseconds)
+ : supplier_ (s),
+ stop_flag_ (0),
+ push_count_ (0),
+ milliseconds_ (milliseconds)
+{
+}
+
+int
+CEC_Counting_Supplier_Task::svc ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+CEC_Counting_Supplier_Task::stop (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->stop_flag_ = 1;
+}
+
+CORBA::ULong
+CEC_Counting_Supplier_Task::push_count (void)
+{
+ return this->push_count_;
+}
+
+void
+CEC_Counting_Supplier_Task::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any event;
+ event <<= CORBA::Long(0);
+
+ int stop = 0;
+ do {
+ this->supplier_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->milliseconds_ != 0)
+ {
+ ACE_Time_Value tv (0, 1000 * this->milliseconds_);
+ ACE_OS::sleep (tv);
+ }
+ else
+ {
+ // Sleep for a short time to avoid spinning... kind of klugy
+ ACE_OS::sleep (0);
+ }
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ this->push_count_++;
+
+ stop = this->stop_flag_;
+ } while (stop == 0);
+}
+
+// ****************************************************************
+
+CEC_Pull_Counting_Supplier::CEC_Pull_Counting_Supplier (void)
+ : event_count (0),
+ disconnect_count (0)
+{
+}
+
+void
+CEC_Pull_Counting_Supplier::connect (
+ CosEventChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL)
+{
+ CosEventComm::PullSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ this->consumer_proxy_ =
+ supplier_admin->obtain_pull_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ this->consumer_proxy_->connect_pull_supplier (supplier.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+CEC_Pull_Counting_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ this->consumer_proxy_->disconnect_pull_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ PortableServer::POA_var supplier_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var supplier_id =
+ supplier_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_poa->deactivate_object (supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ CosEventChannelAdmin::ProxyPullConsumer::_nil ();
+}
+
+CORBA::Any*
+CEC_Pull_Counting_Supplier::pull (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected))
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ ACE_THROW_RETURN (CosEventComm::Disconnected (), 0);
+
+ if (this->event_count % 2)
+ {
+ // Sleep for 1 second, to simulate blocking calls.
+ ACE_OS::sleep (1);
+ }
+
+ this->event_count++;
+ CORBA::Any event;
+ event <<= CORBA::Long(0);
+
+ return new CORBA::Any (event);
+}
+
+CORBA::Any*
+CEC_Pull_Counting_Supplier::try_pull (CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected))
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ ACE_THROW_RETURN (CosEventComm::Disconnected (), 0);
+
+ if (this->event_count % 2)
+ {
+ // No event
+ has_event = 0;
+ }
+ else
+ {
+ // We have an event
+ has_event = 1;
+ this->event_count++;
+ }
+
+ CORBA::Any event;
+ event <<= CORBA::Long(0);
+
+ return new CORBA::Any (event);
+}
+
+void
+CEC_Pull_Counting_Supplier::disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->disconnect_count++;
+ this->consumer_proxy_ =
+ CosEventChannelAdmin::ProxyPullConsumer::_nil ();
+}
diff --git a/TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.h b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.h
new file mode 100644
index 00000000000..5f557db27ee
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/lib/Counting_Supplier.h
@@ -0,0 +1,143 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Cos Event Channel testsuite
+//
+// = FILENAME
+// Counting_Supplier
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef CEC_COUNTING_SUPPLIER_H
+#define CEC_COUNTING_SUPPLIER_H
+
+#include "cectest_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosEventCommS.h"
+#include "orbsvcs/CosEventChannelAdminC.h"
+#include "ace/Task.h"
+
+class CEC_Test_Export CEC_Counting_Supplier : public POA_CosEventComm::PushSupplier
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ // This class is a supplier of events.
+ //
+public:
+ CEC_Counting_Supplier (void);
+ // Constructor
+
+ // = The CosEventComm::PushSupplier methods
+
+ void connect (CosEventChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Simple connect/disconnect methods..
+
+ void push (const CORBA::Any& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Push an event.
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+ CORBA::ULong event_count;
+ // Count the number of events sent
+
+ CORBA::ULong disconnect_count;
+ // Count the number of disconnect_push_supplier calls
+
+private:
+ CosEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+ // Our proxy
+};
+
+class CEC_Test_Export CEC_Counting_Supplier_Task : public ACE_Task_Base
+{
+public:
+ CEC_Counting_Supplier_Task (CEC_Counting_Supplier *supplier,
+ int milliseconds = 0);
+ // Create the task...
+
+ // = Check the ACE_Task_Base documentation.
+ int svc (void);
+
+ void stop (void);
+ CORBA::ULong push_count (void);
+
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run a single iteration of the test
+
+private:
+ CEC_Counting_Supplier *supplier_;
+ // The supplier we are turning into an active object
+
+ int stop_flag_;
+ // Set to 1 when the test must stop
+
+ CORBA::ULong push_count_;
+ // Count the number of push() calls
+
+ int milliseconds_;
+ // If not zero then pause for <milliseconds> before sending each
+ // event.
+
+ TAO_SYNCH_MUTEX lock_;
+};
+
+// ****************************************************************
+
+class CEC_Test_Export CEC_Pull_Counting_Supplier : public POA_CosEventComm::PullSupplier
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ // This class is a supplier of events.
+ //
+public:
+ CEC_Pull_Counting_Supplier (void);
+ // Constructor
+
+ // = The CosEventComm::PullSupplier methods
+
+ void connect (CosEventChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Simple connect/disconnect methods..
+
+ // The PullSupplier methods.
+ CORBA::Any* pull (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected));
+ CORBA::Any* try_pull (CORBA::Boolean_out has_event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected));
+ virtual void disconnect_pull_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::ULong event_count;
+ // Count the number of events sent
+
+ CORBA::ULong disconnect_count;
+ // Count the number of disconnect_pull_supplier calls
+
+private:
+ CosEventChannelAdmin::ProxyPullConsumer_var consumer_proxy_;
+ // Our proxy
+};
+
+#endif /* ECT_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/CosEvent/lib/Makefile.am b/TAO/orbsvcs/tests/CosEvent/lib/Makefile.am
new file mode 100644
index 00000000000..a9b61c7c29f
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/lib/Makefile.am
@@ -0,0 +1,50 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.CosEvent_Test_Lib.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libCECTests.la
+
+libCECTests_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL \
+ -DCEC_TEST_BUILD_DLL
+
+libCECTests_la_SOURCES = \
+ Counting_Consumer.cpp \
+ Counting_Supplier.cpp
+
+noinst_HEADERS = \
+ Counting_Consumer.h \
+ Counting_Supplier.h \
+ cectest_export.h
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/CosEvent/lib/cectest_export.h b/TAO/orbsvcs/tests/CosEvent/lib/cectest_export.h
new file mode 100644
index 00000000000..e583040b361
--- /dev/null
+++ b/TAO/orbsvcs/tests/CosEvent/lib/cectest_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef CEC_TEST_EXPORT_H
+#define CEC_TEST_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (CEC_TEST_HAS_DLL)
+# define CEC_TEST_HAS_DLL 0
+# endif /* ! CEC_TEST_HAS_DLL */
+#else
+# if !defined (CEC_TEST_HAS_DLL)
+# define CEC_TEST_HAS_DLL 1
+# endif /* ! CEC_TEST_HAS_DLL */
+#endif
+
+#if defined (CEC_TEST_HAS_DLL) && (CEC_TEST_HAS_DLL == 1)
+# if defined (CEC_TEST_BUILD_DLL)
+# define CEC_Test_Export ACE_Proper_Export_Flag
+# define CEC_TEST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define CEC_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* CEC_TEST_BUILD_DLL */
+# define CEC_Test_Export ACE_Proper_Import_Flag
+# define CEC_TEST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define CEC_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* CEC_TEST_BUILD_DLL */
+#else /* CEC_TEST_HAS_DLL == 1 */
+# define CEC_Test_Export
+# define CEC_TEST_SINGLETON_DECLARATION(T)
+# define CEC_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* CEC_TEST_HAS_DLL == 1 */
+
+#endif /* CEC_TEST_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp
new file mode 100644
index 00000000000..7203f01d09c
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.cpp
@@ -0,0 +1,445 @@
+// $Id$
+
+#include "ECM_Consumer.h"
+#include "ECM_Data.h"
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/ORB_Core.h"
+#include "tao/CDR.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Custom_Marshal,
+ ECM_Consumer,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ Driver driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+Driver::Driver (void)
+ : n_consumers_ (1),
+ event_count_ (100),
+ event_a_ (ACE_ES_EVENT_UNDEFINED),
+ event_b_ (ACE_ES_EVENT_UNDEFINED + 1),
+ pid_file_name_ (0),
+ recv_count_ (0)
+{
+}
+
+// ****************************************************************
+
+int
+Driver::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " consumers = <%d>\n"
+ " event count = <%d>\n"
+ " supplier Event A = <%d>\n"
+ " supplier Event B = <%d>\n"
+ " pid file name = <%s>\n",
+
+ this->n_consumers_,
+ this->event_count_,
+ this->event_a_,
+ this->event_b_,
+
+ this->pid_file_name_?this->pid_file_name_:"nil") );
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_file_name_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ int min_priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_FIFO);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ min_priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: user is not superuser, "
+ "so remain in time-sharing class\n", argv[0]));
+ else
+ ACE_ERROR ((LM_ERROR,
+ "%s: ACE_OS::sched_params failed\n", argv[0]));
+ }
+
+ if (ACE_OS::thr_setprio (min_priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "(%P|%t) main thr_setprio failed,"
+ "no real-time features\n"));
+ }
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("EventService");
+
+ CORBA::Object_var ec_obj =
+ naming_context->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var channel;
+ if (CORBA::is_nil (ec_obj.in ()))
+ channel = RtecEventChannelAdmin::EventChannel::_nil ();
+ else
+ channel = RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect_consumers (channel.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected consumer(s)\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "running the test\n"));
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX in Consumer");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX in Consumer");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Driver::push_consumer (void* /* consumer_cookie */,
+ ACE_hrtime_t /* arrival */,
+ const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // int ID =
+ // (reinterpret_cast<Test_Consumer**> (consumer_cookie)
+ // - this->consumers_);
+ //
+ // ACE_DEBUG ((LM_DEBUG, "(%t) events received by consumer %d\n", ID));
+
+ if (events.length () == 0)
+ {
+ // ACE_DEBUG ((LM_DEBUG, "no events\n"));
+ return;
+ }
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->recv_count_mutex_);
+
+ this->recv_count_ += events.length ();
+
+ int x = this->event_count_ / 10;
+ if (this->recv_count_ % x == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ECM_Consumer (%P|%t): %d events received\n",
+ this->recv_count_));
+ }
+
+ if (this->recv_count_ >= this->event_count_)
+ {
+ TAO_ORB_Core_instance ()->orb ()->shutdown ();
+ }
+
+ // ACE_DEBUG ((LM_DEBUG, "%d event(s)\n", events.length ()));
+
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ const RtecEventComm::Event& e = events[i];
+
+ if (e.data.payload.mb () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "No data in event[%d]\n", i));
+ continue;
+ }
+
+ // @@ TODO this is a little messy, infortunately we have to
+ // extract the first byte to determine the byte order, the CDR
+ // cannot do it for us because in certain cases the byte order
+ // is not in the encapsulation. Maybe we need another
+ // constructor for the InputCDR streams (but there are too many
+ // already!)?
+
+ // Note that there is no copying
+ int byte_order = e.data.payload[0];
+
+ ACE_Message_Block* mb =
+ ACE_Message_Block::duplicate (e.data.payload.mb ());
+ mb->rd_ptr (1); // skip the byte order
+
+ TAO_InputCDR cdr (mb, byte_order);
+
+ ECM_IDLData::Info info;
+ cdr >> info;
+
+ ECM_Data other;
+ cdr >> other;
+
+ if (!cdr.good_bit ())
+ ACE_ERROR ((LM_ERROR, "Problem demarshalling C++ data\n"));
+
+ ACE_Message_Block::release (mb);
+
+ CORBA::ULong n = info.trajectory.length ();
+ // ACE_DEBUG ((LM_DEBUG, "Payload contains <%d> elements\n", n));
+ // ACE_DEBUG ((LM_DEBUG, "Inventory <%s> contains <%d> elements\n",
+ // other.description.in (),
+ // other.inventory.current_size ()));
+
+ for (CORBA::ULong j = 0; j < n; ++j)
+ {
+ ECM_IDLData::Point& p = info.trajectory[j];
+ if (p.x != j || p.y != j*j)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "invalid data in trajectory[%d] = (%f,%f)\n",
+ j, p.x, p.y));
+ }
+ }
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+}
+
+void
+Driver::connect_consumers (RtecEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL)
+{
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "consumer_%02d", i);
+
+ ACE_NEW (this->consumers_[i],
+ Test_Consumer (this, this->consumers_ + i));
+
+ this->consumers_[i]->connect (this->event_a_,
+ this->event_b_,
+ channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Driver::disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ this->consumers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+int
+Driver::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "dc:n:h:p:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'c':
+ this->n_consumers_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'n':
+ this->event_count_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'h':
+ {
+ char* aux;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->event_a_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->event_b_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'p':
+ this->pid_file_name_ = get_opt.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[ORB options] "
+ "-s <global|local> "
+ "-a (send data in events) "
+ "-h <args> "
+ "-p <pid file name> "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->event_count_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: event count (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->event_count_,
+ 100));
+ this->event_count_ = 100;
+ }
+
+ if (this->n_consumers_ <= 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: number of consumers or "
+ "suppliers out of range\n", argv[0]), -1);
+ }
+
+ return 0;
+}
+
+// ****************************************************************
+
+Test_Consumer::Test_Consumer (Driver *driver, void *cookie)
+ : driver_ (driver),
+ cookie_ (cookie)
+{
+}
+
+void
+Test_Consumer::connect (int event_a,
+ int event_b,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ qos.insert_type (ACE_ES_EVENT_SHUTDOWN, 0);
+ qos.insert_type (event_a, 0);
+ qos.insert_type (event_b, 0);
+
+ // = Connect as a consumer.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushConsumer_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (objref.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+void
+Test_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ return;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy =
+ this->supplier_proxy_._retn ();
+
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Test_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t arrival = ACE_OS::gethrtime ();
+ this->driver_->push_consumer (this->cookie_, arrival, events ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Test_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.h b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.h
new file mode 100644
index 00000000000..1d0adde39fd
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Consumer.h
@@ -0,0 +1,120 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// An example on custom marshaling in TAO.
+//
+// ============================================================================
+
+#ifndef ECM_CONSUMER_H
+#define ECM_CONSUMER_H
+
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Channel_Clients_T.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/OS_NS_time.h"
+
+class Driver;
+
+class Test_Consumer : public POA_RtecEventComm::PushConsumer
+{
+ //
+ // = TITLE
+ // Receive the events.
+ //
+ // = DESCRIPTION
+public:
+ Test_Consumer (Driver* driver, void* cookie);
+
+ void connect (int event_a,
+ int event_b,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // This method connects the consumer to the EC.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+private:
+ Driver* driver_;
+ // The main driver for the test.
+
+ void* cookie_;
+ // A magic cookie passed by the driver that we pass back in our
+ // callbacks.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC using this proxy.
+};
+
+class Driver
+{
+ //
+ // = TITLE
+ //
+ // = DESCRIPTION
+ //
+public:
+ Driver (void);
+
+ enum {
+ MAX_CONSUMERS = 16
+ // Maximum number of consumers.
+ };
+
+ int run (int argc, char* argv[]);
+ // Execute the test.
+
+ void push_consumer (void* consumer_cookie,
+ ACE_hrtime_t arrival,
+ const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Callback method for consumers, if any of our consumers has
+ // received events it will invoke this method.
+
+private:
+ int parse_args (int argc, char* argv[]);
+ // parse the command line args
+
+ void connect_consumers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect and disconnect the consumers.
+
+private:
+ Test_Consumer* consumers_[Driver::MAX_CONSUMERS];
+ // The consumer array.
+
+ int n_consumers_;
+ // The number of consumers.
+
+ int event_count_;
+ // How many messages we will send in the suppliers
+
+ int event_a_;
+ int event_b_;
+ // We send two types of events, with different contents.
+
+ const char* pid_file_name_;
+ // The name of a file where the process stores its pid
+
+ TAO_SYNCH_MUTEX recv_count_mutex_;
+ int recv_count_;
+ // How many events we have received.
+};
+
+#endif /* ECM_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.cpp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.cpp
new file mode 100644
index 00000000000..5c061747730
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.cpp
@@ -0,0 +1,53 @@
+// $Id$
+
+#include "ECM_Data.h"
+#include "tao/CDR.h"
+
+ACE_RCSID(EC_Custom_Marshal, ECM_Data, "$Id$")
+
+CORBA::Boolean
+operator<< (TAO_OutputCDR& cdr, ECM_Data& x)
+{
+ // We are a little careless about error checking in this routine,
+ // because one the CDR gets the error bit on it is never disabled.
+ CORBA::ULong count = x.inventory.current_size ();
+ if (cdr << x.description.in ()
+ && cdr << count )
+ {
+ for (ECM_Data::Inventory::ITERATOR i = x.inventory.begin ();
+ i != x.inventory.end () && cdr.good_bit ();
+ ++i)
+ {
+ const ECM_Data::Inventory::ENTRY& v = *i;
+ cdr << v.ext_id_;
+ cdr << v.int_id_;
+ }
+ }
+ return cdr.good_bit ();
+}
+
+CORBA::Boolean
+operator>> (TAO_InputCDR& cdr, ECM_Data& x)
+{
+ // We are a little careless about error checking in this routine,
+ // because one the CDR gets the error bit on it is never disabled.
+ CORBA::ULong count;
+ if (cdr >> x.description.out ()
+ && cdr >> count)
+ {
+ // ACE_DEBUG ((LM_DEBUG, "Decoding <%d> elements\n", count));
+
+ for (CORBA::ULong i = 0; i < count && cdr.good_bit (); ++i)
+ {
+ CORBA::ULong ext_id;
+ CORBA::Double int_id;
+ cdr >> ext_id;
+ cdr >> int_id;
+ if (cdr.good_bit ())
+ x.inventory.bind (ext_id, int_id);
+
+ // ACE_DEBUG ((LM_DEBUG, "Boung <%d,%f>\n", ext_id, int_id));
+ }
+ }
+ return cdr.good_bit ();
+}
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.h b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.h
new file mode 100644
index 00000000000..33218253383
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Data.h
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// Simple C++ data to show how custom marshalling can be used for
+// non-IDL types.
+//
+// ============================================================================
+
+#ifndef ECM_DATA_H
+#define ECM_DATA_H
+
+#include "ace/Map_Manager.h"
+#include "ace/Null_Mutex.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "dataC.h"
+
+struct ECM_Data
+{
+ // Yes, an STL type could be used here and yes, we could write
+ // generic algorithms for marshalling and demarshalling using
+ // iterators.
+ // But ACE (and TAO) must be ported to platforms whose C++ compilers
+ // will crash and burn when faced with an STL construct.
+ typedef ACE_Map_Manager<CORBA::ULong,CORBA::Double,ACE_Null_Mutex> Inventory;
+
+ CORBA::String_var description;
+ Inventory inventory;
+};
+
+extern CORBA::Boolean
+operator<< (TAO_OutputCDR& cdr, ECM_Data& x);
+
+extern CORBA::Boolean
+operator>> (TAO_InputCDR& cdr, ECM_Data& x);
+
+#endif /* ECM_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp
new file mode 100644
index 00000000000..f8dd801aa63
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp
@@ -0,0 +1,529 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/ACE.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/CDR.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ECM_Supplier.h"
+#include "ECM_Data.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID(EC_Custom_Marshal, ECM_Supplier, "$Id$")
+
+ECMS_Driver::ECMS_Driver (void)
+ : n_suppliers_ (1),
+ event_count_ (100),
+ event_period_ (100),
+ event_size_ (32),
+ event_a_ (ACE_ES_EVENT_UNDEFINED),
+ event_b_ (ACE_ES_EVENT_UNDEFINED + 1),
+ pid_file_name_ (0)
+{
+}
+
+// ****************************************************************
+
+int
+ECMS_Driver::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " suppliers = <%d>\n"
+ " event count = <%d>\n"
+ " event period = <%d>\n"
+ " event size = <%d>\n"
+ " supplier Event A = <%d>\n"
+ " supplier Event B = <%d>\n"
+ " pid file name = <%s>\n",
+
+ this->n_suppliers_,
+ this->event_count_,
+ this->event_period_,
+ this->event_size_,
+ this->event_a_,
+ this->event_b_,
+
+ this->pid_file_name_?this->pid_file_name_:"nil") );
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_file_name_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ int min_priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_FIFO);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ min_priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: user is not superuser, "
+ "so remain in time-sharing class\n", argv[0]));
+ else
+ ACE_ERROR ((LM_ERROR,
+ "%s: ACE_OS::sched_params failed\n", argv[0]));
+ }
+
+ if (ACE_OS::thr_setprio (min_priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "(%P|%t) main thr_setprio failed,"
+ "no real-time features\n"));
+ }
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("EventService");
+
+ CORBA::Object_var ec_obj =
+ naming_context->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var channel;
+ if (CORBA::is_nil (ec_obj.in ()))
+ channel = RtecEventChannelAdmin::EventChannel::_nil ();
+ else
+ channel = RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect_suppliers (channel.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected supplier(s)\n"));
+
+ this->activate_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers are active\n"));
+
+ // Wait for the supplier threads...
+ if (ACE_Thread_Manager::instance ()->wait () == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Thread_Manager wait failed\n"));
+ return 1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers finished\n"));
+
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // @@ Deactivate the suppliers (as CORBA Objects?)
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX in Supplier");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX in Supplier");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+int
+ECMS_Driver::supplier_task (Test_Supplier *supplier,
+ void* /* cookie */)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_Time_Value tv (0, this->event_period_);
+
+ CORBA::ULong n = this->event_size_;
+
+ ECM_IDLData::Info info;
+ info.mobile_name = CORBA::string_dup ("test");
+ info.mobile_speed = 1;
+ info.trajectory.length (n);
+
+ ECM_Data other;
+ other.description = CORBA::string_dup ("some data");
+
+ for (CORBA::ULong j = 0; j < n; ++j)
+ {
+ info.trajectory[j].x = j;
+ info.trajectory[j].y = j * j;
+ other.inventory.bind (j, j + 1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "The inventory contains (%d) elements\n",
+ other.inventory.current_size ()));
+
+ // We have to make it big enough so we get a contiguous block,
+ // otherwise the octet sequence will not work correctly.
+ // NOTE: we could pre-allocate enough memory in the CDR stream
+ // but we want to show that chaining works!
+ TAO_OutputCDR cdr;
+
+ CORBA::Boolean byte_order = TAO_ENCAP_BYTE_ORDER;
+ cdr << CORBA::Any::from_boolean (byte_order);
+
+ // The typecode name standard, the encode method is not (in
+ // general the CDR interface is not specified).
+ if (!(cdr << info))
+ ACE_THROW_RETURN (CORBA::MARSHAL (), 0);
+
+ // Here we marshall a non-IDL type.
+ cdr << other;
+
+ if (!cdr.good_bit ())
+ ACE_ERROR ((LM_ERROR, "Problem marshalling C++ data\n"));
+
+ const ACE_Message_Block* mb = cdr.begin ();
+ // NOTE: total_length () return the length of the complete
+ // chain.
+ CORBA::ULong mblen = cdr.total_length ();
+
+ for (CORBA::Long i = 0; i < this->event_count_; ++i)
+ {
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.source = supplier->supplier_id ();
+ event[0].header.ttl = 1;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time, t);
+
+ if (i == static_cast<CORBA::Long> (this->event_count_) - 1)
+ event[0].header.type = ACE_ES_EVENT_SHUTDOWN;
+ else if (i % 2 == 0)
+ event[0].header.type = this->event_a_;
+ else
+ event[0].header.type = this->event_b_;
+
+ // We use replace to minimize the copies, this should result
+ // in just one memory allocation;
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ event[0].data.payload.replace (mblen, mb);
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ event[0].data.payload.length (mblen);
+
+ // Now copy over each byte.
+ char* base = mb->data_block ()->base ();
+ for(CORBA::ULong i = 0; i < mblen; i++)
+ {
+ event[0].data.payload[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ supplier->consumer_proxy ()->push(event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ACE_DEBUG ((LM_DEBUG, "(%t) supplier push event\n"));
+
+ ACE_OS::sleep (tv);
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+ECMS_Driver::connect_suppliers (RtecEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "supplier_%02d", i);
+
+ ACE_NEW (this->suppliers_[i], Test_Supplier (this));
+
+ this->suppliers_[i]->connect (buf,
+ this->event_a_,
+ this->event_b_,
+ channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECMS_Driver::activate_suppliers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->activate ();
+ }
+}
+
+void
+ECMS_Driver::disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+int
+ECMS_Driver::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "ds:n:t:h:p:b:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 's':
+ this->n_suppliers_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'n':
+ this->event_count_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 't':
+ this->event_period_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'b':
+ this->event_size_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'h':
+ {
+ char* aux;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->event_a_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->event_b_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'p':
+ this->pid_file_name_ = get_opt.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[ORB options] "
+ "-s <nsuppliers> "
+ "-n <event count> "
+ "-t <event period (usecs)> "
+ "-h <eventa,eventb> "
+ "-p <pid file name> "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->event_count_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: event count (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->event_count_,
+ 100));
+ this->event_count_ = 100;
+ }
+
+ if (this->event_size_ < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: event size (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->event_size_,
+ 32));
+ this->event_count_ = 32;
+ }
+
+ if (this->n_suppliers_ <= 0)
+ {
+ this->n_suppliers_ = 1;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: number of suppliers out of range, "
+ "reset to default (%d)\n",
+ argv[0], 1), -1);
+ }
+
+ return 0;
+}
+
+Test_Supplier::Test_Supplier (ECMS_Driver *driver)
+ : driver_ (driver),
+ supplier_ (this)
+{
+}
+
+void
+Test_Supplier::connect (const char* name,
+ int event_a,
+ int event_b,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_id_ = ACE::crc32 (name);
+ ACE_DEBUG ((LM_DEBUG,
+ "ID for <%s> is %04.4x\n",
+ name,
+ this->supplier_id_));
+
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (this->supplier_id_,
+ event_a,
+ 0, 1);
+ qos.insert (this->supplier_id_,
+ event_b,
+ 0, 1);
+ qos.insert (this->supplier_id_,
+ ACE_ES_EVENT_SHUTDOWN,
+ 0, 1);
+
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushSupplier_var objref =
+ this->supplier_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_->connect_push_supplier (objref.in (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy =
+ this->consumer_proxy_._retn ();
+
+ ACE_TRY
+ {
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ // Ignore, the EC can shutdown before we get a chance to
+ // disconnect
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ // Ignore, the EC can shutdown before we get a chance to
+ // disconnect
+ }
+ ACE_CATCHANY
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+int
+Test_Supplier::svc ()
+{
+ return this->driver_->supplier_task (this, this->cookie_);
+}
+
+void
+Test_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+int Test_Supplier::supplier_id (void) const
+{
+ return this->supplier_id_;
+}
+
+RtecEventChannelAdmin::ProxyPushConsumer_ptr
+Test_Supplier::consumer_proxy (void)
+{
+ return this->consumer_proxy_.in ();
+}
+
+int
+main (int argc, char *argv [])
+{
+ ECMS_Driver driver;
+ return driver.run (argc, argv);
+}
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.h b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.h
new file mode 100644
index 00000000000..10b3adb9270
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.h
@@ -0,0 +1,145 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// An example on custom marshaling in TAO.
+//
+// ============================================================================
+
+#ifndef ECM_SUPPLIER_H
+#define ECM_SUPPLIER_H
+
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Channel_Clients_T.h"
+
+class ECMS_Driver;
+
+class Test_Supplier : public ACE_Task<ACE_SYNCH>
+{
+ //
+ // = TITLE
+ // Simplifies the supplier task startup.
+ //
+ // = DESCRIPTION
+ // Runs the ECMS_Driver::supplier_task() method in another thread.
+ //
+public:
+ Test_Supplier (ECMS_Driver *driver);
+
+ int svc (void);
+ // Run the test, just forwards to the driver
+
+ void connect (const char* name,
+ int event_a,
+ int event_b,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // This method connects the supplier to the EC.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The methods in the skeleton.
+
+ RtecEventComm::EventSourceID supplier_id (void) const;
+ // The supplier ID.
+
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer_proxy (void);
+ // We talk to the EC (as a supplier) using this proxy, no duplicates
+ // are done here...
+
+private:
+ ECMS_Driver *driver_;
+ // Class we forward to.
+
+ void *cookie_;
+ // The test provide us a cookie so we can give back our identity.
+
+ RtecEventComm::EventSourceID supplier_id_;
+ // We generate an id based on the name....
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+ // We talk to the EC (as a supplier) using this proxy.
+
+ ACE_PushSupplier_Adapter<Test_Supplier> supplier_;
+ // We also connect to the EC as a consumer so we can receive the
+ // timeout events.
+};
+
+class ECMS_Driver
+{
+ //
+ // = TITLE
+ //
+ // = DESCRIPTION
+ //
+public:
+ ECMS_Driver (void);
+
+ enum {
+ MAX_SUPPLIERS = 16
+ // Maximum number of suppliers.
+ };
+
+ int run (int argc, char* argv[]);
+ // Execute the test.
+
+ int supplier_task (Test_Supplier *supplier,
+ void *supplier_cookie);
+ // This method is run by the supplier task.
+
+ void push_supplier (void* supplier_cookie,
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer,
+ const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Callback method for suppliers, we push for them to their
+ // consumers and take statistics on the way.
+ // It is possible that we ignore the <consumer> parameter when
+ // testing the short-circuit case.
+
+private:
+ int parse_args (int argc, char* argv[]);
+ // parse the command line args
+
+ void connect_suppliers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect the suppliers.
+
+ void activate_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // Activate the suppliers, i.e. they start generating events.
+
+private:
+ Test_Supplier* suppliers_[ECMS_Driver::MAX_SUPPLIERS];
+ // The suppliers array.
+
+ int n_suppliers_;
+ // The number of suppliers.
+
+ int event_count_;
+ // How many messages we will send in each suppliers.
+
+ int event_period_;
+ // The time between each event generation, in microseconds.
+
+ int event_size_;
+ // The event size (number of elements in the payload).
+
+ int event_a_;
+ int event_b_;
+ // We send two types of events, with different contents.
+
+ const char* pid_file_name_;
+ // The name of a file where the process stores its pid
+};
+
+#endif /* ECM_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/EC_Custom_Marshal.mpc b/TAO/orbsvcs/tests/EC_Custom_Marshal/EC_Custom_Marshal.mpc
new file mode 100644
index 00000000000..a73bce90105
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/EC_Custom_Marshal.mpc
@@ -0,0 +1,39 @@
+// -*- MPC -*-
+// $Id$
+
+project(*IDL): rteventexe, rtsched, naming, iortable, messaging {
+
+ IDL_Files {
+ data.idl
+ }
+
+ custom_only = 1
+}
+
+project(ECM Supplier): rteventexe, rtsched, naming, iortable, messaging {
+ avoids += ace_for_tao
+ exename = ECM_Supplier
+ Source_Files {
+ ECM_Data.cpp
+ ECM_Supplier.cpp
+ dataS.cpp
+ dataC.cpp
+ }
+
+ after += *IDL
+ IDL_Files {
+ }
+}
+
+project(ECM Consumer): rteventexe, rtsched, naming, iortable, messaging {
+ exename = ECM_Consumer
+ Source_Files {
+ ECM_Data.cpp
+ ECM_Consumer.cpp
+ dataC.cpp
+ }
+
+ after += *IDL
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/Makefile.am b/TAO/orbsvcs/tests/EC_Custom_Marshal/Makefile.am
new file mode 100644
index 00000000000..6dee1408491
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/Makefile.am
@@ -0,0 +1,147 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.EC_Custom_Marshal_IDL.am
+
+if BUILD_CORBA_MESSAGING
+
+BUILT_SOURCES = \
+ dataC.cpp \
+ dataC.h \
+ dataC.inl \
+ dataS.cpp \
+ dataS.h \
+ dataS.inl \
+ dataS_T.cpp \
+ dataS_T.h \
+ dataS_T.inl
+
+CLEANFILES = \
+ data-stamp \
+ dataC.cpp \
+ dataC.h \
+ dataC.inl \
+ dataS.cpp \
+ dataS.h \
+ dataS.inl \
+ dataS_T.cpp \
+ dataS_T.h \
+ dataS_T.inl
+
+dataC.cpp dataC.h dataC.inl dataS.cpp dataS.h dataS.inl dataS_T.cpp dataS_T.h dataS_T.inl: data-stamp
+
+data-stamp: $(srcdir)/data.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/data.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ data.idl
+
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.ECM_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+
+noinst_PROGRAMS += ECM_Consumer
+
+ECM_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ECM_Consumer_SOURCES = \
+ ECM_Consumer.cpp \
+ ECM_Data.cpp \
+ dataC.cpp \
+ ECM_Consumer.h \
+ ECM_Data.h
+
+ECM_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.ECM_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ECM_Supplier
+
+ECM_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ECM_Supplier_SOURCES = \
+ ECM_Data.cpp \
+ ECM_Supplier.cpp \
+ dataC.cpp \
+ dataS.cpp \
+ ECM_Data.h \
+ ECM_Supplier.h
+
+ECM_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/README b/TAO/orbsvcs/tests/EC_Custom_Marshal/README
new file mode 100644
index 00000000000..d7001b8a7d3
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/README
@@ -0,0 +1,19 @@
+# $Id$
+
+ This example shows how to do custom marshaling of IDL and
+non-IDL data structures in TAO, store the resulting CDR stream in an
+octet sequence, send it to a remove server and then demarshal it.
+ The example emphasize the use of efficient, non-copy
+mechanisms to achieve those goals.
+
+To run this test just start the Naming_Service, the Event_Service and then
+start
+
+$ ./ECM_Consumer
+
+and after that
+
+$ ./ECM_Supplier
+
+you can vary the size of the payload (the number of elements in arrays
+and sequences) using the -b option to the ECM_Supplier program.
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/data.idl b/TAO/orbsvcs/tests/EC_Custom_Marshal/data.idl
new file mode 100644
index 00000000000..871ff05f9df
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/data.idl
@@ -0,0 +1,21 @@
+//
+// $Id$
+//
+
+module ECM_IDLData
+{
+ // Some simple data types to show how the Events can carry its
+ // payload in the octet sequence.
+
+ struct Point {
+ double x;
+ double y;
+ };
+ typedef sequence<Point> Vector;
+
+ struct Info {
+ string mobile_name;
+ double mobile_speed;
+ Vector trajectory;
+ };
+};
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl b/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl
new file mode 100755
index 00000000000..a44a114b388
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$port = PerlACE::uniqueid () + 10001; # This can't be 10000 on Chorus 4.0
+
+$NS_ior = PerlACE::LocalFile ("NameService.ior");
+$sleeptime = 8;
+$status = 0;
+
+$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service",
+ "-ORBNameServicePort $port -o $NS_ior");
+$ES = new PerlACE::Process ("../../Event_Service/Event_Service",
+ "-ORBInitRef NameService=file://$NS_ior");
+$C = new PerlACE::Process ("ECM_Consumer",
+ "-ORBInitRef NameService=file://$NS_ior");
+$S = new PerlACE::Process ("ECM_Supplier",
+ "-ORBInitRef NameService=file://$NS_ior");
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($NS_ior, 10) == -1) {
+ print STDERR "ERROR: waiting for naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$ES->Spawn ();
+
+sleep $sleeptime;
+
+$C->Spawn ();
+
+sleep $sleeptime;
+
+$S->Spawn ();
+
+$consumer = $C->WaitKill (60);
+
+if ($consumer != 0) {
+ print STDERR "ERROR: consumer returned $consumer\n";
+ $status = 1;
+}
+
+$supplier = $S->WaitKill (60);
+
+if ($supplier == -1) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: nameserver returned $nserver\n";
+ $status = 1;
+}
+
+$eserver = $ES->TerminateWaitKill (5);
+
+if ($eserver != 0) {
+ print STDERR "ERROR: eventserver returned $eserver\n";
+ $status = 1;
+}
+
+unlink $NS_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/svc.conf b/TAO/orbsvcs/tests/EC_Custom_Marshal/svc.conf
new file mode 100644
index 00000000000..527d5e23bf6
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/svc.conf
@@ -0,0 +1,4 @@
+#
+# $Id$
+#
+static Resource_Factory "-ORBDropRepliesDuringShutdown 0"
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp
new file mode 100644
index 00000000000..50ea5a9002b
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.cpp
@@ -0,0 +1,22 @@
+// $Id$
+// Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+
+#include "AddrServer.h"
+
+ACE_RCSID(EC_MT_Mcast,
+ AddrServer,
+ "$Id$")
+
+AddrServer::AddrServer (const RtecUDPAdmin::UDP_Addr& addr)
+ : addr_ (addr)
+{
+}
+
+void
+AddrServer::get_addr (const RtecEventComm::EventHeader&,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ addr = this->addr_;
+}
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h
new file mode 100644
index 00000000000..232f63a5071
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/AddrServer.h
@@ -0,0 +1,40 @@
+// $Id$
+// Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+
+#ifndef ADDRSERVER_H
+#define ADDRSERVER_H
+#include /**/ "ace/pre.h"
+
+#include "orbsvcs/RtecUDPAdminS.h"
+
+class AddrServer : public POA_RtecUDPAdmin::AddrServer
+{
+ // = TITLE
+ // A simple AddrServer
+ //
+ // = DESCRIPTION
+ // The EC is able to use multiple multicast groups to transmit its
+ // data, the is given control over the mapping between the Event
+ // (type,source) pair and the (ipaddr,port) pair using a
+ // AddrServer.
+ // This class implements a very simple server that simply maps the
+ // <type> component to the <ipaddr> and uses a fixed <port>,
+ // provided at initialization time.
+ //
+public:
+ AddrServer (const RtecUDPAdmin::UDP_Addr& addr);
+ // Constructor
+
+ // = The RtecUDPAdmin::AddrServer methods
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr_out addr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ RtecUDPAdmin::UDP_Addr addr_;
+ // The address
+};
+
+#include /**/ "ace/post.h"
+#endif /* ADDRSERVER_H */
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.cpp
new file mode 100644
index 00000000000..2ec6c650a2c
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.cpp
@@ -0,0 +1,105 @@
+// $Id$
+// Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+
+#include "Consumer.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+ACE_RCSID(EC_MT_Mcast,
+ Consumer,
+ "$Id$")
+
+Consumer::Consumer (void)
+ : event_count_ (0)
+{
+}
+
+void
+Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+{
+ this->proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushConsumer_var me =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Simple subscription, but usually the helper classes in
+ // $TAO_ROOT/orbsvcs/Event_Utils.h are a better way to do this.
+ RtecEventChannelAdmin::ConsumerQOS qos;
+ qos.is_gateway = 0;
+
+ qos.dependencies.length (2);
+ RtecEventComm::EventHeader& h0 =
+ qos.dependencies[0].event.header;
+ h0.type = ACE_ES_DISJUNCTION_DESIGNATOR;
+ h0.source = 1; // The disjunction has one element
+
+ RtecEventComm::EventHeader& h1 =
+ qos.dependencies[1].event.header;
+ h1.type = ACE_ES_EVENT_UNDEFINED; // first free event type
+ h1.source = ACE_ES_EVENT_SOURCE_ANY; // Any source is OK
+
+ this->proxy_->connect_push_consumer (me.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Disconnect from the proxy
+ this->proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // Ignore exceptions
+ }
+ ACE_ENDTRY;
+ this->proxy_ = RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+
+ // Deactivate this object
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ // Get the Object Id used for the servant..
+ PortableServer::ObjectId_var oid =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ // Deactivate the object
+ poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (events.length () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Consumer (%P|%t) no events\n"));
+ return;
+ }
+
+ this->event_count_ += events.length ();
+ if (this->event_count_ % 10000 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Consumer (%P|%t): %d events received\n",
+ this->event_count_));
+ }
+}
+
+void
+Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.h b/TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.h
new file mode 100644
index 00000000000..1e1d9fdaa17
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/Consumer.h
@@ -0,0 +1,51 @@
+// $Id$
+// Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+
+#ifndef CONSUMER_H
+#define CONSUMER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Consumer : public POA_RtecEventComm::PushConsumer
+{
+ // = TITLE
+ // Simple consumer object
+ //
+ // = DESCRIPTION
+ // This class is a consumer of events.
+ // It simply subscribes to one event type.
+ //
+public:
+ Consumer (void);
+ // Constructor
+
+ void connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL);
+ // Connect to the Event Channel
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the event channel
+
+ // = The RtecEventComm::PushConsumer methods
+
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+private:
+ CORBA::ULong event_count_;
+ // Keep track of the number of events received.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy_;
+ // The proxy
+};
+
+#endif /* CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/EC_MT_Mcast.mpc b/TAO/orbsvcs/tests/EC_MT_Mcast/EC_MT_Mcast.mpc
new file mode 100644
index 00000000000..73788961680
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/EC_MT_Mcast.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(EC_MT_Mcast): rteventexe, rtevent_serv, messaging, strategies {
+ exename = MCast
+}
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp
new file mode 100644
index 00000000000..5441a632e0e
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/MCast.cpp
@@ -0,0 +1,424 @@
+// $Id$
+// Adapted from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+
+#include "Consumer.h"
+#include "Supplier.h"
+#include "AddrServer.h"
+#include "orbsvcs/Event_Service_Constants.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 "tao/Strategies/advanced_resource.h"
+#include "tao/ORB_Core.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_MT_Mcast,
+ MCast,
+ "$Id$")
+
+const char *udp_mcast_address =
+ ACE_DEFAULT_MULTICAST_ADDR ":10001";
+
+static CORBA::ORB_var orb = CORBA::ORB::_nil ();
+static bool terminate_threads = false;
+static const unsigned pool_size = 2;
+static const int data_items = 60000;
+
+void *
+run_orb_within_thread (void *)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ while (! terminate_threads)
+ {
+ ACE_TRY
+ {
+ CORBA::Boolean there_is_work =
+ orb->work_pending (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (there_is_work)
+ {
+ // We use a TAO extension. The CORBA mechanism does not
+ // provide any decent way to control the duration of
+ // perform_work() or work_pending(), so just calling
+ // them results in a spin loop.
+ ACE_Time_Value tv (0, 50000);
+ orb->perform_work (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "perform work");
+
+ return 0;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (0);
+ }
+
+ return 0;
+}
+
+int parse_args (int argc, char *argv[]);
+
+int
+main (int argc, char* argv[])
+{
+ // Register the default factory in the Service Configurator.
+ // If your platform supports static constructors then you can
+ // simply using the ACE_STATIC_SVC_DEFINE() macro, unfortunately TAO
+ // must run on platforms where static constructors do not work well,
+ // so we have to explicitly invoke this function.
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // **************** HERE IS THE ORB SETUP
+
+ // Create the ORB, pass the argv list for parsing.
+ orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse the arguments, you usually want to do this after
+ // invoking ORB_init() because ORB_init() will remove all the
+ // -ORB options from the command line.
+ if (parse_args (argc, argv) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Usage: Service [-m udp_mcast_addr]\n"));
+ return 1;
+ }
+
+ // This is the standard code to get access to the POA and
+ // activate it.
+ // The POA starts in the holding state, if it is not activated
+ // it will not process any requests.
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // **************** THAT COMPLETES THE ORB SETUP
+
+ // **************** HERE IS THE LOCAL EVENT CHANNEL SETUP
+
+ // This structure is used to define the startup time event
+ // channel configuration.
+ // This structure is described in
+ //
+ // $TAO_ROOT/docs/ec_options.html
+ //
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+
+ // Create the Event Channel implementation class
+ TAO_EC_Event_Channel ec_impl (attributes);
+
+ // Activate the Event Channel, depending on the configuration
+ // that may involve creating some threads.
+ // But it should always be invoked because several internal data
+ // structures are initialized at that point.
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The event channel is activated as any other CORBA servant.
+ // In this case we use the simple implicit activation with the
+ // RootPOA
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // **************** THAT COMPLETES THE LOCAL EVENT CHANNEL SETUP
+
+ // **************** HERE IS THE FEDERATION SETUP
+
+ // The next step is to setup the multicast gateways.
+ // There are two gateways involved, one sends the locally
+ // generated events to the federated peers, the second gateway
+ // receives multicast traffic and turns it into local events.
+
+ // The sender requires a helper object to select what
+ // multicast group will carry what traffic, this is the
+ // so-called 'Address Server'.
+ // The intention is that advanced applications can use different
+ // multicast groups for different events, this can exploit
+ // network interfaces that filter unwanted multicast traffic.
+ // The helper object is accessed through an IDL interface, so it
+ // can reside remotely.
+ // In this example, and in many application, using a fixed
+ // multicast group is enough, and a local address server is the
+ // right approach.
+
+ // First we convert the string into an INET address, then we
+ // convert that into the right IDL structure:
+ ACE_INET_Addr udp_addr (udp_mcast_address);
+ ACE_DEBUG ((LM_DEBUG,
+ "Multicast address is: %s\n",
+ udp_mcast_address));
+ RtecUDPAdmin::UDP_Addr addr;
+ addr.ipaddr = udp_addr.get_ip_address ();
+ addr.port = udp_addr.get_port_number ();
+
+ // Now we create and activate the servant
+ AddrServer as_impl (addr);
+ RtecUDPAdmin::AddrServer_var address_server =
+ as_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We need a local socket to send the data, open it and check
+ // that everything is OK:
+ TAO_ECG_UDP_Out_Endpoint* endpointptr = 0;
+
+ ACE_NEW_RETURN (endpointptr, TAO_ECG_UDP_Out_Endpoint, 0);
+
+ TAO_ECG_Refcounted_Endpoint endpoint (endpointptr);
+ if (endpoint->dgram ().open (ACE_Addr::sap_any) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Cannot open send endpoint\n"),
+ 1);
+ }
+
+ // Now we setup the sender:
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender;
+ sender = TAO_ECG_UDP_Sender::create();
+
+ sender->init (event_channel.in (),
+ address_server.in (),
+ endpoint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Now we connect the sender as a consumer of events, it will
+ // receive any event from any source and send it to the "right"
+ // multicast group, as defined by the address server set above:
+ RtecEventChannelAdmin::ConsumerQOS sub;
+ sub.is_gateway = 1;
+
+ sub.dependencies.length (1);
+ sub.dependencies[0].event.header.type =
+ ACE_ES_EVENT_ANY; // first free event type
+ sub.dependencies[0].event.header.source =
+ ACE_ES_EVENT_SOURCE_ANY; // Any source is OK
+
+ sender->connect (sub ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // To receive events we need to setup an event handler:
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver;
+ receiver = TAO_ECG_UDP_Receiver::create();
+
+ TAO_ECG_Mcast_EH mcast_eh (&*receiver);
+
+ // The event handler uses the ORB reactor to wait for multicast
+ // traffic:
+ mcast_eh.reactor (orb->orb_core ()->reactor ());
+
+ // The multicast Event Handler needs to know to what multicast
+ // groups it should listen to. To do so it becomes an observer
+ // with the event channel, to determine the list of events
+ // required by all the local consumer.
+ // Then it register for the multicast groups that carry those
+ // events:
+ mcast_eh.open (event_channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Again the receiver connects to the event channel as a
+ // supplier of events, using the Observer features to detect
+ // local consumers and their interests:
+ receiver->init (event_channel.in (),
+ endpoint,
+ address_server.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The Receiver is also a supplier of events. The exact type of
+ // events is only known to the application, because it depends
+ // on the traffic carried by all the multicast groups that the
+ // different event handlers subscribe to.
+ // In this example we choose to simply describe our publications
+ // using wilcards, any event from any source. More advanced
+ // application could use the Observer features in the event
+ // channel to update this information (and reduce the number of
+ // multicast groups that each receive subscribes to).
+ // In a future version the event channel could perform some of
+ // those tasks automatically
+ RtecEventChannelAdmin::SupplierQOS pub;
+ pub.publications.length (1);
+ pub.publications[0].event.header.type = ACE_ES_EVENT_ANY;
+ pub.publications[0].event.header.source = ACE_ES_EVENT_SOURCE_ANY;
+ pub.is_gateway = 1;
+
+ receiver->connect (pub ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // **************** THAT COMPLETES THE FEDERATION SETUP
+
+ // **************** HERE IS THE CLIENT SETUP
+
+ // First let us create consumers and connect them to the event
+ // channel
+ Consumer consumer1;
+ Consumer consumer2;
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer1.connect (consumer_admin.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer2.connect (consumer_admin.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // And now create a supplier
+ Supplier supplier;
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier.connect (supplier_admin.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // **************** THAT COMPLETES THE CLIENT SETUP
+
+ // **************** HERE IS THE EVENT LOOP
+
+ // creating thread pool
+ ACE_Thread_Manager the_ace_manager;
+ the_ace_manager.open ();
+ int thread_pool_id = the_ace_manager.spawn_n (
+ pool_size, ACE_THR_FUNC (run_orb_within_thread), 0, THR_DETACHED | THR_NEW_LWP);
+ if (thread_pool_id == -1) {
+ ACE_ERROR_RETURN ((LM_ERROR, "Cannot spawn thread pool\n"), 1);
+ }
+ ACE_OS::sleep (1); // simple solution ensures ready thread pool
+
+ for (int i = 0; i < data_items; i++)
+ {
+ supplier.perform_push (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_OS::sleep (2); // simple solution ensures ready receivers
+ terminate_threads = true; // terminate thread pool
+
+ the_ace_manager.wait(); // wait until all threads in the pool are stopped
+
+ the_ace_manager.close ();
+
+ // **************** THAT COMPLETES THE EVENT LOOP
+
+ // **************** HERE IS THE CLEANUP CODE
+
+ // First the easy ones
+ supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer2.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Now let us disconnect the Receiver
+ receiver->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int r = mcast_eh.shutdown ();
+
+ if (r == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Closing MCast event handler\n"), 1);
+ }
+
+ // And also disconnect the sender of events
+ sender->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // The event channel must be destroyed, so it can release its
+ // resources, and inform all the clients that are still
+ // connected that it is going away.
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Deactivating the event channel implementation is not strictly
+ // required, the POA will do it for us, but it is good manners:
+ {
+ // Using _this() activates with the default POA, we must gain
+ // access to that POA to deactivate the object.
+ // Notice that we 'know' that the default POA for this servant
+ // is the root POA, but the code is more robust if we don't
+ // rely on that.
+ PortableServer::POA_var poa =
+ ec_impl._default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // Get the Object Id used for the servant..
+ PortableServer::ObjectId_var oid =
+ poa->servant_to_id (&ec_impl ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // Deactivate the object
+ poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Now we can destroy the POA, the flags mean that we want to
+ // wait until the POA is really destroyed
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Finally destroy the ORB
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // **************** THAT COMPLETES THE CLEANUP CODE
+
+ ACE_DEBUG ((LM_DEBUG,
+ "MCast example finished\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+int parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "m:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'm':
+ udp_mcast_address = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "[-m udp_mcast_address]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/Makefile.am b/TAO/orbsvcs/tests/EC_MT_Mcast/Makefile.am
new file mode 100644
index 00000000000..550d53a525c
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/Makefile.am
@@ -0,0 +1,65 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.EC_MT_Mcast.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS = MCast
+
+MCast_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+MCast_SOURCES = \
+ AddrServer.cpp \
+ Consumer.cpp \
+ MCast.cpp \
+ Supplier.cpp \
+ AddrServer.h \
+ Consumer.h \
+ Supplier.h
+
+MCast_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/README b/TAO/orbsvcs/tests/EC_MT_Mcast/README
new file mode 100644
index 00000000000..561d0e39cae
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/README
@@ -0,0 +1,13 @@
+# $Id$
+
+ This directory contains a regression test for a thread safety problem
+ in the TAO_ECG_UDP_Receiver class.
+ The code is a copy of
+ $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+ with only minor modifications.
+ For further details, see the README there.
+
+ The crash will only show up when running multiple MCast processes.
+ Therefore, it is easiest use the run_test.pl script to invoke this
+ test.
+
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.cpp b/TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.cpp
new file mode 100644
index 00000000000..0060bd58ed5
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.cpp
@@ -0,0 +1,95 @@
+// $Id$
+// Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+
+#include "Supplier.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+ACE_RCSID(EC_MT_Mcast,
+ Supplier,
+ "$Id$")
+
+Supplier::Supplier (void)
+{
+}
+
+void
+Supplier::connect (RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL)
+{
+ this->proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushSupplier_var me =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Simple publication, but usually the helper classes in
+ // $TAO_ROOT/orbsvcs/Event_Utils.h are a better way to do this.
+ RtecEventChannelAdmin::SupplierQOS qos;
+ qos.is_gateway = 0;
+
+ qos.publications.length (1);
+ RtecEventComm::EventHeader& h0 =
+ qos.publications[0].event.header;
+ h0.type = ACE_ES_EVENT_UNDEFINED; // first free event type
+ h0.source = 1; // first free event source
+
+ this->proxy_->connect_push_supplier (me.in (), qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Disconnect from the EC
+ ACE_TRY
+ {
+ this->proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier::perform_push (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // The event type and source must match our publications
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.type = ACE_ES_EVENT_UNDEFINED;
+ event[0].header.source = 1;
+ // Avoid loops throught the event channel federations
+ event[0].header.ttl = 1;
+
+ this->proxy_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+}
+
+void
+Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.h b/TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.h
new file mode 100644
index 00000000000..8f9f50f2a87
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/Supplier.h
@@ -0,0 +1,49 @@
+// $Id$
+// Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
+
+#ifndef SUPPLIER_H
+#define SUPPLIER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Supplier : public POA_RtecEventComm::PushSupplier
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ // This class is a supplier of events.
+ // It simply publishes one event type, when the perform_push()
+ // method is invoked it pushes the event through the event service
+ //
+public:
+ Supplier (void);
+ // Constructor
+
+ void connect (RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL);
+ // Connect to the event channel
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the event channel
+
+ void perform_push (ACE_ENV_SINGLE_ARG_DECL);
+ // Push a single event
+
+ // = The RtecEventComm::PushSupplier methods
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+private:
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy_;
+ // The proxy
+};
+
+#endif /* SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/run_test.pl b/TAO/orbsvcs/tests/EC_MT_Mcast/run_test.pl
new file mode 100755
index 00000000000..0ccaf9b3f72
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$svc_conf = PerlACE::LocalFile ("svc$PerlACE::svcconf_ext");
+
+$mcast_address = (int(rand(16)) + 224) . '.' . int(rand(256)) . '.' .
+ int(rand(256)) . '.' . int(rand(256)) . ':' .
+ (10001 + PerlACE::uniqueid());
+
+# Run two copies of the same test...
+$T1 = new PerlACE::Process ("MCast",
+ "-m $mcast_address -ORBSvcConf $svc_conf");
+$T2 = new PerlACE::Process ("MCast",
+ "-m $mcast_address -ORBSvcConf $svc_conf");
+
+$sp1 = $T1->Spawn ();
+
+if ($sp1 != 0) {
+ print STDERR "ERROR: could not spawn MCast, returned $sp1\n";
+ exit 1;
+}
+
+@sp2 = $T2->Spawn ();
+
+if ($sp2 != 0) {
+ print STDERR "ERROR: could not spawn MCast, returned $sp2\n";
+ $T1->Kill ();
+ exit 1;
+}
+
+$test1 = $T1->WaitKill (300);
+
+if ($test1 != 0) {
+ print STDERR "ERROR: test 1 returned $test1\n";
+ $status = 1;
+}
+
+$test2 = $T2->WaitKill (30);
+
+if ($test2 != 0) {
+ print STDERR "ERROR: test 2 returned $test2\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/EC_MT_Mcast/svc.conf b/TAO/orbsvcs/tests/EC_MT_Mcast/svc.conf
new file mode 100644
index 00000000000..c6fce32e1bc
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_MT_Mcast/svc.conf
@@ -0,0 +1,5 @@
+# $Id$
+static EC_Factory "-ECObserver basic -ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECDispatching reactive -ECScheduling null -ECFiltering prefix -ECSupplierFiltering per-supplier"
+static Client_Strategy_Factory "-ORBProfileLock thread -ORBClientConnectionHandler MT"
+static Server_Strategy_Factory "-ORBConcurrency reactive -ORBPOALock thread"
+static Advanced_Resource_Factory "-ORBReactorType tp -ORBInputCDRAllocator thread -ORBConnectionCacheLock thread"
diff --git a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp
new file mode 100644
index 00000000000..1fcb246b5ea
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp
@@ -0,0 +1,1159 @@
+// $Id$
+
+#include "EC_Mcast.h"
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_sys_time.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/os_include/os_ctype.h"
+
+#if !defined (__ACE_INLINE__)
+#include "EC_Mcast.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (EC_Mcast,
+ EC_Mcast,
+ "$Id$")
+
+ECM_Driver::ECM_Driver (void)
+ : event_period_ (250000),
+ event_count_ (100),
+ config_filename_ (0),
+ pid_filename_ (0),
+ local_federations_count_ (0),
+ all_federations_count_ (0)
+{
+}
+
+int
+ECM_Driver::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ if (this->parse_config_file ())
+ return 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " event period = <%d> (usecs)\n"
+ " event count = <%d>\n"
+ " config file name = <%s>\n"
+ " pid file name = <%s>\n",
+
+ this->event_period_,
+ this->event_count_,
+
+ this->config_filename_?this->config_filename_:"nil",
+ this->pid_filename_?this->pid_filename_:"nil") );
+
+ int i;
+ for (i = 0; i < this->local_federations_count_; ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ " name = <%s>\n"
+ " port = <%d>\n"
+ " supplier types:\n",
+ this->local_federations_[i]->name ()?this->local_federations_[i]->name ():"nil",
+ this->local_federations_[i]->mcast_port ()));
+ int j;
+ for (j = 0;
+ j < this->local_federations_[i]->supplier_types ();
+ ++j)
+ {
+
+ ACE_DEBUG ((LM_DEBUG,
+ " name = <%s>\n"
+ " ipadd = <%x>\n",
+ this->local_federations_[i]->supplier_name (j),
+ this->local_federations_[i]->supplier_ipaddr (j)));
+ }
+ ACE_DEBUG ((LM_DEBUG,
+ " consumer types:\n"));
+ for (j = 0;
+ j < this->local_federations_[i]->consumer_types ();
+ ++j)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ " name = <%s>\n"
+ " ipadd = <%x>\n",
+ this->local_federations_[i]->consumer_name (j),
+ this->local_federations_[i]->consumer_ipaddr (j)));
+ }
+ }
+
+ if (this->pid_filename_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_filename_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ TAO_EC_Event_Channel_Attributes attr (root_poa.in (),
+ root_poa.in ());
+ TAO_EC_Event_Channel ec_impl (attr);
+
+ // Register Event_Service with the Naming Service.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "The (local) EC IOR is <%s>\n", str.in ()));
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Mcast: local EC objref ready\n"));
+
+ this->open_federations (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Mcast: open_federations done\n"));
+
+ this->open_senders (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Mcast: open_senders done\n"));
+
+ this->open_receivers (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Mcast: open_receivers done\n"));
+
+ this->activate_federations (ec.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Mcast: activate_federations done\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Mcast: running the test\n"));
+ while (this->federations_running_ > 0)
+ this->orb_->perform_work ();
+
+ this->dump_results ();
+
+ this->close_receivers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->close_senders (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->close_federations (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Mcast: shutdown the EC\n"));
+
+ ec_impl.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+ECM_Driver::federation_has_shutdown (ECM_Local_Federation *federation
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_DEBUG ((LM_DEBUG, "Federation <%s> shuting down\n",
+ federation->name ()));
+ if (this->federations_running_ > 0)
+ this->federations_running_--;
+}
+
+void
+ECM_Driver::open_federations (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ for (int i = 0; i < this->local_federations_count_; ++i)
+ {
+ this->local_federations_[i]->open (this->event_count_,
+ ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECM_Driver::activate_federations (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->federations_running_ = this->local_federations_count_;
+ RtecEventComm::Time interval = this->event_period_;
+ interval *= 10;
+ for (int i = 0; i < this->local_federations_count_; ++i)
+ {
+ this->local_federations_[i]->activate (ec,
+ interval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECM_Driver::close_federations (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->local_federations_count_; ++i)
+ {
+ this->local_federations_[i]->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECM_Driver::open_senders (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ if (this->endpoint_.dgram ().open (ACE_Addr::sap_any) == -1)
+ {
+ // @@ TODO throw an application specific exception.
+ ACE_THROW (CORBA::COMM_FAILURE ());
+ }
+
+ ACE_INET_Addr ignore_from;
+ this->endpoint_.dgram ().get_local_addr (ignore_from);
+ ACE_DEBUG ((LM_DEBUG, "ECM_Driver::open_senders - "
+ "local endpoint = (%u:%d)\n",
+ ignore_from.get_ip_address (),
+ ignore_from.get_port_number ()));
+ for (int i = 0; i < this->all_federations_count_; ++i)
+ {
+ TAO_ECG_UDP_Out_Endpoint* clone;
+ ACE_NEW (clone,
+ TAO_ECG_UDP_Out_Endpoint (this->endpoint_));
+
+ this->all_federations_[i]->open (clone,
+ ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECM_Driver::close_senders (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->all_federations_count_; ++i)
+ {
+ this->all_federations_[i]->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ this->endpoint_.dgram ().close ();
+}
+
+void
+ECM_Driver::open_receivers (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ for (int i = 0; i < this->local_federations_count_; ++i)
+ {
+ TAO_ECG_Refcounted_Endpoint endpoint;
+ TAO_ECG_UDP_Out_Endpoint* clone = 0;
+ ACE_NEW (clone,
+ TAO_ECG_UDP_Out_Endpoint (this->endpoint_));
+ endpoint.reset (clone);
+
+ this->local_federations_[i]->open_receiver (ec,
+ endpoint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECM_Driver::close_receivers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->local_federations_count_; ++i)
+ {
+ this->local_federations_[i]->close_receiver (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECM_Driver::dump_results (void)
+{
+ for (int i = 0; i < this->local_federations_count_; ++i)
+ {
+ this->local_federations_[i]->dump_results ();
+ }
+}
+
+
+// ****************************************************************
+
+int
+ECM_Driver::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "l:p:c:n:t:f:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'p':
+ this->pid_filename_ = get_opt.opt_arg ();
+ break;
+
+ case 'c':
+ this->config_filename_ = get_opt.opt_arg ();
+ break;
+
+ case 't':
+ this->event_period_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'n':
+ this->event_count_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'f':
+ {
+ char* aux;
+ int i = 0;
+ for (char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+ arg != 0 && i < ECM_Driver::MAX_LOCAL_FEDERATIONS;
+ arg = ACE_OS::strtok_r (0, ",", &aux), ++i)
+ {
+ this->local_names_[i] = arg;
+ }
+ this->local_federations_count_ = i;
+ }
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[ORB options] "
+ "-n <event_count> "
+ "-t <event_period> "
+ "-l <localname> "
+ "-p <pid file name> "
+ "-c <config file name> "
+ "-f federation,federation,... "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->event_count_ < 0
+ || this->event_count_ >= ECM_Driver::MAX_EVENTS)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: event count (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->event_count_,
+ 100));
+ this->event_count_ = 100;
+ }
+
+ return 0;
+}
+
+int
+ECM_Driver::parse_config_file (void)
+{
+ FILE* cfg = 0;
+ if (this->config_filename_ != 0)
+ cfg = ACE_OS::fopen (this->config_filename_, "r");
+ else
+ cfg = stdin;
+
+ if (cfg == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "cannot open config file <%s>\n",
+ this->config_filename_), -1);
+ }
+
+ int s = fscanf (cfg, "%d", &this->all_federations_count_);
+ if (s == 0 || s == EOF)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "problem reading federation count\n"), -1);
+ }
+ // ACE_DEBUG ((LM_DEBUG,
+ // "total federations = %d\n",
+ // this->all_federations_count_));
+ for (int i = 0; i < this->all_federations_count_; ++i)
+ {
+ if (this->skip_blanks (cfg, "reading federation name"))
+ return -1;
+ ACE_Read_Buffer reader(cfg);
+ char* buf = reader.read (' ', ' ', '\0');
+ char* name = CORBA::string_dup (buf);
+ reader.alloc()->free (buf);
+
+
+ int port;
+ if (this->skip_blanks (cfg, "reading federation port number"))
+ return -1;
+ fscanf (cfg, "%d", &port);
+ CORBA::UShort mcast_port = static_cast<CORBA::UShort> (port);
+
+ int ns, nc;
+ if (this->skip_blanks (cfg, "reading supplier count"))
+ return -1;
+ s = fscanf (cfg, "%d", &ns);
+ if (s == 0 || s == EOF)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "problem reading supplier count (%d)\n",
+ i), -1);
+ }
+ if (this->skip_blanks (cfg, "reading constumer count"))
+ return -1;
+ s = fscanf (cfg, "%d", &nc);
+ if (s == 0 || s == EOF)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "problem reading consumer count (%d)\n",
+ i), -1);
+ }
+ // ACE_DEBUG ((LM_DEBUG, "i = %d <%s> <%d> <%d> <%d>\n",
+ // i, name, mcast_port, ns, nc));
+
+ char** supplier_names;
+ char** consumer_names;
+ ACE_NEW_RETURN (supplier_names, char*[ns], -1);
+ ACE_NEW_RETURN (consumer_names, char*[nc], -1);
+
+ if (this->parse_name_list (cfg, ns, supplier_names,
+ "reading supplier list"))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "error parsing supplier list for <%s>\n",
+ name), -1);
+ }
+
+ if (this->parse_name_list (cfg, nc, consumer_names,
+ "reading consumer list"))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "error parsing consumer list for <%s>\n",
+ name), -1);
+ }
+
+ ACE_NEW_RETURN (this->all_federations_[i],
+ ECM_Federation (name, mcast_port,
+ ns, supplier_names,
+ nc, consumer_names), -1);
+ }
+ ACE_OS::fclose (cfg);
+
+ for (int j = 0; j < this->local_federations_count_; ++j)
+ {
+ int k = 0;
+ for (; k < this->all_federations_count_; ++k)
+ {
+ if (ACE_OS::strcmp (this->local_names_[j],
+ this->all_federations_[k]->name ()) == 0)
+ {
+ ACE_NEW_RETURN (this->local_federations_[j],
+ ECM_Local_Federation (this->all_federations_[k],
+ this),
+ -1);
+ break;
+ }
+ }
+ if (k == this->all_federations_count_)
+ ACE_ERROR ((LM_ERROR,
+ "Cannot find federations <%s>\n",
+ this->local_names_[j]));
+ }
+
+ return 0;
+}
+
+int
+ECM_Driver::parse_name_list (FILE* file,
+ int n,
+ char** names,
+ const char* error_msg)
+{
+ for (int i = 0; i < n; ++i)
+ {
+ if (this->skip_blanks (file, error_msg))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "error on item %d while %s\n",
+ i, error_msg), -1);
+ }
+ ACE_Read_Buffer tmp(file);
+ char* buf = tmp.read ('\n', '\n', '\0');
+ names[i] = CORBA::string_dup (buf);
+ tmp.alloc ()->free (buf);
+ }
+ return 0;
+}
+
+int
+ECM_Driver::skip_blanks (FILE* file,
+ const char* error_msg)
+{
+ int c;
+ // Consume all the blanks.
+ while (isspace (c = fgetc (file)));
+ if (c == EOF)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unexpected EOF in config file while %s\n",
+ error_msg),
+ -1);
+ }
+ ungetc (c, file);
+ return 0;
+}
+// ****************************************************************
+
+ECM_Federation::ECM_Federation (char* name,
+ CORBA::UShort mcast_port,
+ int supplier_types,
+ char** supplier_names,
+ int consumer_types,
+ char** consumer_names)
+ : name_ (name),
+ mcast_port_ (mcast_port),
+ supplier_types_ (supplier_types),
+ supplier_names_ (supplier_names),
+ consumer_types_ (consumer_types),
+ consumer_names_ (consumer_names),
+ addr_server_ (mcast_port)
+{
+ sender_ = TAO_ECG_UDP_Sender::create (true);
+
+ ACE_NEW (this->supplier_ipaddr_, CORBA::ULong[this->supplier_types_]);
+ ACE_NEW (this->consumer_ipaddr_, CORBA::ULong[this->consumer_types_]);
+
+ int i;
+ for (i = 0; i < this->supplier_types_; ++i)
+ {
+ ACE_INET_Addr addr (u_short(0), this->supplier_names_[i]);
+ this->supplier_ipaddr_[i] = addr.get_ip_address ();
+ }
+ for (i = 0; i < this->consumer_types_; ++i)
+ {
+ ACE_INET_Addr addr (u_short(0), this->consumer_names_[i]);
+ this->consumer_ipaddr_[i] = addr.get_ip_address ();
+ }
+}
+
+ECM_Federation::~ECM_Federation (void)
+{
+ delete[] this->consumer_ipaddr_;
+ delete[] this->supplier_ipaddr_;
+}
+
+void
+ECM_Federation::open (TAO_ECG_UDP_Out_Endpoint *endpoint,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecUDPAdmin::AddrServer_var addr_server =
+ this->addr_server (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_ECG_Refcounted_Endpoint ref_endpoint (endpoint);
+
+ this->sender_->init (ec,
+ addr_server.in (),
+ ref_endpoint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // @@ TODO Make this a parameter....
+ this->sender_->mtu (64);
+
+ // The worst case execution time is far less than 2
+ // milliseconds, but that is a safe estimate....
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ for (int i = 0; i < this->consumer_types (); ++i)
+ {
+ qos.insert_type (this->consumer_ipaddr (i), 0);
+ }
+ RtecEventChannelAdmin::ConsumerQOS qos_copy = qos.get_ConsumerQOS ();
+ this->sender_->connect (qos_copy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+ECM_Federation::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->sender_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+RtecUDPAdmin::AddrServer_ptr
+ECM_Federation::addr_server (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->addr_server_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+// ****************************************************************
+
+ECM_Supplier::ECM_Supplier (ECM_Local_Federation* federation)
+ : federation_ (federation),
+ consumer_ (this)
+{
+}
+
+void
+ECM_Supplier::open (const char* name,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_id_ = ACE::crc32 (name);
+ ACE_DEBUG ((LM_DEBUG, "ID for <%s> is %04.4x\n", name,
+ this->supplier_id_));
+
+ ACE_SupplierQOS_Factory qos;
+ for (int i = 0; i < this->federation_->supplier_types (); ++i)
+ {
+ qos.insert (this->supplier_id_,
+ this->federation_->supplier_ipaddr (i),
+ 0, 1);
+ }
+ qos.insert (this->supplier_id_,
+ ACE_ES_EVENT_SHUTDOWN,
+ 0, 1);
+
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushSupplier_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_->connect_push_supplier (objref.in (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+ECM_Supplier::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ this->consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ = 0;
+}
+
+void
+ECM_Supplier::activate (RtecEventChannelAdmin::EventChannel_ptr ec,
+ RtecEventComm::Time interval
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ interval,
+ 0);
+
+ // = Connect as a consumer.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushConsumer_var cref =
+ this->consumer_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (cref.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+ECM_Supplier::supplier_id (void) const
+{
+ return this->supplier_id_;
+}
+
+void
+ECM_Supplier::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+{
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ const RtecEventComm::Event& e = events[i];
+ if (e.header.type != ACE_ES_EVENT_INTERVAL_TIMEOUT)
+ continue;
+
+ this->federation_->supplier_timeout (this->consumer_proxy_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECM_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+ECM_Supplier::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+// ****************************************************************
+
+ECM_Consumer::ECM_Consumer (ECM_Local_Federation *federation)
+ : federation_ (federation),
+ supplier_proxy_ (0),
+ consumer_admin_ (0)
+{
+}
+
+void
+ECM_Consumer::open (const char*,
+ RtecEventChannelAdmin::EventChannel_ptr ec,
+ ACE_RANDR_TYPE &seed
+ ACE_ENV_ARG_DECL)
+{
+ // The worst case execution time is far less than 2
+ // milliseconds, but that is a safe estimate....
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+
+ // = Connect as a consumer.
+ this->consumer_admin_ = ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (seed ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ECM_Consumer::connect (ACE_RANDR_TYPE &seed
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_admin_.in ()))
+ return;
+
+ this->supplier_proxy_ =
+ this->consumer_admin_->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ qos.insert_type (ACE_ES_EVENT_SHUTDOWN, 0);
+ const ECM_Federation* federation = this->federation_->federation ();
+ for (int i = 0; i < federation->consumer_types (); ++i)
+ {
+ unsigned int x = ACE_OS::rand_r (seed);
+ if (x < RAND_MAX / 2)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Federation %s leaves group %s\n",
+ federation->name (),
+ federation->consumer_name (i)));
+ this->federation_->subscribed_bit (i, 0);
+ continue;
+ }
+ ACE_DEBUG ((LM_DEBUG,
+ "Federation %s joins group %s\n",
+ federation->name (),
+ federation->consumer_name (i)));
+ this->federation_->subscribed_bit (i, 1);
+ qos.insert_type (federation->consumer_ipaddr (i), 0);
+ }
+
+ RtecEventComm::PushConsumer_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (objref.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+ECM_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ())
+ || CORBA::is_nil (this->consumer_admin_.in ()))
+ return;
+
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var tmp =
+ this->supplier_proxy_._retn ();
+ tmp->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+ECM_Consumer::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->consumer_admin_ =
+ RtecEventChannelAdmin::ConsumerAdmin::_nil ();
+ }
+ ACE_CATCHANY
+ {
+ this->consumer_admin_ =
+ RtecEventChannelAdmin::ConsumerAdmin::_nil ();
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+ECM_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t arrival = ACE_OS::gethrtime ();
+ this->federation_->consumer_push (arrival, events ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ECM_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+// ****************************************************************
+
+ECM_Local_Federation::ECM_Local_Federation (ECM_Federation *federation,
+ ECM_Driver *driver)
+ : federation_ (federation),
+ driver_ (driver),
+ consumer_ (this),
+ supplier_ (this),
+ recv_count_ (0),
+ unfiltered_count_ (0),
+ invalid_count_ (0),
+ send_count_ (0),
+ event_count_ (0),
+ last_publication_change_ (0),
+ last_subscription_change_ (0),
+ mcast_eh_ (0),
+ seed_ (0),
+ subscription_change_period_ (10000),
+ publication_change_period_ (10000)
+{
+ receiver_ = TAO_ECG_UDP_Receiver::create (true);
+
+ ACE_NEW (mcast_eh_, TAO_ECG_Mcast_EH((&*receiver_)));
+
+ ACE_NEW (this->subscription_subset_,
+ CORBA::Boolean[this->consumer_types ()]);
+}
+
+ECM_Local_Federation::~ECM_Local_Federation (void)
+{
+ delete mcast_eh_;
+ delete[] this->subscription_subset_;
+}
+
+void
+ECM_Local_Federation::open (int event_count,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->event_count_ = event_count;
+
+ const int bufsize = 512;
+ char buf[bufsize];
+ ACE_OS::strcpy (buf, this->federation_->name ());
+ ACE_OS::strcat (buf, "/supplier");
+
+ this->supplier_.open (buf, ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_OS::strcpy (buf, this->federation_->name ());
+ ACE_OS::strcat (buf, "/consumer");
+ this->consumer_.open (buf, ec, this->seed_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->last_subscription_change_ = ACE_OS::gettimeofday ();
+}
+
+void
+ECM_Local_Federation::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->consumer_.close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_.close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+ECM_Local_Federation::activate (RtecEventChannelAdmin::EventChannel_ptr ec,
+ RtecEventComm::Time interval
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_.activate (ec, interval ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ECM_Local_Federation::supplier_timeout (RtecEventComm::PushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::EventSet sent (1);
+ sent.length (1);
+
+ RtecEventComm::Event& s = sent[0];
+ s.header.source = this->supplier_.supplier_id();
+ s.header.ttl = 1;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (s.header.creation_time, t);
+
+ this->event_count_--;
+
+ // ACE_DEBUG ((LM_DEBUG, "Federation <%s> event count <%d>\n",
+ // this->name (), this->event_count_));
+
+ if (this->event_count_ < 0)
+ {
+ this->driver_->federation_has_shutdown (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+ }
+ int i = this->event_count_ % this->federation_->supplier_types ();
+ s.header.type = this->federation_->supplier_ipaddr (i);
+
+ consumer->push (sent ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->send_count_++;
+
+ ACE_Time_Value delta = ACE_OS::gettimeofday () -
+ this->last_subscription_change_;
+
+ unsigned int x = ACE_OS::rand_r (this->seed_);
+ double p = double (x) / RAND_MAX;
+ double maxp = double (delta.msec ()) / this->subscription_change_period_;
+
+ if (4 * p < maxp)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Reconfiguring federation %s: %f %f [%d]\n",
+ this->name (), p, maxp, x));
+ this->consumer_.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_.connect (this->seed_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->last_subscription_change_ = ACE_OS::gettimeofday ();
+ }
+}
+
+void
+ECM_Local_Federation::consumer_push (ACE_hrtime_t,
+ const RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (event.length () == 0)
+ {
+ return;
+ }
+
+ for (CORBA::ULong i = 0; i < event.length (); ++i)
+ {
+ const RtecEventComm::Event& e = event[i];
+
+ this->recv_count_++;
+
+ int j = 0;
+ for (; j < this->federation_->consumer_types (); ++j)
+ {
+ CORBA::ULong type = e.header.type;
+ if (type == this->federation_->consumer_ipaddr(j))
+ {
+ if (this->subscribed_bit (j) == 0)
+ this->unfiltered_count_++;
+ break;
+ }
+ }
+ if (j == this->federation_->consumer_types ())
+ this->invalid_count_++;
+ }
+}
+
+void
+ECM_Local_Federation::open_receiver (RtecEventChannelAdmin::EventChannel_ptr ec,
+ TAO_ECG_Refcounted_Endpoint ignore_from
+ ACE_ENV_ARG_DECL)
+{
+ RtecUDPAdmin::AddrServer_var addr_server =
+ this->federation_->addr_server (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_Reactor* reactor = TAO_ORB_Core_instance ()->reactor ();
+
+ this->receiver_->init (ec,
+ ignore_from,
+ addr_server.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const int bufsize = 512;
+ char buf[bufsize];
+ ACE_OS::strcpy (buf, this->name ());
+ ACE_OS::strcat (buf, "/receiver");
+
+ RtecEventComm::EventSourceID source = ACE::crc32 (buf);
+
+ this->mcast_eh_->reactor (reactor);
+
+ this->mcast_eh_->open (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_SupplierQOS_Factory qos;
+ for (int i = 0; i < this->consumer_types (); ++i)
+ {
+ qos.insert (source,
+ this->consumer_ipaddr (i),
+ 0, 1);
+ }
+
+ RtecEventChannelAdmin::SupplierQOS qos_copy =
+ qos.get_SupplierQOS ();
+ this->receiver_->connect (qos_copy ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+}
+
+void
+ECM_Local_Federation::close_receiver (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->receiver_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->mcast_eh_->shutdown ();
+}
+
+void
+ECM_Local_Federation::dump_results (void) const
+{
+ double unfiltered_ratio = 0;
+ if (this->recv_count_ != 0)
+ unfiltered_ratio = double(this->unfiltered_count_)/this->recv_count_;
+ double invalid_ratio = 0;
+ if (this->recv_count_ != 0)
+ invalid_ratio = double(this->invalid_count_)/this->recv_count_;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Federation: %s\n"
+ " events received: %d\n"
+ " unfiltered events received: %d\n"
+ " ratio: %f\n"
+ " invalid events received: %d\n"
+ " ratio: %f\n"
+ " events sent: %d\n",
+ this->name (),
+ this->recv_count_,
+ this->unfiltered_count_,
+ unfiltered_ratio,
+ this->invalid_count_,
+ invalid_ratio,
+ this->send_count_));
+}
+
+void
+ECM_Local_Federation::subscribed_bit (int i, CORBA::Boolean x)
+{
+ if (i > this->consumer_types ())
+ return;
+ this->subscription_subset_[i] = x;
+}
+
+CORBA::Boolean
+ECM_Local_Federation::subscribed_bit (int i) const
+{
+ if (i > this->consumer_types ())
+ return 0;
+ return this->subscription_subset_[i];
+}
+
+int
+main (int argc, char *argv [])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ECM_Driver driver;
+ return driver.run (argc, argv);
+}
diff --git a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h
new file mode 100644
index 00000000000..a1044cb15aa
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.h
@@ -0,0 +1,526 @@
+// -*- C++ -*-
+
+// $Id$
+
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// This test attempts to communicate several Event Channels UDP
+// using multicast.
+// The test reads a configuration file that describe what events are
+// received by each "Federation". The user must provide, on the
+// command line, which federations are present on each process
+// (these are called the "Local Federations").
+// The test also creates one supplier for each federation, the
+// supplier can send an event of any possible type described in the
+// file.
+
+// = HOW
+// The test creates one UDP_Sender for each remote federation,
+// this is a PushConsumer that sends the events using UDP
+// multicast.
+// Notice that there is still a win in using multicast because
+// multiple copies of the federation may be present.
+// To receive the event the test creates one UDP_Receiver for each
+// local federation, it joins to the right multicast groups and
+// pushes the events it receives, acting as a PushSupplier.
+//
+// The UDP_Receiversfederation suppliers Mcast packets as local events
+// could observe the changes in the local subscriptions and use that
+// to join or leave the multicast groups.
+// To demostrate this the test will need to reconfigure its
+// subscription list every so often (a few seconds seems like a good
+// idea).
+//
+// = TODO
+//
+// It is unfortunate that the test must know before-hand the remote
+// consumer interests. It would be really simple to use a better
+// strategy: the test could "observe" changes in the remote EC
+// subscription list, it could then modify its local consumers
+// subscriptions.
+//
+// ============================================================================
+
+#ifndef EC_MCAST_H
+#define EC_MCAST_H
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/High_Res_Timer.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/Channel_Clients_T.h"
+#include "orbsvcs/Event/ECG_UDP_Sender.h"
+#include "orbsvcs/Event/EC_UDP_Admin.h"
+#include "orbsvcs/Event/ECG_Mcast_EH.h"
+#include "orbsvcs/Event/ECG_UDP_Out_Endpoint.h"
+#include "orbsvcs/Event/ECG_UDP_Receiver.h"
+#include "orbsvcs/Event/ECG_UDP_Sender.h"
+
+class ECM_Driver;
+
+class ECM_Federation
+{
+ // = DESCRIPTION
+ // The test reads a configuration file where it obtains the data
+ // about each "federation". A federation is some application,
+ // distributed over several processes. The potential set of
+ // publications and the potential set of subscriptions is known
+ // beforehand, but the actual publications (or subscriptions) may
+ // change dynamically.
+ // As stated above the federation may be present in more than one
+ // process, but also a process may participate in more than one
+ // federation.
+ //
+public:
+ ECM_Federation (char* name,
+ CORBA::UShort mcast_port,
+ int supplier_types,
+ char** supplier_names,
+ int consumer_types,
+ char** consumer_names);
+ // Constructor, it assumes ownership of the buffers, strings must be
+ // allocated using CORBA::string_alloc(), buffers using operator new.
+
+ ~ECM_Federation (void);
+ // Dtor
+
+ const char* name (void) const;
+ // The name of the federation....
+
+ CORBA::UShort mcast_port (void) const;
+ // The port used by this federation to receive mcast messages.
+
+ int supplier_types (void) const;
+ // The number of different event types published by this federation.
+
+ const char* supplier_name (CORBA::ULong i) const;
+ // The name (mcast addr in A.B.C.D format) of the event type <i>
+
+ CORBA::ULong supplier_ipaddr (CORBA::ULong i) const;
+ // The ipaddr (in host byte order) of the event type <i>
+
+ int consumer_types (void) const;
+ // The number of different event types consumed by this federation.
+
+ const char* consumer_name (CORBA::ULong i) const;
+ // The name (mcast addr in A.B.C.D format) of the event type <i>
+
+ CORBA::ULong consumer_ipaddr (CORBA::ULong i) const;
+ // The ipaddr (in host byte order) of the event type <i>
+
+ void open (TAO_ECG_UDP_Out_Endpoint *endoint,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // Connect the UDP sender to the EC.
+
+ void close (ACE_ENV_SINGLE_ARG_DECL);
+ // Close the UDP sender, disconnect from the EC
+
+ int sender_local_addr (ACE_INET_Addr& addr);
+ // Return the sender local address
+
+ RtecUDPAdmin::AddrServer_ptr addr_server (ACE_ENV_SINGLE_ARG_DECL);
+ // This address server can be used to convert event headers
+ // (type,source) to UDP addresses (ipaddr,port)
+
+private:
+ char* name_;
+ CORBA::UShort mcast_port_;
+
+ int supplier_types_;
+ char** supplier_names_;
+ CORBA::ULong* supplier_ipaddr_;
+
+ int consumer_types_;
+ char** consumer_names_;
+ CORBA::ULong* consumer_ipaddr_;
+
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> sender_;
+ // The sender
+
+ TAO_EC_Simple_AddrServer addr_server_;
+ // Resolve event headers (type,source) to UDP addresses
+ // (ipaddr,port)
+};
+
+class ECM_Local_Federation;
+
+class ECM_Supplier : public POA_RtecEventComm::PushSupplier
+{
+ //
+ // = TITLE
+ // Helper class to simulate an application acting as an event
+ // supplier.
+ //
+ // = DESCRIPTION
+ // This class connects as a consumer for timeouts in the EC. On
+ // every timeout it delegates on the ECM_Local_Federation class,
+ // usually this results in some reconfiguration and/or some events
+ // sent.
+ //
+public:
+ ECM_Supplier (ECM_Local_Federation* federation);
+
+ void open (const char* name,
+ RtecEventChannelAdmin::EventChannel_ptr event_channel
+ ACE_ENV_ARG_DECL);
+ // This method connects the supplier to the EC.
+
+ void close (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ void activate (RtecEventChannelAdmin::EventChannel_ptr event_channel,
+ RtecEventComm::Time interval
+ ACE_ENV_ARG_DECL);
+ // Connect as a consumer to start receiving events.
+
+ RtecEventComm::EventSourceID supplier_id (void) const;
+ // The supplier ID.
+
+ void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL);
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Implement the callbacks for our consumer personality.
+
+ // = The POA_RtecEventComm::PushSupplier methods.
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ ECM_Local_Federation* federation_;
+ // To callback the federation.
+
+ RtecEventComm::EventSourceID supplier_id_;
+ // We generate an id based on the name....
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+ // We talk to the EC (as a supplier) using this proxy.
+
+ ACE_PushConsumer_Adapter<ECM_Supplier> consumer_;
+ // We also connect to the EC as a consumer so we can receive the
+ // timeout events.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC (as a supplier) using this proxy.
+};
+
+class ECM_Consumer : public POA_RtecEventComm::PushConsumer
+{
+ //
+ // = TITLE
+ // Helper class to simulate an application acting as an event
+ // consumer.
+ //
+ // = DESCRIPTION
+ // This class connects as an event consumer to the EC. The events
+ // are actually handled by the ECM_Local_Federation.
+public:
+ ECM_Consumer (ECM_Local_Federation* federation);
+
+ void open (const char* name,
+ RtecEventChannelAdmin::EventChannel_ptr event_channel,
+ ACE_RANDR_TYPE &seed
+ ACE_ENV_ARG_DECL);
+ // This method connects the consumer to the EC.
+
+ void close (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ void connect (ACE_RANDR_TYPE& seed
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the supplier, but do not forget about it or close
+ // it.
+
+ // = The POA_RtecEventComm::PushComsumer methods.
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ ECM_Local_Federation* federation_;
+ // To callback.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC using this proxy.
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // We talk to the EC using this proxy.
+};
+
+class ECM_Local_Federation
+{
+ // = DESCRIPTION
+ // This class is used to represent a federation that is actually
+ // running in this process.
+ //
+public:
+ ECM_Local_Federation (ECM_Federation *federation,
+ ECM_Driver *driver);
+ // Constructor.
+ ~ECM_Local_Federation (void);
+ // Destructor
+
+ void open (int event_count,
+ RtecEventChannelAdmin::EventChannel_ptr event_channel
+ ACE_ENV_ARG_DECL);
+ // Connect both the supplier and the consumer.
+
+ void close (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect everybody from the EC
+
+ void activate (RtecEventChannelAdmin::EventChannel_ptr event_channel,
+ RtecEventComm::Time interval
+ ACE_ENV_ARG_DECL);
+ // Activate the supplier
+
+ void supplier_timeout (RtecEventComm::PushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL);
+ // The supplier is ready to send a new event.
+
+ void consumer_push (ACE_hrtime_t arrival,
+ const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL);
+ // The consumer just received an event.
+
+ const ECM_Federation *federation (void) const;
+ // The federation description.
+
+ void open_receiver (RtecEventChannelAdmin::EventChannel_ptr ec,
+ TAO_ECG_Refcounted_Endpoint ignore_from
+ ACE_ENV_ARG_DECL);
+ // Connect the UDP receiver to the EC.
+
+ void close_receiver (ACE_ENV_SINGLE_ARG_DECL);
+ // Close the UDP receiver, disconnect from the EC
+
+ void dump_results (void) const;
+ // Report the results back to the user...
+
+ void subscribed_bit (int i, CORBA::Boolean x);
+ CORBA::Boolean subscribed_bit (int i) const;
+ // Set&Get the subscribed bit; this defines the subset of events
+ // that we actually publish.
+
+ // = Delegate on the federation description
+ const char* name (void) const;
+ CORBA::UShort mcast_port (void) const;
+ int supplier_types (void) const;
+ const char* supplier_name (CORBA::ULong i) const;
+ CORBA::ULong supplier_ipaddr (CORBA::ULong i) const;
+ int consumer_types (void) const;
+ const char* consumer_name (CORBA::ULong i) const;
+ CORBA::ULong consumer_ipaddr (CORBA::ULong i) const;
+
+private:
+ ECM_Federation *federation_;
+ // The description of the events we send and receive.
+
+ ECM_Driver *driver_;
+ // The test driver.
+
+ ECM_Consumer consumer_;
+ ECM_Supplier supplier_;
+ // The supplier and consumer helper classes, other than
+ // initialization this classes only forward events to the
+ // Federation.
+
+ // Collect statistics
+
+ CORBA::ULong recv_count_;
+ // Messages received.
+
+ CORBA::ULong unfiltered_count_;
+ // Messages received that were not properly filtered.
+
+ CORBA::ULong invalid_count_;
+ // Message received that could *not* be destined to this federation,
+ // yet they were received.
+
+ CORBA::ULong send_count_;
+ // Messages sent.
+
+ int event_count_;
+ // How many messages will we send before stop the simulation.
+
+ ACE_Time_Value last_publication_change_;
+ // The last time we changed our publication list, we don't change it
+ // too often.
+
+ ACE_Time_Value last_subscription_change_;
+ // The last time we changed our publication, so we don't change too
+ // often.
+
+ TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> receiver_;
+ // This object reads the events and pushes them into the EC. Notice
+ // that it can receive events from multiple Event Handlers.
+
+ TAO_ECG_Mcast_EH* mcast_eh_;
+ // The event handler, it receives callbacks from the reactor
+ // whenever an event is available in some of the multicast groups,
+ // it then forwards to the <mcast_recv_> object for processing and
+ // dispatching of the event.
+ // @@ TODO Eventually we may need several of this objects to handle
+ // OS limitations on the number of multicast groups per socket.
+
+ ACE_RANDR_TYPE seed_;
+ // The seed for a random number generator.
+
+ CORBA::ULong subscription_change_period_;
+ // The (average) period between subscription changes, in usecs
+
+ CORBA::ULong publication_change_period_;
+ // The (average) period between publication changes, in usecs
+
+ CORBA::Boolean* subscription_subset_;
+ // The events we are actually subscribed to.
+};
+
+class ECM_Driver
+{
+ //
+ // = TITLE
+ // Demonstrate the use of the UDP Gateways.
+ //
+ // = DESCRIPTION
+ // This class is design to exercise several features of the UDP
+ // Gateways and its companion classes.
+ // We create a set of processes, each running one EC, with
+ // multiple consumers and suppliers colocated with the EC.
+ // The ECs communicate among themselves using multicast.
+ // The test thus show how to use multicast, change the local
+ // ECG_UDP_Receiver and ECG_UDP_Sender QoS specifications
+ // dynamically, how to economically use the OS resources to
+ // receive and send multicast messages, etc.
+ //
+public:
+ ECM_Driver (void);
+
+ enum {
+ MAX_EVENTS = 1024,
+ // Maximum number of events to send on each Federation.
+
+ MAX_LOCAL_FEDERATIONS = 16,
+ // Maximum number of federations running on a single process
+
+ MAX_FEDERATIONS = 128
+ // Maximum number of federations in the simulation
+ };
+
+ int run (int argc, char* argv[]);
+ // Run the test, read all the configuration files, etc.
+
+ void federation_has_shutdown (ECM_Local_Federation *federation
+ ACE_ENV_ARG_DECL);
+ // One of the federations has completed its simulation, once all of
+ // them finish the test exists.
+
+
+private:
+ void open_federations (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // Connect the federations to the EC.
+
+ void activate_federations (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // Activate all the federations
+
+ void close_federations (ACE_ENV_SINGLE_ARG_DECL);
+ // Close the federations, i.e. disconnect from the EC, deactivate
+ // the objects, etc.
+
+ void open_senders (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // Connect all the senders, so we can start multicasting events.
+
+ void open_receivers (RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // Connect all the receivers, thus we accept events arriving through
+ // multicast.
+
+ void close_senders (ACE_ENV_SINGLE_ARG_DECL);
+ // Close all the senders to cleanup resources.
+
+ void close_receivers (ACE_ENV_SINGLE_ARG_DECL);
+ // Close all the receivers to cleanup resources.
+
+ int shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Called when the main thread.
+
+ int parse_args (int argc, char* argv[]);
+ // parse the command line arguments
+
+ int parse_config_file (void);
+ // parse the command line arguments
+
+ int parse_name_list (FILE* file, int n, char** names,
+ const char* error_msg);
+ // parse one of the lists of names in the federation definition.
+
+ int skip_blanks (FILE* file,
+ const char* error_msg);
+ // skip the blanks in the file.
+
+ void dump_results (void);
+ // Dump the results to the standard output.
+
+private:
+ int event_period_;
+ // The events are generated using this interval, in microseconds.
+
+ int event_count_;
+ // How many events will the suppliers send
+
+ char* config_filename_;
+ // The name of the file where we read the configuration.
+
+ const char* pid_filename_;
+ // The name of a file where the process stores its pid
+
+ int local_federations_count_;
+ // How many federations are running in this process (or, if you
+ // prefer, in how many federations does this process participate).
+
+ ECM_Local_Federation* local_federations_[MAX_LOCAL_FEDERATIONS];
+ // The local federations.
+
+ char* local_names_[MAX_LOCAL_FEDERATIONS];
+ // The names of the local federations.
+
+ int all_federations_count_;
+ // The total number of federations we belong to.
+
+ ECM_Federation* all_federations_[MAX_FEDERATIONS];
+ // All the federations.
+
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX,CORBA::ULong> federations_running_;
+ // Keep track of how many federations are active so we can shutdown
+ // once they are all destroyed.
+
+ ACE_hrtime_t test_start_;
+ ACE_hrtime_t test_stop_;
+ // Measure the test elapsed time as well as mark the beginning of
+ // the frames.
+
+ CORBA::ORB_var orb_;
+ // The ORB, so we can shut it down.
+
+ TAO_ECG_UDP_Out_Endpoint endpoint_;
+ // This socket is shared by all the federations to send the
+ // multicast events.
+};
+
+#if defined (__ACE_INLINE__)
+#include "EC_Mcast.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* EC_MCAST_H */
diff --git a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.i b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.i
new file mode 100644
index 00000000000..f44811dcd02
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.i
@@ -0,0 +1,120 @@
+//
+// $Id$
+//
+
+ACE_INLINE int
+ECM_Federation::sender_local_addr (ACE_INET_Addr& addr)
+{
+ return this->sender_->get_local_addr (addr);
+}
+
+
+ACE_INLINE const char*
+ECM_Federation::name (void) const
+{
+ return this->name_;
+}
+
+ACE_INLINE CORBA::UShort
+ECM_Federation::mcast_port (void) const
+{
+ return this->mcast_port_;
+}
+
+ACE_INLINE int
+ECM_Federation::supplier_types (void) const
+{
+ return this->supplier_types_;
+}
+
+ACE_INLINE const char*
+ECM_Federation::supplier_name (CORBA::ULong i) const
+{
+ if (i < static_cast<ACE_CAST_CONST CORBA::ULong> (this->supplier_types_))
+ return this->supplier_names_[i];
+ return 0;
+}
+
+ACE_INLINE CORBA::ULong
+ECM_Federation::supplier_ipaddr (CORBA::ULong i) const
+{
+ if (i < static_cast<ACE_CAST_CONST CORBA::ULong> (this->supplier_types_))
+ return this->supplier_ipaddr_[i];
+ return 0;
+}
+
+ACE_INLINE int
+ECM_Federation::consumer_types (void) const
+{
+ return this->consumer_types_;
+}
+
+ACE_INLINE const char*
+ECM_Federation::consumer_name (CORBA::ULong i) const
+{
+ if (i < static_cast<ACE_CAST_CONST CORBA::ULong> (this->consumer_types_))
+ return this->consumer_names_[i];
+ return 0;
+}
+
+ACE_INLINE CORBA::ULong
+ECM_Federation::consumer_ipaddr (CORBA::ULong i) const
+{
+ if (i < static_cast<ACE_CAST_CONST CORBA::ULong> (this->consumer_types_))
+ return this->consumer_ipaddr_[i];
+ return 0;
+}
+
+ACE_INLINE const ECM_Federation*
+ECM_Local_Federation::federation (void) const
+{
+ return this->federation_;
+}
+
+ACE_INLINE const char*
+ECM_Local_Federation::name (void) const
+{
+ return this->federation_->name ();
+}
+
+ACE_INLINE CORBA::UShort
+ECM_Local_Federation::mcast_port (void) const
+{
+ return this->federation_->mcast_port ();
+}
+
+ACE_INLINE int
+ECM_Local_Federation::supplier_types (void) const
+{
+ return this->federation_->supplier_types ();
+}
+
+ACE_INLINE const char*
+ECM_Local_Federation::supplier_name (CORBA::ULong i) const
+{
+ return this->federation_->supplier_name (i);
+}
+
+ACE_INLINE CORBA::ULong
+ECM_Local_Federation::supplier_ipaddr (CORBA::ULong i) const
+{
+ return this->federation_->supplier_ipaddr (i);
+}
+
+ACE_INLINE int
+ECM_Local_Federation::consumer_types (void) const
+{
+ return this->federation_->consumer_types ();
+}
+
+ACE_INLINE const char*
+ECM_Local_Federation::consumer_name (CORBA::ULong i) const
+{
+ return this->federation_->consumer_name (i);
+}
+
+ACE_INLINE CORBA::ULong
+ECM_Local_Federation::consumer_ipaddr (CORBA::ULong i) const
+{
+ return this->federation_->consumer_ipaddr (i);
+}
diff --git a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.mpc b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.mpc
new file mode 100644
index 00000000000..76d669aa442
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(EC_Mcast): rteventexe, rtevent_serv, messaging {
+ exename = EC_Mcast
+}
diff --git a/TAO/orbsvcs/tests/EC_Mcast/Makefile.am b/TAO/orbsvcs/tests/EC_Mcast/Makefile.am
new file mode 100644
index 00000000000..0ded4dafb07
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/Makefile.am
@@ -0,0 +1,60 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.EC_Mcast.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS = EC_Mcast
+
+EC_Mcast_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+EC_Mcast_SOURCES = \
+ EC_Mcast.cpp \
+ EC_Mcast.h \
+ EC_Mcast.i
+
+EC_Mcast_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/EC_Mcast/README b/TAO/orbsvcs/tests/EC_Mcast/README
new file mode 100644
index 00000000000..9f195081d11
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/README
@@ -0,0 +1,21 @@
+# $Id$
+
+This test can be pretty complicated to run, a sample configuration file is
+included to help you startup.
+
+ The basic idea to remember is that a "Federation" is a logical
+grouping of incoming and outgoing mcast addresses that share the same
+multicast port. The test reads the configuration file to find out
+which Federations are globally available defined, but the comand line
+is used to specify the list of federations that are actually running
+on each process.
+
+ To make the test interesting you should run at least two
+copies of the test, on different windows (to keep the output appart):
+
+$ ./EC_Mcast -p ECM1.pid -c sample.cfg -n 200 -t 500000 -f Set02
+$ ./EC_Mcast -p ECM2.pid -c sample.cfg -n 200 -t 500000 -f Set02
+
+ the test will report the number of events received, if you run
+just one of the processes you will notice that this number is smaller,
+this indicates that some events come from a "remote" event.
diff --git a/TAO/orbsvcs/tests/EC_Mcast/run_test.pl b/TAO/orbsvcs/tests/EC_Mcast/run_test.pl
new file mode 100755
index 00000000000..7bfd35e6fcf
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/run_test.pl
@@ -0,0 +1,53 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$sample_cfg = PerlACE::LocalFile ("sample.cfg");
+$svc_conf = PerlACE::LocalFile ("svc$PerlACE::svcconf_ext");
+
+# Run two copies of the same test...
+$T1 = new PerlACE::Process ("EC_Mcast",
+ "-c $sample_cfg -ORBSvcConf $svc_conf "
+ . "-n 100 -t 50000 -f Set02");
+$T2 = new PerlACE::Process ("EC_Mcast",
+ "-c $sample_cfg -ORBSvcConf $svc_conf "
+ . "-n 100 -t 50000 -f Set02");
+
+$sp1 = $T1->Spawn ();
+
+if ($sp1 != 0) {
+ print STDERR "ERROR: could not spawn EC_MCast, returned $sp1\n";
+ exit 1;
+}
+
+$sp2 = $T2->Spawn ();
+
+if ($sp2 != 0) {
+ print STDERR "ERROR: could not spawn EC_MCast, returned $sp2\n";
+ $T1->Kill ();
+ exit 1;
+}
+
+$test1 = $T1->WaitKill (60);
+
+if ($test1 != 0) {
+ print STDERR "ERROR: test 1 returned $test1\n";
+ $status = 1;
+}
+
+$test2 = $T2->WaitKill (60);
+
+if ($test2 != 0) {
+ print STDERR "ERROR: test 2 returned $test2\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/EC_Mcast/sample.cfg b/TAO/orbsvcs/tests/EC_Mcast/sample.cfg
new file mode 100644
index 00000000000..ed3e057aa99
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/sample.cfg
@@ -0,0 +1,116 @@
+6
+Set00 12000 5 3
+ 224.100.0.1
+ 224.100.0.2
+ 224.100.0.3
+ 224.100.0.4
+ 224.100.0.5
+ 224.100.5.1
+ 224.100.5.2
+ 224.100.5.3
+Set01 12001 30 30
+ 224.100.1.1
+ 224.100.1.2
+ 224.100.1.3
+ 224.100.1.4
+ 224.100.1.5
+ 224.100.1.6
+ 224.100.1.7
+ 224.100.1.8
+ 224.100.1.9
+ 224.100.1.10
+ 224.100.1.11
+ 224.100.1.12
+ 224.100.1.13
+ 224.100.1.14
+ 224.100.1.15
+ 224.100.1.16
+ 224.100.1.17
+ 224.100.1.18
+ 224.100.1.19
+ 224.100.1.20
+ 224.100.1.21
+ 224.100.1.22
+ 224.100.1.23
+ 224.100.1.24
+ 224.100.1.25
+ 224.100.1.26
+ 224.100.1.27
+ 224.100.1.28
+ 224.100.1.29
+ 224.100.1.30
+ 224.100.2.1
+ 224.100.2.2
+ 224.100.2.3
+ 224.100.2.4
+ 224.100.2.5
+ 224.100.2.6
+ 224.100.2.7
+ 224.100.2.8
+ 224.100.2.9
+ 224.100.2.10
+ 224.100.2.11
+ 224.100.2.12
+ 224.100.2.13
+ 224.100.2.14
+ 224.100.2.15
+ 224.100.2.16
+ 224.100.2.17
+ 224.100.2.18
+ 224.100.2.19
+ 224.100.2.20
+ 224.100.2.21
+ 224.100.2.22
+ 224.100.2.23
+ 224.100.2.24
+ 224.100.2.25
+ 224.100.2.26
+ 224.100.2.27
+ 224.100.2.28
+ 224.100.2.29
+ 224.100.2.30
+Set02 12002 4 4
+ 224.100.5.1
+ 224.100.5.2
+ 224.100.5.3
+ 224.100.5.4
+ 224.100.4.1
+ 224.100.4.2
+ 224.100.5.3
+ 224.100.5.4
+Set03 12003 4 4
+ 224.100.5.1
+ 224.100.5.2
+ 224.100.5.3
+ 224.100.5.4
+ 224.100.4.1
+ 224.100.4.2
+ 224.100.5.3
+ 224.100.5.4
+Set04 12004 4 4
+ 224.100.5.1
+ 224.100.5.2
+ 224.100.5.3
+ 224.100.5.4
+ 224.100.4.1
+ 224.100.4.2
+ 224.100.5.3
+ 224.100.5.4
+Set05 12005 4 4
+ 224.100.5.1
+ 224.100.5.2
+ 224.100.5.3
+ 224.100.5.4
+ 224.100.4.1
+ 224.100.4.2
+ 224.100.5.3
+ 224.100.5.4
+Set06 12006 4 4
+ 224.100.0.1
+ 224.100.0.2
+ 224.100.2.1
+ 224.100.2.2
+ 224.100.0.3
+ 224.100.0.4
+ 224.100.2.3
+ 224.100.2.4
diff --git a/TAO/orbsvcs/tests/EC_Mcast/svc.conf b/TAO/orbsvcs/tests/EC_Mcast/svc.conf
new file mode 100644
index 00000000000..7505d001e70
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier -ECObserver basic"
diff --git a/TAO/orbsvcs/tests/EC_Mcast/svc.conf.xml b/TAO/orbsvcs/tests/EC_Mcast/svc.conf.xml
new file mode 100644
index 00000000000..f818a1c2ddf
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Mcast/svc.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/EC_Mcast/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier -ECObserver basic"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp
new file mode 100644
index 00000000000..2d064471253
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp
@@ -0,0 +1,1612 @@
+// $Id$
+
+#include "EC_Multiple.h"
+
+#include "Scheduler_Runtime1.h"
+#include "Scheduler_Runtime2.h"
+#include "Scheduler_Runtime_Dynamic.h" /* infos_3 */
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/Sched/Config_Scheduler.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Runtime_Scheduler.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_strings.h"
+
+#if defined (sun)
+# include <sys/lwp.h> /* for _lwp_self */
+#endif /* sun */
+
+ACE_RCSID (EC_Multiple,
+ EC_Multiple,
+ "$Id$")
+
+Test_ECG::Test_ECG (void)
+ : lcl_name_ ("Test_ECG"),
+ rmt_name_ (0),
+ scheduling_type_ (Test_ECG::ss_runtime),
+ consumer_disconnects_ (0),
+ supplier_disconnects_ (0),
+ short_circuit_ (0),
+ hp_suppliers_ (1),
+ hp_consumers_ (1),
+ hp_workload_ (10),
+ hp_interval_ (25000),
+ hp_message_count_ (200),
+ hps_event_a_ (ACE_ES_EVENT_UNDEFINED),
+ hps_event_b_ (ACE_ES_EVENT_UNDEFINED + 1),
+ hpc_event_a_ (ACE_ES_EVENT_UNDEFINED),
+ hpc_event_b_ (ACE_ES_EVENT_UNDEFINED + 1),
+ lp_suppliers_ (0),
+ lp_consumers_ (0),
+ lp_workload_ (0),
+ lp_interval_ (100000),
+ lp_message_count_ (50),
+ lps_event_a_ (0),
+ lps_event_b_ (0),
+ lpc_event_a_ (0),
+ lpc_event_b_ (0),
+ schedule_file_ (0),
+ pid_file_name_ (0),
+ ready_ (0),
+ ready_cnd_ (ready_mtx_)
+{
+}
+
+void
+print_priority_info (const char *const name)
+{
+#if defined (ACE_HAS_PTHREADS_STD) || defined (sun)
+#if defined (ACE_HAS_PTHREADS_STD)
+ struct sched_param param;
+ int policy, status;
+
+ if ((status = pthread_getschedparam (pthread_self (), &policy,
+ &param)) == 0) {
+# ifdef sun
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%lu|%u); policy is %d, priority is %d\n",
+ name,
+ ACE_OS::getpid (),
+ _lwp_self (),
+ pthread_self (),
+ policy, param.sched_priority));
+# else /* ! sun */
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%lu|%u); policy is %d, priority is %d\n",
+ name,
+ ACE_OS::getpid (),
+ 0,
+ pthread_self (),
+ policy, param.sched_priority ));
+# endif /* ! sun */
+ } else {
+ ACE_DEBUG ((LM_DEBUG,"pthread_getschedparam failed: %d\n", status));
+ }
+#endif /* ACE_HAS_PTHREADS_STD */
+
+#ifdef sun
+ // Find what scheduling class the thread's LWP is in.
+ ACE_Sched_Params sched_params (ACE_SCHED_OTHER, 0);
+ if (ACE_OS::lwp_getparams (sched_params) == -1)
+ {
+ ACE_OS::perror ("ACE_OS::lwp_getparams");
+ return;
+ }
+ else if (sched_params.policy () == ACE_SCHED_FIFO ||
+ sched_params.policy () == ACE_SCHED_RR)
+ {
+ // This thread's LWP is in the RT class.
+ ACE_DEBUG ((LM_DEBUG,
+ "RT class; priority: %d, quantum: %u msec\n",
+ sched_params.priority (),
+ sched_params.quantum ().msec ()));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "TS class; priority: %d\n",
+ sched_params.priority ()));
+ }
+#endif /* sun */
+#else
+ ACE_UNUSED_ARG (name);
+#endif /* ACE_HAS_PTHREADS_STD */
+}
+
+int
+Test_ECG::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " lcl name = <%s>\n"
+ " rmt name = <%s>\n"
+ " scheduler type = <%d>\n"
+ " consumer disconnects = <%d>\n"
+ " supplier disconnects = <%d>\n"
+ " short circuit EC = <%d>\n"
+ " HP suppliers = <%d>\n"
+ " HP consumers = <%d>\n"
+ " HP workload = <%d> (iterations)\n"
+ " HP interval between events = <%d> (usecs)\n"
+ " HP message count = <%d>\n"
+ " HP supplier Event A = <%d>\n"
+ " HP supplier Event B = <%d>\n"
+ " HP consumer Event A = <%d>\n"
+ " HP consumer Event B = <%d>\n"
+ " LP suppliers = <%d>\n"
+ " LP consumers = <%d>\n"
+ " LP workload = <%d> (iterations)\n"
+ " LP interval between events = <%d> (usecs)\n"
+ " LP message count = <%d>\n"
+ " LP supplier Event A = <%d>\n"
+ " LP supplier Event B = <%d>\n"
+ " LP consumer Event A = <%d>\n"
+ " LP consumer Event B = <%d>\n"
+ " schedule_file = <%s>\n"
+ " pid file name = <%s>\n",
+ this->lcl_name_?this->lcl_name_:"nil",
+ this->rmt_name_?this->rmt_name_:"nil",
+ this->scheduling_type_,
+ this->consumer_disconnects_,
+ this->supplier_disconnects_,
+ this->short_circuit_,
+
+ this->hp_suppliers_,
+ this->hp_consumers_,
+ this->hp_workload_,
+ this->hp_interval_,
+ this->hp_message_count_,
+ this->hps_event_a_,
+ this->hps_event_b_,
+ this->hpc_event_a_,
+ this->hpc_event_b_,
+
+ this->lp_suppliers_,
+ this->lp_consumers_,
+ this->lp_workload_,
+ this->lp_interval_,
+ this->lp_message_count_,
+ this->lps_event_a_,
+ this->lps_event_b_,
+ this->lpc_event_a_,
+ this->lpc_event_b_,
+
+ this->schedule_file_?this->schedule_file_:"nil",
+ this->pid_file_name_?this->pid_file_name_:"nil") );
+
+ print_priority_info ("Test_ECG::run (Main)");
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_file_name_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ int min_priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_FIFO);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ min_priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: user is not superuser, "
+ "so remain in time-sharing class\n", argv[0]));
+ else
+ ACE_ERROR ((LM_ERROR,
+ "%s: ACE_OS::sched_params failed\n", argv[0]));
+ }
+
+ if (ACE_OS::thr_setprio (min_priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "(%P|%t) main thr_setprio failed\n"));
+ }
+
+ print_priority_info ("Test_ECG::run (Main after thr_setprio)");
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ auto_ptr<POA_RtecScheduler::Scheduler> scheduler_impl;
+ RtecScheduler::Scheduler_var scheduler;
+
+ switch (this->scheduling_type_)
+ {
+ default:
+ ACE_ERROR ((LM_WARNING, "Unknown scheduling type %d\n",
+ this->scheduling_type_));
+ /*FALLTHROUGH*/
+ case Test_ECG::ss_global:
+ break;
+
+ case Test_ECG::ss_local:
+ {
+ auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Config_Scheduler);
+ scheduler_impl = auto_scheduler_impl;
+ }
+ if (scheduler_impl.get () == 0)
+ return -1;
+ scheduler = scheduler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ break;
+
+ case Test_ECG::ss_runtime:
+ if (ACE_OS::strcmp (this->lcl_name_, "ECM1") == 0)
+ {
+ // This setups Scheduler_Factory to use the runtime version
+ ACE_Scheduler_Factory::use_runtime (
+ sizeof (runtime_configs_1)/sizeof (runtime_configs_1[0]),
+ runtime_configs_1,
+ sizeof (runtime_infos_1)/sizeof (runtime_infos_1[0]),
+ runtime_infos_1);
+
+ auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl
+ (new ACE_Runtime_Scheduler (runtime_configs_1_size,
+ runtime_configs_1,
+ runtime_infos_1_size,
+ runtime_infos_1));
+ scheduler_impl = auto_scheduler_impl;
+
+ if (scheduler_impl.get () == 0)
+ return -1;
+ scheduler = scheduler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else if (ACE_OS::strcmp (this->lcl_name_, "ECM2") == 0)
+ {
+ // This setups Scheduler_Factory to use the runtime version
+ ACE_Scheduler_Factory::use_runtime (
+ sizeof (runtime_configs_2)/sizeof (runtime_configs_2[0]),
+ runtime_configs_2,
+ sizeof (runtime_infos_2)/sizeof (runtime_infos_2[0]),
+ runtime_infos_2);
+
+ auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl
+ (new ACE_Runtime_Scheduler (runtime_configs_2_size,
+ runtime_configs_2,
+ runtime_infos_2_size,
+ runtime_infos_2));
+ scheduler_impl = auto_scheduler_impl;
+
+ if (scheduler_impl.get () == 0)
+ return -1;
+ scheduler = scheduler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else if (ACE_OS::strcmp (this->lcl_name_, "ECM3") == 0)
+ {
+ // This setups Scheduler_Factory to use the runtime version
+ ACE_Scheduler_Factory::use_runtime (
+ sizeof (runtime_configs_3)/sizeof (runtime_configs_3[0]),
+ runtime_configs_3,
+ sizeof (runtime_infos_3)/sizeof (runtime_infos_3[0]),
+ runtime_infos_3);
+
+ auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl
+ (new ACE_Runtime_Scheduler (runtime_configs_3_size,
+ runtime_configs_3,
+ runtime_infos_3_size,
+ runtime_infos_3));
+ scheduler_impl = auto_scheduler_impl;
+
+ if (scheduler_impl.get () == 0)
+ return -1;
+ scheduler = scheduler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_ERROR ((LM_WARNING,
+ "Unknown name <%s> defaulting to "
+ "config scheduler\n", this->lcl_name_));
+
+ auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Config_Scheduler);
+ scheduler_impl = auto_scheduler_impl;
+
+ if (scheduler_impl.get () == 0)
+ return -1;
+ scheduler = scheduler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ break;
+
+ }
+
+ // We use this buffer to generate the names of the local
+ // services.
+ const int bufsize = 512;
+ char buf[bufsize];
+
+ // Register the scheduler with the naming service.
+ switch (this->scheduling_type_)
+ {
+ default:
+ case Test_ECG::ss_global:
+ break;
+
+ case Test_ECG::ss_local:
+ case Test_ECG::ss_runtime:
+ {
+ CORBA::String_var str =
+ orb->object_to_string (scheduler.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "The (local) scheduler IOR is <%s>\n",
+ str.in ()));
+
+ ACE_OS::strcpy (buf, "ScheduleService@");
+ ACE_OS::strcat (buf, this->lcl_name_);
+
+ // Register the servant with the Naming Context....
+ CosNaming::Name schedule_name (1);
+ schedule_name.length (1);
+ schedule_name[0].id = CORBA::string_dup (buf);
+ naming_context->bind (schedule_name, scheduler.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_Scheduler_Factory::use_config (naming_context.in (),
+ buf) == -1)
+ return -1;
+ }
+ break;
+ }
+
+ // Create the EventService implementation, but don't start its
+ // internal threads.
+ TAO_EC_Event_Channel_Attributes attr (root_poa.in (),
+ root_poa.in ());
+ TAO_EC_Event_Channel ec_impl (attr);
+
+ // Register Event_Service with the Naming Service.
+ RtecEventChannelAdmin::EventChannel_var ec =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var str =
+ orb->object_to_string (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_OS::sleep (5);
+ ACE_DEBUG ((LM_DEBUG, "The (local) EC IOR is <%s>\n", str.in ()));
+
+ ACE_OS::strcpy (buf, "EventChannel@");
+ ACE_OS::strcat (buf, this->lcl_name_);
+
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup (buf);
+ naming_context->bind (channel_name, ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "waiting to start\n"));
+
+ ACE_Time_Value tv (15, 0);
+
+ if (this->rmt_name_ != 0)
+ {
+ orb->run (&tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "starting....\n"));
+
+ RtecEventChannelAdmin::EventChannel_var local_ec =
+ this->get_ec (naming_context.in (),
+ this->lcl_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "located local EC\n"));
+
+ for (int sd = 0; sd < this->supplier_disconnects_; ++sd)
+ {
+ this->connect_suppliers (local_ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_OS::sleep (5);
+ ACE_DEBUG ((LM_DEBUG, "Supplier disconnection %d\n", sd));
+ }
+
+ this->connect_suppliers (local_ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected supplier\n"));
+
+ RtecEventChannelAdmin::Observer_Handle observer_handle = 0;
+ if (this->rmt_name_ != 0)
+ {
+ tv.set (5, 0);
+ orb->run (&tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var remote_ec =
+ this->get_ec (naming_context.in (),
+ this->rmt_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "located remote EC\n"));
+
+ CosNaming::Name rsch_name (1);
+ rsch_name.length (1);
+ ACE_OS::strcpy (buf, "ScheduleService");
+ if (this->scheduling_type_ != Test_ECG::ss_global)
+ {
+ ACE_OS::strcat (buf, "@");
+ ACE_OS::strcat (buf, this->rmt_name_);
+ }
+ rsch_name[0].id = CORBA::string_dup (buf);
+ CORBA::Object_var tmpobj =
+ naming_context->resolve (rsch_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::Scheduler_var remote_sch =
+ RtecScheduler::Scheduler::_narrow (tmpobj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect_ecg (local_ec.in (),
+ remote_ec.in (),
+ remote_sch.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected proxy\n"));
+
+ tv.set (5, 0);
+ orb->run (&tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::Observer_ptr observer =
+ this->ecg_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ observer_handle = ec_impl.append_observer (observer
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ for (int cd = 0; cd < this->consumer_disconnects_; ++cd)
+ {
+ this->connect_consumers (local_ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_OS::sleep (5);
+ ACE_DEBUG ((LM_DEBUG, "Consumer disconnection %d\n", cd));
+ }
+ this->connect_consumers (local_ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected consumer\n"));
+
+ this->activate_suppliers (local_ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers are active\n"));
+
+ this->running_suppliers_ = this->hp_suppliers_ + this->lp_suppliers_;
+
+ // Acquire the mutex for the ready mutex, blocking any supplier
+ // that may start after this point.
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ready_mon, this->ready_mtx_, 1);
+ this->ready_ = 1;
+ this->test_start_ = ACE_OS::gethrtime ();
+ this->ready_cnd_.broadcast ();
+ ready_mon.release ();
+
+ ACE_DEBUG ((LM_DEBUG, "activate the EC\n"));
+
+ if (this->rmt_name_ != 0)
+ {
+ ec_impl.remove_observer (observer_handle ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Create the EC internal threads
+ ec_impl.activate ();
+
+ ACE_DEBUG ((LM_DEBUG, "running the test\n"));
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->test_stop_ = ACE_OS::gethrtime ();
+
+ ACE_DEBUG ((LM_DEBUG, "shutdown the EC\n"));
+ ec_impl.shutdown ();
+
+ this->dump_results ();
+
+ if (this->schedule_file_ != 0)
+ {
+ RtecScheduler::RT_Info_Set_var infos;
+ RtecScheduler::Dependency_Set_var deps;
+ RtecScheduler::Config_Info_Set_var configs;
+ RtecScheduler::Scheduling_Anomaly_Set_var anomalies;
+
+ ACE_Scheduler_Factory::server ()->compute_scheduling
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD),
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD),
+ infos.out (), deps.out (),
+ configs.out (), anomalies.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::dump_schedule (infos.in (),
+ deps.in (),
+ configs.in (),
+ anomalies.in (),
+ this->schedule_file_);
+ }
+
+ naming_context->unbind (channel_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->rmt_name_ != 0)
+ {
+ this->ecg_.close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->ecg_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "shutdown grace period\n"));
+ tv.set (5, 0);
+ orb->run (&tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+RtecEventChannelAdmin::EventChannel_ptr
+Test_ECG::get_ec (CosNaming::NamingContext_ptr naming_context,
+ const char* process_name
+ ACE_ENV_ARG_DECL)
+{
+ const int bufsize = 512;
+ char buf[bufsize];
+ ACE_OS::strcpy (buf, "EventChannel@");
+ ACE_OS::strcat (buf, process_name);
+
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup (buf);
+
+ CORBA::Object_var ec_ptr =
+ naming_context->resolve (channel_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (RtecEventChannelAdmin::EventChannel::_nil ());
+ if (CORBA::is_nil (ec_ptr.in ()))
+ return RtecEventChannelAdmin::EventChannel::_nil ();
+
+ return RtecEventChannelAdmin::EventChannel::_narrow (ec_ptr.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Test_ECG::disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->hp_suppliers_ + this->lp_suppliers_; ++i)
+ {
+ this->suppliers_[i]->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Test_ECG::connect_suppliers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL)
+{
+ int i;
+ for (i = 0; i < this->hp_suppliers_; ++i)
+ {
+ // Limit the number of messages sent by each supplier
+ int mc = this->hp_message_count_ / this->hp_suppliers_;
+ if (mc == 0)
+ mc = 1;
+
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "hp_supplier_%02d@%s", i, this->lcl_name_);
+
+ ACE_NEW (this->suppliers_[i],
+ Test_Supplier (this, this->suppliers_ + i));
+
+ this->suppliers_[i]->open (buf,
+ this->hps_event_a_,
+ this->hps_event_b_,
+ mc,
+ this->hp_interval_ * 10,
+ local_ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ for (; i < this->hp_suppliers_ + this->lp_suppliers_; ++i)
+ {
+ // Limit the number of messages sent by each supplier
+ int mc = this->lp_message_count_ / this->lp_suppliers_;
+ if (mc == 0)
+ mc = 1;
+
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "lp_supplier_%02d@%s",
+ i - this->hp_suppliers_, this->lcl_name_);
+
+ ACE_NEW (this->suppliers_[i],
+ Test_Supplier (this, this->suppliers_ + i));
+
+ this->suppliers_[i]->open (buf,
+ this->lps_event_a_,
+ this->lps_event_b_,
+ mc,
+ this->lp_interval_ * 10,
+ local_ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Test_ECG::disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->hp_consumers_ + this->lp_consumers_; ++i)
+ {
+ this->consumers_[i]->close (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Test_ECG::activate_suppliers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ int i;
+ for (i = 0; i < this->hp_suppliers_; ++i)
+ {
+ // Limit the number of messages sent by each supplier
+ int mc = this->hp_message_count_ / this->hp_suppliers_;
+ if (mc == 0)
+ mc = 1;
+
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "hp_supplier_%02d@%s", i, this->lcl_name_);
+
+ this->suppliers_[i]->activate (buf,
+ this->hp_interval_ * 10,
+ local_ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ for (; i < this->hp_suppliers_ + this->lp_suppliers_; ++i)
+ {
+ // Limit the number of messages sent by each supplier
+ int mc = this->lp_message_count_ / this->lp_suppliers_;
+ if (mc == 0)
+ mc = 1;
+
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "lp_supplier_%02d@%s",
+ i - this->hp_suppliers_, this->lcl_name_);
+
+ this->suppliers_[i]->activate (buf,
+ this->lp_interval_ * 10,
+ local_ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+Test_ECG::connect_consumers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL)
+{
+ int i;
+ for (i = 0; i < this->hp_consumers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "hp_consumer_%02d@%s", i, this->lcl_name_);
+
+ ACE_NEW (this->consumers_[i],
+ Test_Consumer (this, this->consumers_ + i));
+
+ this->consumers_[i]->open (buf,
+ this->hpc_event_a_,
+ this->hpc_event_b_,
+ local_ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->stats_[i].total_time_ = 0;
+ this->stats_[i].lcl_count_ = 0;
+ this->stats_[i].rmt_count_ = 0;
+ }
+
+ for (; i < this->hp_consumers_ + this->lp_consumers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "lp_consumer_%02d@%s",
+ i - this->hp_consumers_, this->lcl_name_);
+
+ ACE_NEW (this->consumers_[i],
+ Test_Consumer (this, this->consumers_ + i));
+
+ this->consumers_[i]->open (buf,
+ this->lpc_event_a_,
+ this->lpc_event_b_,
+ local_ec
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->stats_[i].total_time_ = 0;
+ this->stats_[i].lcl_count_ = 0;
+ this->stats_[i].rmt_count_ = 0;
+ }
+ this->running_consumers_ = this->hp_consumers_ + this->lp_consumers_;
+}
+
+void
+Test_ECG::connect_ecg (RtecEventChannelAdmin::EventChannel_ptr local_ec,
+ RtecEventChannelAdmin::EventChannel_ptr remote_ec,
+ RtecScheduler::Scheduler_ptr remote_sch
+ ACE_ENV_ARG_DECL)
+{
+ RtecScheduler::Scheduler_ptr local_sch =
+ ACE_Scheduler_Factory::server ();
+
+ // ECG name.
+ const int bufsize = 512;
+ char ecg_name[bufsize];
+ ACE_OS::strcpy (ecg_name, "ecg_");
+ ACE_OS::strcat (ecg_name, this->lcl_name_);
+
+ // We could use the same name on the local and remote scheduler,
+ // but that fails when using a global scheduler.
+ char rmt[BUFSIZ];
+ ACE_OS::strcpy (rmt, ecg_name);
+ ACE_OS::strcat (rmt, "@");
+ ACE_OS::strcat (rmt, this->rmt_name_);
+
+ // We could use the same name on the local and remote scheduler,
+ // but that fails when using a global scheduler.
+ char lcl[bufsize];
+ ACE_OS::strcpy (lcl, ecg_name);
+ ACE_OS::strcat (lcl, "@");
+ ACE_OS::strcat (lcl, this->lcl_name_);
+
+ this->ecg_.init (remote_ec, local_ec, remote_sch, local_sch,
+ rmt, lcl ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_ECG::push_supplier (void * /* cookie */,
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer,
+ const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+{
+ this->wait_until_ready ();
+ // ACE_DEBUG ((LM_DEBUG, "(%P|%t) events sent by supplier\n"));
+ // @@ TODO we could keep somekind of stats here...
+ if (!this->short_circuit_)
+ {
+ consumer->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ int i = 0;
+ for (; i < this->hp_consumers_; ++i)
+ {
+ this->consumers_[i]->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ for (; i < this->hp_consumers_ + this->lp_consumers_; ++i)
+ {
+ this->consumers_[i]->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+Test_ECG::push_consumer (void *consumer_cookie,
+ ACE_hrtime_t arrival,
+ const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int ID =
+ (reinterpret_cast<Test_Consumer**> (consumer_cookie)
+ - this->consumers_);
+
+ // ACE_DEBUG ((LM_DEBUG, "(%P|%t) events received by consumer %d\n", ID));
+
+ if (events.length () == 0)
+ {
+ // ACE_DEBUG ((LM_DEBUG, "no events\n"));
+ return;
+ }
+
+ // ACE_DEBUG ((LM_DEBUG, "%d event(s)\n", events.length ()));
+
+#if 0
+ const int bufsize = 128;
+ char buf[bufsize];
+ ACE_OS::sprintf (buf, "Consumer %d receives event in thread: ", ID);
+ print_priority_info (buf);
+#endif
+
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ const RtecEventComm::Event& e = events[i];
+
+ if (e.header.type == ACE_ES_EVENT_SHUTDOWN)
+ {
+ this->shutdown_consumer (ID);
+ continue;
+ }
+
+ ACE_hrtime_t s;
+ ORBSVCS_Time::TimeT_to_hrtime (s, e.header.creation_time);
+ ACE_hrtime_t nsec = arrival - s;
+ if (this->local_source (e.header.source))
+ {
+ int& count = this->stats_[ID].lcl_count_;
+
+ this->stats_[ID].lcl_latency_[count] = nsec;
+ int workload = this->hp_workload_;
+ int interval = this->hp_interval_;
+ if (ID >= this->hp_consumers_)
+ {
+ workload = this->lp_workload_;
+ interval = this->lp_interval_;
+ }
+
+ for (int j = 0; j < workload; ++j)
+ {
+ // Eat a little CPU so the Utilization test can measure the
+ // consumed time....
+ /* takes about 40.2 usecs on a 167 MHz Ultra2 */
+ u_long n = 1279UL;
+ ACE::is_prime (n, 2, n / 2);
+ }
+ // Increment the elapsed time on this consumer.
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->stats_[ID].total_time_ += now - arrival;
+ this->stats_[ID].end_[count] = now;
+
+ // We estimate our laxity based on the event creation
+ // time... it may not be very precise, but will do; other
+ // strategies include:
+ // + Keep track of the "current frame", then then deadline
+ // is the end of the frame.
+ // + Use the start of the test to keep the current frame.
+ // + Use the last execution.
+
+ CORBA::ULong tmp = ACE_U64_TO_U32 (s - now);
+ this->stats_[ID].laxity_[count] = 1 + tmp/1000.0F/interval;
+ count++;
+ }
+ else
+ {
+ int& count = this->stats_[ID].rmt_count_;
+ this->stats_[ID].rmt_latency_[count] = nsec;
+ count++;
+ }
+ }
+}
+
+void
+Test_ECG::wait_until_ready (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ready_mon, this->ready_mtx_);
+ while (!this->ready_)
+ this->ready_cnd_.wait ();
+}
+
+void
+Test_ECG::shutdown_supplier (void* /* supplier_cookie */,
+ RtecEventComm::PushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL)
+{
+
+ this->running_suppliers_--;
+ if (this->running_suppliers_ != 0)
+ return;
+
+ // We propagate a shutdown event through the system...
+ RtecEventComm::EventSet shutdown (1);
+ shutdown.length (1);
+ RtecEventComm::Event& s = shutdown[0];
+
+ s.header.source = 0;
+ s.header.ttl = 1;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (s.header.creation_time, t);
+ s.header.type = ACE_ES_EVENT_SHUTDOWN;
+ consumer->push (shutdown ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Test_ECG::shutdown_consumer (int id)
+{
+ ACE_DEBUG ((LM_DEBUG, "Shutdown consumer %d\n", id));
+ this->running_consumers_--;
+ if (this->running_consumers_ == 0)
+ if (TAO_ORB_Core_instance ()->orb () == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Test_ECG::shutdown_consumer, "
+ "ORB instance is 0\n"));
+
+ }
+ else
+ TAO_ORB_Core_instance ()->orb ()->shutdown ();
+}
+
+int
+Test_ECG::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "Shutting down the multiple EC test\n"));
+
+ if (this->rmt_name_ != 0)
+ {
+ this->ecg_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ TAO_ORB_Core_instance ()->orb ()->shutdown ();
+ return 0;
+}
+
+void
+Test_ECG::dump_results (void)
+{
+ const int bufsize = 512;
+ char buf[bufsize];
+
+ int i;
+ for (i = 0; i < this->hp_consumers_; ++i)
+ {
+ ACE_OS::sprintf (buf, "HP%02d", i);
+ this->dump_results (buf, this->stats_[i]);
+ }
+ for (i = 0; i < this->lp_consumers_; ++i)
+ {
+ ACE_OS::sprintf (buf, "LP%02d", i);
+ this->dump_results (buf, this->stats_[i + this->hp_consumers_]);
+ }
+ CORBA::ULong tmp = ACE_U64_TO_U32 (this->test_stop_ - this->test_start_);
+ double usec = tmp / 1000.0;
+ ACE_DEBUG ((LM_DEBUG, "Time[TOTAL]: %.3f\n", usec));
+}
+
+void
+Test_ECG::dump_results (const char* name, Stats& stats)
+{
+ // @@ We are reporting the information without specifics about
+ double usec = ACE_U64_TO_U32 (stats.total_time_) / 1000.0;
+ ACE_DEBUG ((LM_DEBUG, "Time[LCL,%s]: %.3f\n", name, usec));
+ int i;
+ for (i = 1; i < stats.lcl_count_ - 1; ++i)
+ {
+ usec = ACE_U64_TO_U32 (stats.lcl_latency_[i]) / 1000.0;
+ ACE_DEBUG ((LM_DEBUG, "Latency[LCL,%s]: %.3f\n", name, usec));
+
+ double percent = stats.laxity_[i] * 100.0;
+ ACE_DEBUG ((LM_DEBUG, "Laxity[LCL,%s]: %.3f\n", name, percent));
+
+ usec = ACE_U64_TO_U32 (stats.end_[i] - this->test_start_) / 1000.0;
+ ACE_DEBUG ((LM_DEBUG, "Completion[LCL,%s]: %.3f\n", name, usec));
+ }
+ for (i = 1; i < stats.rmt_count_ - 1; ++i)
+ {
+ double usec = ACE_U64_TO_U32 (stats.rmt_latency_[i]) / 1000.0;
+ ACE_DEBUG ((LM_DEBUG, "Latency[RMT,%s]: %.3f\n", name, usec));
+ }
+}
+
+int
+Test_ECG::local_source (RtecEventComm::EventSourceID id) const
+{
+ for (int i = 0; i < this->hp_suppliers_ + this->lp_suppliers_; ++i)
+ {
+ if (this->suppliers_[i]->supplier_id () == id)
+ return 1;
+ }
+ return 0;
+}
+
+int
+Test_ECG::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "l:r:s:i:xh:w:p:d:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'l':
+ this->lcl_name_ = get_opt.opt_arg ();
+ break;
+
+ case 'r':
+ this->rmt_name_ = get_opt.opt_arg ();
+ break;
+
+ case 's':
+ if (ACE_OS::strcasecmp (get_opt.opt_arg (), "global") == 0)
+ {
+ this->scheduling_type_ = Test_ECG::ss_global;
+ }
+ else if (ACE_OS::strcasecmp (get_opt.opt_arg (), "local") == 0)
+ {
+ this->scheduling_type_ = Test_ECG::ss_local;
+ }
+ else if (ACE_OS::strcasecmp (get_opt.opt_arg (), "runtime") == 0)
+ {
+ this->scheduling_type_ = Test_ECG::ss_runtime;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unknown scheduling type <%s> "
+ "defaulting to local\n",
+ get_opt.opt_arg ()));
+ this->scheduling_type_ = Test_ECG::ss_local;
+ }
+ break;
+
+ case 'x':
+ this->short_circuit_ = 1;
+ break;
+
+ case 'i':
+ {
+ char* aux = 0;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+ this->consumer_disconnects_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->supplier_disconnects_ = ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'h':
+ {
+ char* aux = 0;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->hp_suppliers_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hp_consumers_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hp_workload_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hp_interval_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hp_message_count_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hps_event_a_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hps_event_b_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hpc_event_a_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->hpc_event_b_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'w':
+ {
+ char* aux = 0;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->lp_suppliers_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lp_consumers_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lp_workload_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lp_interval_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lp_message_count_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lps_event_a_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lps_event_b_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lpc_event_a_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->lpc_event_b_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'p':
+ this->pid_file_name_ = get_opt.opt_arg ();
+ break;
+ case 'd':
+ this->schedule_file_ = get_opt.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[ORB options] "
+ "-l <local_name> "
+ "-r <remote_name> "
+ "-s <global|local|runtime> "
+ "-i <consumer disc.,supplier disc.> "
+ "-x (short circuit EC) "
+ "-h <high priority args> "
+ "-w <low priority args> "
+ "-p <pid file name> "
+ "-d <schedule file name> "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->hp_message_count_ < 0
+ || this->hp_message_count_ >= Test_ECG::MAX_EVENTS)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: HP event count (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->lp_message_count_,
+ 160));
+ this->hp_message_count_ = 160;
+ }
+
+ if (this->lp_message_count_ < 0
+ || this->lp_message_count_ >= Test_ECG::MAX_EVENTS)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: LP event count (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->lp_message_count_,
+ 4));
+ this->lp_message_count_ = 4;
+ }
+
+ if (this->hp_consumers_ <= 0
+ || this->lp_consumers_ < 0
+ || this->hp_consumers_ + this->lp_consumers_ >= Test_ECG::MAX_CONSUMERS
+ || this->hp_suppliers_ <= 0
+ || this->lp_suppliers_ < 0
+ || this->hp_suppliers_ + this->lp_suppliers_ >= Test_ECG::MAX_SUPPLIERS)
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "%s: number of consumers (low: %d, high: %d) or "
+ "suppliers (low: %d, high: %d) out of range\n",
+ argv[0],
+ lp_consumers_, hp_consumers_,
+ lp_suppliers_, lp_suppliers_), -1);
+ }
+
+ return 0;
+}
+
+Test_Supplier::Test_Supplier (Test_ECG *test,
+ void *cookie)
+ : test_ (test),
+ cookie_ (cookie),
+ consumer_ (this)
+{
+}
+
+void
+Test_Supplier::open (const char* name,
+ int event_a,
+ int event_b,
+ int message_count,
+ const RtecScheduler::Period_t& rate,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->event_a_ = event_a;
+ this->event_b_ = event_b;
+ this->message_count_ = message_count;
+
+ RtecScheduler::Scheduler_ptr server =
+ ACE_Scheduler_Factory::server ();
+
+ RtecScheduler::handle_t rt_info =
+ server->create (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The execution times are set to reasonable values, but
+ // actually they are changed on the real execution, i.e. we
+ // lie to the scheduler to obtain right priorities; but we
+ // don't care if the set is schedulable.
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ ACE_DEBUG ((LM_DEBUG, "register supplier \"%s\"\n", name));
+ server->set (rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ rate,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 1,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_id_ = ACE::crc32 (name);
+ ACE_DEBUG ((LM_DEBUG, "ID for <%s> is %04.4x\n", name,
+ this->supplier_id_));
+
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (this->supplier_id_,
+ this->event_a_,
+ rt_info, 1);
+ qos.insert (this->supplier_id_,
+ this->event_b_,
+ rt_info, 1);
+ qos.insert (this->supplier_id_,
+ ACE_ES_EVENT_SHUTDOWN,
+ rt_info, 1);
+
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushSupplier_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_->connect_push_supplier (objref.in (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_Supplier::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy =
+ this->consumer_proxy_._retn ();
+ proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Test_Supplier::activate (const char* name,
+ const RtecScheduler::Period_t& rate,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecScheduler::Scheduler_ptr server =
+ ACE_Scheduler_Factory::server ();
+
+ const int bufsize = 512;
+ char buf[bufsize];
+ ACE_OS::strcpy (buf, "consumer_");
+ ACE_OS::strcat (buf, name);
+ RtecScheduler::handle_t rt_info =
+ server->create (buf ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The execution times are set to reasonable values, but
+ // actually they are changed on the real execution, i.e. we
+ // lie to the scheduler to obtain right priorities; but we
+ // don't care if the set is schedulable.
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ ACE_DEBUG ((LM_DEBUG, "activate \"%s\"\n", buf));
+ server->set (rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ rate,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 1,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Also connect our consumer for timeout events from the EC.
+ int interval = rate / 10;
+ ACE_Time_Value tv_timeout (interval / ACE_ONE_SECOND_IN_USECS,
+ interval % ACE_ONE_SECOND_IN_USECS);
+ TimeBase::TimeT timeout;
+ ORBSVCS_Time::Time_Value_to_TimeT (timeout, tv_timeout);
+
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ timeout,
+ rt_info);
+
+ // = Connect as a consumer.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushConsumer_var cref =
+ this->consumer_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (
+ cref.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_Supplier::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+{
+#if 0
+ const int bufsize = 128;
+ char buf[bufsize];
+ ACE_OS::sprintf (buf, "Supplier %d receives event in thread: ",
+ this->supplier_id_);
+ print_priority_info (buf);
+#endif
+
+ if (events.length () == 0 || this->message_count_ < 0)
+ {
+ // ACE_DEBUG ((LM_DEBUG, "no events\n"));
+ return;
+ }
+
+ RtecEventComm::EventSet sent (events.length ());
+ sent.length (events.length ());
+
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ const RtecEventComm::Event& e = events[i];
+ if (e.header.type != ACE_ES_EVENT_INTERVAL_TIMEOUT)
+ continue;
+
+ // ACE_DEBUG ((LM_DEBUG, "Test_Supplier - timeout (%t)\n"));
+
+ RtecEventComm::Event& s = sent[i];
+ s.header.source = this->supplier_id_;
+ s.header.ttl = 1;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (s.header.creation_time, t);
+
+ this->message_count_--;
+
+ if (this->message_count_ < 0)
+ {
+ this->test_->shutdown_supplier (this->cookie_,
+ this->consumer_proxy_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (this->message_count_ % 2 == 0)
+ {
+ // Generate an A event...
+ s.header.type = this->event_a_;
+ }
+ else
+ {
+ s.header.type = this->event_b_;
+ }
+ }
+ this->test_->push_supplier (this->cookie_,
+ this->consumer_proxy_.in (),
+ sent
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Test_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ return;
+
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Test_Supplier::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+int Test_Supplier::supplier_id (void) const
+{
+ return this->supplier_id_;
+}
+
+Test_Consumer::Test_Consumer (Test_ECG *test,
+ void *cookie)
+ : test_ (test),
+ cookie_ (cookie)
+{
+}
+
+void
+Test_Consumer::open (const char* name,
+ int event_a, int event_b,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecScheduler::Scheduler_ptr server =
+ ACE_Scheduler_Factory::server ();
+
+ RtecScheduler::handle_t rt_info =
+ server->create (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The worst case execution time is far less than 2
+ // milliseconds, but that is a safe estimate....
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ ACE_DEBUG ((LM_DEBUG, "register consumer \"%s\"\n", name));
+ server->set (rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ 0,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ qos.insert_type (ACE_ES_EVENT_SHUTDOWN, rt_info);
+ qos.insert_type (event_a, rt_info);
+ qos.insert_type (event_b, rt_info);
+
+ // = Connect as a consumer.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushConsumer_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (objref.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_Consumer::close (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ return;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy =
+ this->supplier_proxy_._retn ();
+ proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+Test_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t arrival = ACE_OS::gethrtime ();
+ this->test_->push_consumer (this->cookie_, arrival, events ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Test_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+int
+main (int argc, char *argv [])
+{
+ Test_ECG *test;
+
+ // Dynamically allocate the Test_ECG instance so that we don't have
+ // to worry about running out of stack space if it's large.
+ ACE_NEW_RETURN (test,
+ Test_ECG,
+ -1);
+
+ const int status = test->run (argc, argv);
+
+ delete test;
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h
new file mode 100644
index 00000000000..4bf7784e0cd
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h
@@ -0,0 +1,387 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// This test attempts to communicate several Event Channels.
+// The test hardcodes all the objects involved (consumers,
+// suppliers, proxies, etc.); the objective is to gain understanding
+// on the architecture needed to exploit locality in the Event
+// cycle, not to provide a definite solution.
+//
+// ============================================================================
+
+#ifndef EC_MULTIPLE_H
+#define EC_MULTIPLE_H
+
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/High_Res_Timer.h"
+#include "ace/Condition_Thread_Mutex.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/Channel_Clients_T.h"
+#include "orbsvcs/Event/EC_Gateway_Sched.h"
+#include "orbsvcs/CosNamingC.h"
+
+class Test_ECG;
+
+class Test_Supplier : public POA_RtecEventComm::PushSupplier
+{
+ //
+ // = TITLE
+ // Helper class to implement the different tests within Test_ECG.
+ //
+ // = DESCRIPTION
+ // Test_ECG can be configured to have a single or multiple
+ // suppliers, to use the EC or short-circuit it, to use the
+ // Gateway or not; this class connects as a consumer for timeouts
+ // in the EC, at each timeout it delegates on the Test_ECG class
+ // to execute the proper test.
+public:
+ Test_Supplier (Test_ECG* test, void* cookie);
+
+ void open (const char* name,
+ int event_a, int event_b,
+ int message_count,
+ const RtecScheduler::Period_t& rate,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // This method connects the supplier to the EC.
+
+ void close (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ void activate (const char* name,
+ const RtecScheduler::Period_t& rate,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+
+ void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL);
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Implement the callbacks for our consumer personality.
+
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The methods in the skeleton.
+
+ RtecEventComm::EventSourceID supplier_id (void) const;
+ // The supplier ID.
+
+private:
+ Test_ECG* test_;
+
+ void *cookie_;
+ // The test provide us a cookie so we can give back our identity.
+
+ RtecEventComm::EventSourceID supplier_id_;
+ // We generate an id based on the name....
+
+ int event_a_;
+ int event_b_;
+ // The two types of events we may generate...
+
+ int message_count_;
+ // The number of events sent by this supplier.
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+ // We talk to the EC (as a supplier) using this proxy.
+
+ ACE_PushConsumer_Adapter<Test_Supplier> consumer_;
+ // We also connect to the EC as a consumer so we can receive the
+ // timeout events.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC (as a supplier) using this proxy.
+
+};
+
+class Test_Consumer : public POA_RtecEventComm::PushConsumer
+{
+ //
+ // = TITLE
+ // Helper class to implement the different tests within Test_ECG.
+ //
+ // = DESCRIPTION
+ // Test_ECG must collect events destined to many consumers, but
+ // needs to distinguish through which consumer it is receiving the
+ // event. The easiest way is to create a shallow class that
+ // forwards the events to the EC, but passing back some cookie to
+ // identify the consumer.
+public:
+ Test_Consumer (Test_ECG* test, void *cookie);
+
+ void open (const char* name,
+ int event_a, int event_b,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // This method connects the consumer to the EC.
+
+ void close (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+private:
+ Test_ECG* test_;
+ // The test class.
+
+ void *cookie_;
+ // The magic cookie that serves as our ID.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC using this proxy.
+};
+
+class Test_ECG
+{
+ //
+ // = TITLE
+ // Test and demonstrate the use of TAO_EC_Gateway.
+ //
+ // = DESCRIPTION
+ // This class is design to exercise several features of the EC_Gateway
+ // class and the multiple EC architecture.
+ // We want to create two EC, each one having a single supplier and a
+ // single consumer.
+ // + To test the remote facilities the consumer register for both a
+ // local event and a remote one.
+ // + To test the remote filtering features the remote consumer only
+ // wants one of the local events, and this event is generated less
+ // frequently.
+ //
+ // This class creates the local EC_Gateway a consumer and a
+ // supplier, it uses the command line to figure the subscriptions
+ // and publications list.
+ //
+public:
+ Test_ECG (void);
+
+ enum {
+ MAX_EVENTS = 1024,
+ // Maximum number of events to send...
+
+ MAX_CONSUMERS = 1024,
+ // Maximum number of consumers.
+
+ MAX_SUPPLIERS = 1024
+ // Maximum number of suppliers.
+ };
+
+ int run (int argc, char* argv[]);
+ // Execute the test.
+
+ void push_supplier (void* supplier_cookie,
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer,
+ const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Callback method for suppliers, we push for them to their
+ // consumers and take statistics on the way.
+ // It is possible that we ignore the <consumer> parameter when
+ // testing the short-circuit case.
+
+ void push_consumer (void* consumer_cookie,
+ ACE_hrtime_t arrival,
+ const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Callback method for consumers, if any of our consumers has
+ // received events it will invoke this method.
+
+ void shutdown_supplier (void* supplier_cookie,
+ RtecEventComm::PushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL);
+ // One of the suppliers has completed its work.
+
+private:
+ RtecEventChannelAdmin::EventChannel_ptr
+ get_ec (CosNaming::NamingContext_ptr naming_context,
+ const char* ec_name
+ ACE_ENV_ARG_DECL);
+ // Helper routine to obtain an EC given its name.
+
+ void connect_suppliers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect the suppliers.
+
+ void activate_suppliers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ // Activate the suppliers, i.e. they start generating events.
+
+ void connect_ecg (RtecEventChannelAdmin::EventChannel_ptr local_ec,
+ RtecEventChannelAdmin::EventChannel_ptr remote_ec,
+ RtecScheduler::Scheduler_ptr remote_sch
+ ACE_ENV_ARG_DECL);
+ // Connect the EC gateway, it builds the Subscriptions and the
+ // Publications list.
+
+ void connect_consumers (RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect and disconnect the consumers.
+
+ int shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Called when the main thread (i.e. not the scavenger thread) is
+ // shutting down.
+
+ int parse_args (int argc, char* argv[]);
+ // parse the command line args
+
+ void dump_results (void);
+ // Dump the results to the standard output.
+
+ void wait_until_ready (void);
+ // Block event delivery until all the consumers are ready.
+
+ struct Stats;
+ void dump_results (const char* name, Stats& stats);
+ // Dump the results for a particular consumer.
+
+ int local_source (RtecEventComm::EventSourceID id) const;
+ // Check if <id> correspond to a local supplier.
+
+ void shutdown_consumer (int id);
+ // One of the consumers has completed its work.
+
+private:
+ const char* lcl_name_;
+ // The name of the "local" EC.
+
+ const char* rmt_name_;
+ // The name of the "remote" EC.
+
+ TAO_EC_Gateway_Sched ecg_;
+ // The proxy used to connect both event channels.
+
+ enum {
+ ss_global,
+ ss_local,
+ ss_runtime
+ };
+ int scheduling_type_;
+ // The type of scheduling service to use:
+ // "global" is a remote scheduling service, usually to perform
+ // simultaneous scheduling across all the processes.
+ // "local" instantiate a local config time scheduling service.
+ // "runtime" instantiates a local rumtime scheduling service.
+
+ int consumer_disconnects_;
+ int supplier_disconnects_;
+ // How many times to disconnect the consumers (and suppliers) before
+ // the final connection. This is useful to test the disconnection in
+ // the EC.
+
+ int short_circuit_;
+ // Don't send the messages through the EC. This is needed to measure
+ // the overhead introduced by the EC.
+
+ Test_Supplier* suppliers_[Test_ECG::MAX_SUPPLIERS];
+ Test_Consumer* consumers_[Test_ECG::MAX_CONSUMERS];
+ // The suppliers and consumer arrays, the sizes are controlled using
+ // {lp,hp}_{suppliers,consumers}_
+
+ // @@ TODO it looks like the HP and LP data could be encapsulated.
+
+ int hp_suppliers_;
+ // The number of high priority suppliers in this test.
+
+ int hp_consumers_;
+ // The number of high priority consumers.
+
+ int hp_workload_;
+ // The number of iterations of ACE::is_prime() to execute in high
+ // priority consumers.
+
+ int hp_interval_;
+ // The high priority events are generated using this interval.
+
+ int hp_message_count_;
+ // How many messages we will send in the HP suppliers
+
+ int hps_event_a_;
+ int hps_event_b_;
+ int hpc_event_a_;
+ int hpc_event_b_;
+ // Each supplier send two types of events, each consumer receives
+ // two other types. The types for high-priority clients can be
+ // different from the types to low priority clients.
+
+ int lp_suppliers_;
+ // The number of low priority suppliers in this test.
+
+ int lp_consumers_;
+ // The number of low priority consumers.
+
+ int lp_workload_;
+ // The number of iterations of ACE::is_prime() to execute in low
+ // priority consumers.
+
+ int lp_interval_;
+ // The low priority events are generated using this interval.
+
+ int lp_message_count_;
+ // How many messages we will send in the LP suppliers
+
+ int lps_event_a_;
+ int lps_event_b_;
+ int lpc_event_a_;
+ int lpc_event_b_;
+ // Each supplier send two types of events, each consumer receives
+ // two other types. The types for high-priority clients can be
+ // different from the types to low priority clients.
+
+ const char* schedule_file_;
+ // Ask the schedule to compute and dump its schedule after the test
+ // execution.
+
+ const char* pid_file_name_;
+ // The name of a file where the process stores its pid
+
+ struct Stats {
+ ACE_hrtime_t total_time_;
+ float laxity_[MAX_EVENTS];
+ ACE_hrtime_t lcl_latency_[MAX_EVENTS];
+ ACE_hrtime_t end_[MAX_EVENTS];
+ int lcl_count_;
+ // We keep laxity and total_time stats only for the local events.
+
+ ACE_hrtime_t rmt_latency_[MAX_EVENTS];
+ int rmt_count_;
+ };
+ Stats stats_[Test_ECG::MAX_CONSUMERS];
+ // Store the measurements for local and remote events..
+
+ int ready_;
+ TAO_SYNCH_MUTEX ready_mtx_;
+ TAO_SYNCH_CONDITION ready_cnd_;
+ // Before accepting any events the suppliers must wait for the test
+ // to setup all the consumers.
+ // The suppliers wait on the condition variable.
+
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX,int> running_suppliers_;
+ // keep track of how many suppliers are still running so we shutdown
+ // at the right moment.
+
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX,int> running_consumers_;
+ // keep track of how many consumers are still running so we shutdown
+ // at the right moment.
+
+ ACE_hrtime_t test_start_;
+ ACE_hrtime_t test_stop_;
+ // Measure the test elapsed time as well as mark the beginning of
+ // the frames.
+};
+
+#endif /* EC_MULTIPLE_H */
diff --git a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.mpc b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.mpc
new file mode 100644
index 00000000000..fc410ce421e
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(EC_Multiple): rteventexe, rtevent_serv, rtschedevent, naming, iortable, messaging {
+ exename = EC_Multiple
+}
diff --git a/TAO/orbsvcs/tests/EC_Multiple/Makefile.am b/TAO/orbsvcs/tests/EC_Multiple/Makefile.am
new file mode 100644
index 00000000000..0f1ad4410cc
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/Makefile.am
@@ -0,0 +1,66 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.EC_Multiple.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS = EC_Multiple
+
+EC_Multiple_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+EC_Multiple_SOURCES = \
+ EC_Multiple.cpp \
+ EC_Multiple.h \
+ Scheduler_Runtime1.h \
+ Scheduler_Runtime2.h \
+ Scheduler_Runtime_Dynamic.h
+
+EC_Multiple_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSchedEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/EC_Multiple/README b/TAO/orbsvcs/tests/EC_Multiple/README
new file mode 100644
index 00000000000..14119bdfd87
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/README
@@ -0,0 +1,34 @@
+# $Id$
+
+ This test ilustrates how to connect multiple ECs; it has many
+options and can be configured to run a single EC, two ECs connected
+through a Gateway, short-circuit the EC, use a global, local or
+precomputed schedule, etc.
+
+ Please see the scripts for typical configurations.
+
+ A simple test is that uses a pre-computed schedule would be:
+
+# Run the Naming Service
+$ ../../Naming_Service/Naming_Service
+ -p NameService.pid -o NameService.ior
+# If the multicast location does not work for your use:
+#
+# NameService=`cat NameService.ior`
+# export NameService
+#
+# or other commands that suit your shell.
+#
+
+# Run the first EC, supplier generates events <1> and <2> consumer
+# subscribes to events <1> and <3>
+$ ./EC_Multiple -l ECM1 -r ECM2 -s runtime -p ECM1.pid \
+ -h 1,1,1,250000,100,1,2,1,3
+
+# Run the second EC, supplier generates events <4> and <3> consumer
+# subscribes to events <4> and <2>
+$ ./EC_Multiple -l ECM2 -r ECM1 -s runtime -p ECM2.pid \
+ -h 1,1,1,250000,100,4,3,4,2
+
+# Notice how the consumer receives both local and remote events, but
+# not all the local neither all the remote events.
diff --git a/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime1.h b/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime1.h
new file mode 100644
index 00000000000..a6de5dd6f1d
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime1.h
@@ -0,0 +1,162 @@
+// This file was automatically generated by Scheduler_Factory
+// before editing the file please consider generating it again
+// $Id$
+
+#include "orbsvcs/Scheduler_Factory.h"
+
+static ACE_Scheduler_Factory::POD_RT_Info runtime_infos_1[] = {
+{ "Reactor_Task-25000.us", 1, 0, 0, 0, 250000,
+ 4, 0, 0, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-50000.us", 2, 0, 0, 0, 500000,
+ 4, 0, 0, 1, 3, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-100000.us", 3, 0, 0, 0, 1000000,
+ 4, 0, 0, 1, 2, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-200000.us", 4, 0, 0, 0, 2000000,
+ 4, 0, 0, 1, 1, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-1000000.us", 5, 0, 0, 0, 10000000,
+ 4, 0, 0, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-25000.us", 6, 0, 0, 0, 0,
+ 4, 0, 0, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-50000.us", 7, 0, 0, 0, 0,
+ 4, 0, 0, 1, 3, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-100000.us", 8, 0, 0, 0, 0,
+ 4, 0, 0, 1, 2, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-200000.us", 9, 0, 0, 0, 0,
+ 4, 0, 0, 1, 1, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-1000000.us", 10, 0, 0, 0, 0,
+ 4, 0, 0, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_00@ECM1", 11, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_01@ECM1", 12, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_02@ECM1", 13, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_03@ECM1", 14, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_04@ECM1", 15, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_05@ECM1", 16, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_06@ECM1", 17, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_07@ECM1", 18, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_08@ECM1", 19, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_09@ECM1", 20, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_00@ECM1", 21, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_01@ECM1", 22, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_02@ECM1", 23, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_03@ECM1", 24, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_04@ECM1", 25, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ecg_ECM2@ECM1", 26, 5000, 5000, 5000, 250000,
+ 4, 0, 5000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ecg_ECM1@ECM1", 27, 5000, 5000, 5000, 250000,
+ 4, 0, 5000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_00@ECM1", 28, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_01@ECM1", 29, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_02@ECM1", 30, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_03@ECM1", 31, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_04@ECM1", 32, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_05@ECM1", 33, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_06@ECM1", 34, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_07@ECM1", 35, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_08@ECM1", 36, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_09@ECM1", 37, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_10@ECM1", 38, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_11@ECM1", 39, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_12@ECM1", 40, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_13@ECM1", 41, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_14@ECM1", 42, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_15@ECM1", 43, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_16@ECM1", 44, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_17@ECM1", 45, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_18@ECM1", 46, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_19@ECM1", 47, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_20@ECM1", 48, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_21@ECM1", 49, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_22@ECM1", 50, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_23@ECM1", 51, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_24@ECM1", 52, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_00@ECM1", 53, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_01@ECM1", 54, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_02@ECM1", 55, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_03@ECM1", 56, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_04@ECM1", 57, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_00@ECM1", 58, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_01@ECM1", 59, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_02@ECM1", 60, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_03@ECM1", 61, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_04@ECM1", 62, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_05@ECM1", 63, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_06@ECM1", 64, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_07@ECM1", 65, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_08@ECM1", 66, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_09@ECM1", 67, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_00@ECM1", 68, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_01@ECM1", 69, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_02@ECM1", 70, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_03@ECM1", 71, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_04@ECM1", 72, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0, (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED}
+};
+
+static int runtime_infos_1_size = sizeof(runtime_infos_1)/sizeof(runtime_infos_1[0]);
+
+static ACE_Scheduler_Factory::POD_Config_Info runtime_configs_1[] = {
+{ 0, 59, (RtecScheduler::Dispatching_Type_t) 0 }
+};
+static int runtime_configs_1_size = sizeof(runtime_configs_1)/sizeof(runtime_configs_1[0]);
+
+// EOF
+
diff --git a/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime2.h b/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime2.h
new file mode 100644
index 00000000000..44b87de3f80
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime2.h
@@ -0,0 +1,160 @@
+// This file was automatically generated by Scheduler_Factory
+// before editing the file please consider generating it again
+// $Id$
+
+#include "orbsvcs/Scheduler_Factory.h"
+
+static ACE_Scheduler_Factory::POD_RT_Info runtime_infos_2[] = {
+{ "Reactor_Task-25000.us", 1, 0, 0, 0, 250000,
+ 4, 0, 0, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-50000.us", 2, 0, 0, 0, 500000,
+ 4, 0, 0, 1, 3, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-100000.us", 3, 0, 0, 0, 1000000,
+ 4, 0, 0, 1, 2, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-200000.us", 4, 0, 0, 0, 2000000,
+ 4, 0, 0, 1, 1, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "Reactor_Task-1000000.us", 5, 0, 0, 0, 10000000,
+ 4, 0, 0, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-25000.us", 6, 0, 0, 0, 0,
+ 4, 0, 0, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-50000.us", 7, 0, 0, 0, 0,
+ 4, 0, 0, 1, 3, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-100000.us", 8, 0, 0, 0, 0,
+ 4, 0, 0, 1, 2, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-200000.us", 9, 0, 0, 0, 0,
+ 4, 0, 0, 1, 1, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ACE_ES_Dispatch_Queue-1000000.us", 10, 0, 0, 0, 0,
+ 4, 0, 0, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_00@ECM2", 11, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_01@ECM2", 12, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_02@ECM2", 13, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_03@ECM2", 14, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_04@ECM2", 15, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_05@ECM2", 16, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_06@ECM2", 17, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_07@ECM2", 18, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_08@ECM2", 19, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_supplier_09@ECM2", 20, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_00@ECM2", 21, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_01@ECM2", 22, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_02@ECM2", 23, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_03@ECM2", 24, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_supplier_04@ECM2", 25, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ecg_ECM2@ECM2", 26, 5000, 5000, 5000, 250000,
+ 4, 0, 5000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "ecg_ECM1@ECM2", 27, 5000, 5000, 5000, 250000,
+ 4, 0, 5000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_00@ECM2", 28, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_01@ECM2", 29, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_02@ECM2", 30, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_03@ECM2", 31, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_04@ECM2", 32, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_05@ECM2", 33, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_06@ECM2", 34, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_07@ECM2", 35, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_08@ECM2", 36, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_09@ECM2", 37, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_10@ECM2", 38, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_11@ECM2", 39, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_12@ECM2", 40, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_13@ECM2", 41, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_14@ECM2", 42, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_15@ECM2", 43, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_16@ECM2", 44, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_17@ECM2", 45, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_18@ECM2", 46, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_19@ECM2", 47, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_20@ECM2", 48, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_21@ECM2", 49, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_22@ECM2", 50, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_23@ECM2", 51, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "hp_consumer_24@ECM2", 52, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_00@ECM2", 53, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_01@ECM2", 54, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_02@ECM2", 55, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_03@ECM2", 56, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "lp_consumer_04@ECM2", 57, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_00@ECM2", 58, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_01@ECM2", 59, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_02@ECM2", 60, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_03@ECM2", 61, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_04@ECM2", 62, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_05@ECM2", 63, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_06@ECM2", 64, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_07@ECM2", 65, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_08@ECM2", 66, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_hp_supplier_09@ECM2", 67, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 4, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_00@ECM2", 68, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_01@ECM2", 69, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_02@ECM2", 70, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_03@ECM2", 71, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED},
+{ "consumer_lp_supplier_04@ECM2", 72, 20000, 20000, 20000, 10000000,
+ 4, 0, 20000, 1, 0, 0, 0, 0, (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED}
+};
+static int runtime_infos_2_size = sizeof(runtime_infos_2)/sizeof(runtime_infos_2[0]);
+
+static ACE_Scheduler_Factory::POD_Config_Info runtime_configs_2[] = {
+{ 0, 59, (RtecScheduler::Dispatching_Type_t) 0 }
+};
+static int runtime_configs_2_size = sizeof(runtime_configs_2)/sizeof(runtime_configs_2[0]);
+
+// EOF
diff --git a/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime_Dynamic.h b/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime_Dynamic.h
new file mode 100644
index 00000000000..86089e80ff4
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/Scheduler_Runtime_Dynamic.h
@@ -0,0 +1,1032 @@
+// This file was automatically generated by Scheduler_Factory
+// before editing the file please consider generating it again
+// $Id$
+
+#include "orbsvcs/Scheduler_Factory.h"
+
+static ACE_Scheduler_Factory::POD_RT_Info runtime_infos_3[] = {
+ { "Reactor_Task-25000.us", 1, 0, 0, 0, 250000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1022, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "Reactor_Task-50000.us", 2, 0, 0, 0, 500000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1020, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "Reactor_Task-100000.us", 3, 0, 0, 0, 1000000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1018, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "Reactor_Task-200000.us", 4, 0, 0, 0, 2000000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1016, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "Reactor_Task-1000000.us", 5, 0, 0, 0, 10000000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "hp_supplier_00@ECM3", 6, 20000, 20000, 20000, 2500000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 1, 59, 10, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_supplier_00@ECM3", 7, 20000, 20000, 20000, 2500000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 1, 59, 9, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "hp_consumer_00@ECM3", 8, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1012, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_00@ECM3", 9, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1011, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_01@ECM3", 10, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1010, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_02@ECM3", 11, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1009, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_03@ECM3", 12, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1008, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_04@ECM3", 13, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1007, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_05@ECM3", 14, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1006, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_06@ECM3", 15, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1005, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_07@ECM3", 16, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1004, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_08@ECM3", 17, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1003, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_09@ECM3", 18, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1002, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_10@ECM3", 19, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1001, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_11@ECM3", 20, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 1000, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_12@ECM3", 21, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 999, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_13@ECM3", 22, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 998, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_14@ECM3", 23, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 997, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_15@ECM3", 24, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 996, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_16@ECM3", 25, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 995, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_17@ECM3", 26, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 994, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_18@ECM3", 27, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 993, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_19@ECM3", 28, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 992, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_20@ECM3", 29, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 991, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_21@ECM3", 30, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 990, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_22@ECM3", 31, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 989, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_23@ECM3", 32, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 988, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_24@ECM3", 33, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 987, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_25@ECM3", 34, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 986, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_26@ECM3", 35, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 985, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_27@ECM3", 36, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 984, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_28@ECM3", 37, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 983, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_29@ECM3", 38, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 982, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_30@ECM3", 39, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 981, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_31@ECM3", 40, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 980, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_32@ECM3", 41, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 979, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_33@ECM3", 42, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 978, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_34@ECM3", 43, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 977, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_35@ECM3", 44, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 976, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_36@ECM3", 45, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 975, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_37@ECM3", 46, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 974, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_38@ECM3", 47, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 973, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_39@ECM3", 48, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 972, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_40@ECM3", 49, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 971, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_41@ECM3", 50, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 970, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_42@ECM3", 51, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 969, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_43@ECM3", 52, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 968, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_44@ECM3", 53, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 967, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_45@ECM3", 54, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 966, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_46@ECM3", 55, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 965, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_47@ECM3", 56, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 964, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_48@ECM3", 57, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 963, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_49@ECM3", 58, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 962, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_50@ECM3", 59, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 961, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_51@ECM3", 60, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 960, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_52@ECM3", 61, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 959, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_53@ECM3", 62, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 958, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_54@ECM3", 63, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 957, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_55@ECM3", 64, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 956, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_56@ECM3", 65, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 955, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_57@ECM3", 66, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 954, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_58@ECM3", 67, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 953, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_59@ECM3", 68, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 952, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_60@ECM3", 69, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 951, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_61@ECM3", 70, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 950, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_62@ECM3", 71, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 949, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_63@ECM3", 72, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 948, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_64@ECM3", 73, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 947, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_65@ECM3", 74, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 946, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_66@ECM3", 75, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 945, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_67@ECM3", 76, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 944, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_68@ECM3", 77, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 943, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_69@ECM3", 78, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 942, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_70@ECM3", 79, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 941, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_71@ECM3", 80, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 940, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_72@ECM3", 81, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 939, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_73@ECM3", 82, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 938, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_74@ECM3", 83, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 937, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_75@ECM3", 84, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 936, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_76@ECM3", 85, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 935, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_77@ECM3", 86, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 934, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_78@ECM3", 87, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 933, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_79@ECM3", 88, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 932, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_80@ECM3", 89, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 931, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_81@ECM3", 90, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 930, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_82@ECM3", 91, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 929, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_83@ECM3", 92, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 928, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_84@ECM3", 93, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 927, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_85@ECM3", 94, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 926, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_86@ECM3", 95, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 925, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_87@ECM3", 96, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 924, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_88@ECM3", 97, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 923, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_89@ECM3", 98, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 922, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_90@ECM3", 99, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 921, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_91@ECM3", 100, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 920, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_92@ECM3", 101, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 919, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_93@ECM3", 102, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 918, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_94@ECM3", 103, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 917, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_95@ECM3", 104, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 916, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_96@ECM3", 105, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 915, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_97@ECM3", 106, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 914, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_98@ECM3", 107, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 913, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_99@ECM3", 108, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 912, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_100@ECM3", 109, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 911, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_101@ECM3", 110, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 910, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_102@ECM3", 111, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 909, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_103@ECM3", 112, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 908, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_104@ECM3", 113, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 907, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_105@ECM3", 114, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 906, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_106@ECM3", 115, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 905, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_107@ECM3", 116, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 904, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_108@ECM3", 117, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 903, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_109@ECM3", 118, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 902, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_110@ECM3", 119, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 901, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_111@ECM3", 120, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 900, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_112@ECM3", 121, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 899, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_113@ECM3", 122, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 898, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_114@ECM3", 123, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 897, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_115@ECM3", 124, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 896, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_116@ECM3", 125, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 895, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_117@ECM3", 126, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 894, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_118@ECM3", 127, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 893, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_119@ECM3", 128, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 892, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_120@ECM3", 129, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 891, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_121@ECM3", 130, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 890, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_122@ECM3", 131, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 889, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_123@ECM3", 132, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 888, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_124@ECM3", 133, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 887, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_125@ECM3", 134, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 886, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_126@ECM3", 135, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 885, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_127@ECM3", 136, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 884, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_128@ECM3", 137, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 883, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_129@ECM3", 138, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 882, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_130@ECM3", 139, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 881, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_131@ECM3", 140, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 880, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_132@ECM3", 141, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 879, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_133@ECM3", 142, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 878, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_134@ECM3", 143, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 877, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_135@ECM3", 144, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 876, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_136@ECM3", 145, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 875, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_137@ECM3", 146, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 874, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_138@ECM3", 147, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 873, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_139@ECM3", 148, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 872, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_140@ECM3", 149, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 871, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_141@ECM3", 150, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 870, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_142@ECM3", 151, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 869, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_143@ECM3", 152, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 868, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_144@ECM3", 153, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 867, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_145@ECM3", 154, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 866, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_146@ECM3", 155, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 865, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_147@ECM3", 156, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 864, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_148@ECM3", 157, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 863, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_149@ECM3", 158, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 862, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_150@ECM3", 159, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 861, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_151@ECM3", 160, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 860, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_152@ECM3", 161, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 859, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_153@ECM3", 162, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 858, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_154@ECM3", 163, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 857, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_155@ECM3", 164, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 856, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_156@ECM3", 165, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 855, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_157@ECM3", 166, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 854, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_158@ECM3", 167, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 853, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_159@ECM3", 168, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 852, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_160@ECM3", 169, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 851, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_161@ECM3", 170, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 850, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_162@ECM3", 171, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 849, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_163@ECM3", 172, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 848, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_164@ECM3", 173, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 847, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_165@ECM3", 174, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 846, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_166@ECM3", 175, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 845, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_167@ECM3", 176, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 844, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_168@ECM3", 177, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 843, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_169@ECM3", 178, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 842, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_170@ECM3", 179, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 841, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_171@ECM3", 180, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 840, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_172@ECM3", 181, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 839, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_173@ECM3", 182, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 838, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_174@ECM3", 183, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 837, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_175@ECM3", 184, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 836, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_176@ECM3", 185, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 835, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_177@ECM3", 186, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 834, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_178@ECM3", 187, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 833, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_179@ECM3", 188, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 832, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_180@ECM3", 189, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 831, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_181@ECM3", 190, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 830, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_182@ECM3", 191, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 829, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_183@ECM3", 192, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 828, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_184@ECM3", 193, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 827, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_185@ECM3", 194, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 826, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_186@ECM3", 195, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 825, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_187@ECM3", 196, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 824, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_188@ECM3", 197, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 823, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_189@ECM3", 198, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 822, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_190@ECM3", 199, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 821, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_191@ECM3", 200, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 820, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_192@ECM3", 201, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 819, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_193@ECM3", 202, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 818, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_194@ECM3", 203, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 817, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_195@ECM3", 204, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 816, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_196@ECM3", 205, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 815, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_197@ECM3", 206, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 814, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_198@ECM3", 207, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 813, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_199@ECM3", 208, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 812, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_200@ECM3", 209, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 811, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_201@ECM3", 210, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 810, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_202@ECM3", 211, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 809, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_203@ECM3", 212, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 808, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_204@ECM3", 213, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 807, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_205@ECM3", 214, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 806, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_206@ECM3", 215, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 805, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_207@ECM3", 216, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 804, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_208@ECM3", 217, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 803, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_209@ECM3", 218, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 802, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_210@ECM3", 219, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 801, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_211@ECM3", 220, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 800, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_212@ECM3", 221, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 799, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_213@ECM3", 222, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 798, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_214@ECM3", 223, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 797, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_215@ECM3", 224, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 796, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_216@ECM3", 225, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 795, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_217@ECM3", 226, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 794, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_218@ECM3", 227, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 793, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_219@ECM3", 228, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 792, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_220@ECM3", 229, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 791, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_221@ECM3", 230, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 790, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_222@ECM3", 231, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 789, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_223@ECM3", 232, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 788, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_224@ECM3", 233, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 787, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_225@ECM3", 234, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 786, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_226@ECM3", 235, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 785, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_227@ECM3", 236, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 784, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_228@ECM3", 237, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 783, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_229@ECM3", 238, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 782, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_230@ECM3", 239, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 781, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_231@ECM3", 240, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 780, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_232@ECM3", 241, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 779, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_233@ECM3", 242, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 778, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_234@ECM3", 243, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 777, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_235@ECM3", 244, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 776, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_236@ECM3", 245, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 775, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_237@ECM3", 246, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 774, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_238@ECM3", 247, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 773, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_239@ECM3", 248, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 772, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_240@ECM3", 249, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 771, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_241@ECM3", 250, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 770, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_242@ECM3", 251, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 769, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_243@ECM3", 252, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 768, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_244@ECM3", 253, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 767, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_245@ECM3", 254, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 766, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_246@ECM3", 255, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 765, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_247@ECM3", 256, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 764, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_248@ECM3", 257, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 763, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_249@ECM3", 258, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 762, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_250@ECM3", 259, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 761, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_251@ECM3", 260, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 760, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_252@ECM3", 261, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 759, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_253@ECM3", 262, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 758, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_254@ECM3", 263, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 757, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_255@ECM3", 264, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 756, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_256@ECM3", 265, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 755, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_257@ECM3", 266, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 754, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_258@ECM3", 267, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 753, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_259@ECM3", 268, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 752, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_260@ECM3", 269, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 751, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_261@ECM3", 270, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 750, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_262@ECM3", 271, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 749, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_263@ECM3", 272, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 748, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_264@ECM3", 273, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 747, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_265@ECM3", 274, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 746, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_266@ECM3", 275, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 745, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_267@ECM3", 276, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 744, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_268@ECM3", 277, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 743, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_269@ECM3", 278, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 742, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_270@ECM3", 279, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 741, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_271@ECM3", 280, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 740, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_272@ECM3", 281, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 739, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_273@ECM3", 282, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 738, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_274@ECM3", 283, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 737, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_275@ECM3", 284, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 736, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_276@ECM3", 285, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 735, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_277@ECM3", 286, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 734, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_278@ECM3", 287, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 733, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_279@ECM3", 288, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 732, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_280@ECM3", 289, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 731, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_281@ECM3", 290, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 730, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_282@ECM3", 291, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 729, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_283@ECM3", 292, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 728, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_284@ECM3", 293, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 727, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_285@ECM3", 294, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 726, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_286@ECM3", 295, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 725, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_287@ECM3", 296, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 724, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_288@ECM3", 297, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 723, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_289@ECM3", 298, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 722, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_290@ECM3", 299, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 721, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_291@ECM3", 300, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 720, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_292@ECM3", 301, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 719, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_293@ECM3", 302, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 718, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_294@ECM3", 303, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 717, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_295@ECM3", 304, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 716, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_296@ECM3", 305, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 715, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_297@ECM3", 306, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 714, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_298@ECM3", 307, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 713, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_299@ECM3", 308, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 712, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_300@ECM3", 309, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 711, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_301@ECM3", 310, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 710, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_302@ECM3", 311, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 709, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_303@ECM3", 312, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 708, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_304@ECM3", 313, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 707, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_305@ECM3", 314, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 706, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_306@ECM3", 315, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 705, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_307@ECM3", 316, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 704, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_308@ECM3", 317, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 703, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_309@ECM3", 318, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 702, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_310@ECM3", 319, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 701, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_311@ECM3", 320, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 700, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_312@ECM3", 321, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 699, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_313@ECM3", 322, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 698, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_314@ECM3", 323, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 697, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_315@ECM3", 324, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 696, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_316@ECM3", 325, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 695, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_317@ECM3", 326, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 694, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_318@ECM3", 327, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 693, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_319@ECM3", 328, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 692, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_320@ECM3", 329, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 691, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_321@ECM3", 330, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 690, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_322@ECM3", 331, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 689, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_323@ECM3", 332, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 688, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_324@ECM3", 333, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 687, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_325@ECM3", 334, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 686, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_326@ECM3", 335, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 685, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_327@ECM3", 336, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 684, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_328@ECM3", 337, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 683, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_329@ECM3", 338, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 682, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_330@ECM3", 339, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 681, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_331@ECM3", 340, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 680, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_332@ECM3", 341, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 679, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_333@ECM3", 342, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 678, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_334@ECM3", 343, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 677, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_335@ECM3", 344, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 676, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_336@ECM3", 345, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 675, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_337@ECM3", 346, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 674, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_338@ECM3", 347, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 673, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_339@ECM3", 348, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 672, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_340@ECM3", 349, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 671, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_341@ECM3", 350, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 670, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_342@ECM3", 351, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 669, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_343@ECM3", 352, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 668, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_344@ECM3", 353, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 667, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_345@ECM3", 354, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 666, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_346@ECM3", 355, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 665, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_347@ECM3", 356, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 664, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_348@ECM3", 357, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 663, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_349@ECM3", 358, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 662, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_350@ECM3", 359, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 661, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_351@ECM3", 360, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 660, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_352@ECM3", 361, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 659, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_353@ECM3", 362, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 658, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_354@ECM3", 363, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 657, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_355@ECM3", 364, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 656, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_356@ECM3", 365, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 655, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_357@ECM3", 366, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 654, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_358@ECM3", 367, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 653, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_359@ECM3", 368, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 652, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_360@ECM3", 369, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 651, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_361@ECM3", 370, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 650, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_362@ECM3", 371, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 649, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_363@ECM3", 372, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 648, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_364@ECM3", 373, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 647, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_365@ECM3", 374, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 646, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_366@ECM3", 375, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 645, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_367@ECM3", 376, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 644, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_368@ECM3", 377, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 643, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_369@ECM3", 378, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 642, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_370@ECM3", 379, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 641, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_371@ECM3", 380, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 640, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_372@ECM3", 381, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 639, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_373@ECM3", 382, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 638, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_374@ECM3", 383, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 637, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_375@ECM3", 384, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 636, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_376@ECM3", 385, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 635, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_377@ECM3", 386, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 634, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_378@ECM3", 387, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 633, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_379@ECM3", 388, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 632, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_380@ECM3", 389, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 631, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_381@ECM3", 390, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 630, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_382@ECM3", 391, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 629, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_383@ECM3", 392, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 628, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_384@ECM3", 393, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 627, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_385@ECM3", 394, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 626, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_386@ECM3", 395, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 625, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_387@ECM3", 396, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 624, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_388@ECM3", 397, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 623, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_389@ECM3", 398, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 622, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_390@ECM3", 399, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 621, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_391@ECM3", 400, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 620, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_392@ECM3", 401, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 619, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_393@ECM3", 402, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 618, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_394@ECM3", 403, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 617, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_395@ECM3", 404, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 616, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_396@ECM3", 405, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 615, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_397@ECM3", 406, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 614, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_398@ECM3", 407, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 613, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_399@ECM3", 408, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 612, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_400@ECM3", 409, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 611, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_401@ECM3", 410, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 610, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_402@ECM3", 411, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 609, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_403@ECM3", 412, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 608, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_404@ECM3", 413, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 607, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_405@ECM3", 414, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 606, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_406@ECM3", 415, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 605, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_407@ECM3", 416, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 604, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_408@ECM3", 417, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 603, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_409@ECM3", 418, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 602, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_410@ECM3", 419, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 601, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_411@ECM3", 420, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 600, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_412@ECM3", 421, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 599, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_413@ECM3", 422, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 598, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_414@ECM3", 423, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 597, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_415@ECM3", 424, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 596, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_416@ECM3", 425, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 595, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_417@ECM3", 426, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 594, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_418@ECM3", 427, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 593, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_419@ECM3", 428, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 592, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_420@ECM3", 429, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 591, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_421@ECM3", 430, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 590, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_422@ECM3", 431, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 589, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_423@ECM3", 432, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 588, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_424@ECM3", 433, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 587, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_425@ECM3", 434, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 586, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_426@ECM3", 435, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 585, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_427@ECM3", 436, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 584, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_428@ECM3", 437, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 583, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_429@ECM3", 438, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 582, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_430@ECM3", 439, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 581, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_431@ECM3", 440, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 580, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_432@ECM3", 441, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 579, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_433@ECM3", 442, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 578, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_434@ECM3", 443, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 577, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_435@ECM3", 444, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 576, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_436@ECM3", 445, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 575, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_437@ECM3", 446, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 574, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_438@ECM3", 447, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 573, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_439@ECM3", 448, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 572, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_440@ECM3", 449, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 571, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_441@ECM3", 450, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 570, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_442@ECM3", 451, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 569, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_443@ECM3", 452, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 568, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_444@ECM3", 453, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 567, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_445@ECM3", 454, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 566, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_446@ECM3", 455, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 565, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_447@ECM3", 456, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 564, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_448@ECM3", 457, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 563, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_449@ECM3", 458, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 562, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_450@ECM3", 459, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 561, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_451@ECM3", 460, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 560, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_452@ECM3", 461, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 559, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_453@ECM3", 462, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 558, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_454@ECM3", 463, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 557, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_455@ECM3", 464, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 556, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_456@ECM3", 465, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 555, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_457@ECM3", 466, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 554, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_458@ECM3", 467, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 553, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_459@ECM3", 468, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 552, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_460@ECM3", 469, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 551, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_461@ECM3", 470, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 550, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_462@ECM3", 471, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 549, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_463@ECM3", 472, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 548, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_464@ECM3", 473, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 547, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_465@ECM3", 474, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 546, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_466@ECM3", 475, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 545, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_467@ECM3", 476, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 544, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_468@ECM3", 477, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 543, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_469@ECM3", 478, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 542, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_470@ECM3", 479, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 541, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_471@ECM3", 480, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 540, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_472@ECM3", 481, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 539, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_473@ECM3", 482, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 538, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_474@ECM3", 483, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 537, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_475@ECM3", 484, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 536, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_476@ECM3", 485, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 535, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_477@ECM3", 486, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 534, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_478@ECM3", 487, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 533, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_479@ECM3", 488, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 532, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_480@ECM3", 489, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 531, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_481@ECM3", 490, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 530, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_482@ECM3", 491, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 529, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_483@ECM3", 492, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 528, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_484@ECM3", 493, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 527, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_485@ECM3", 494, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 526, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_486@ECM3", 495, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 525, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_487@ECM3", 496, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 524, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_488@ECM3", 497, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 523, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_489@ECM3", 498, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 522, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_490@ECM3", 499, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 521, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_491@ECM3", 500, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 520, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_492@ECM3", 501, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 519, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_493@ECM3", 502, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 518, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_494@ECM3", 503, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 517, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_495@ECM3", 504, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 516, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_496@ECM3", 505, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 515, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_497@ECM3", 506, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 514, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_498@ECM3", 507, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 513, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_499@ECM3", 508, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 512, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_500@ECM3", 509, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 511, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_501@ECM3", 510, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 510, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_502@ECM3", 511, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 509, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_503@ECM3", 512, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 508, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_504@ECM3", 513, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 507, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_505@ECM3", 514, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 506, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_506@ECM3", 515, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 505, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_507@ECM3", 516, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 504, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_508@ECM3", 517, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 503, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_509@ECM3", 518, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 502, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_510@ECM3", 519, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 501, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_511@ECM3", 520, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 500, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_512@ECM3", 521, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 499, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_513@ECM3", 522, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 498, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_514@ECM3", 523, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 497, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_515@ECM3", 524, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 496, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_516@ECM3", 525, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 495, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_517@ECM3", 526, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 494, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_518@ECM3", 527, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 493, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_519@ECM3", 528, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 492, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_520@ECM3", 529, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 491, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_521@ECM3", 530, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 490, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_522@ECM3", 531, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 489, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_523@ECM3", 532, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 488, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_524@ECM3", 533, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 487, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_525@ECM3", 534, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 486, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_526@ECM3", 535, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 485, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_527@ECM3", 536, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 484, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_528@ECM3", 537, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 483, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_529@ECM3", 538, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 482, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_530@ECM3", 539, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 481, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_531@ECM3", 540, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 480, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_532@ECM3", 541, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 479, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_533@ECM3", 542, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 478, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_534@ECM3", 543, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 477, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_535@ECM3", 544, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 476, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_536@ECM3", 545, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 475, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_537@ECM3", 546, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 474, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_538@ECM3", 547, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 473, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_539@ECM3", 548, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 472, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_540@ECM3", 549, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 471, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_541@ECM3", 550, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 470, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_542@ECM3", 551, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 469, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_543@ECM3", 552, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 468, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_544@ECM3", 553, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 467, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_545@ECM3", 554, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 466, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_546@ECM3", 555, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 465, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_547@ECM3", 556, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 464, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_548@ECM3", 557, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 463, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_549@ECM3", 558, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 462, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_550@ECM3", 559, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 461, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_551@ECM3", 560, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 460, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_552@ECM3", 561, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 459, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_553@ECM3", 562, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 458, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_554@ECM3", 563, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 457, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_555@ECM3", 564, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 456, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_556@ECM3", 565, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 455, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_557@ECM3", 566, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 454, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_558@ECM3", 567, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 453, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_559@ECM3", 568, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 452, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_560@ECM3", 569, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 451, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_561@ECM3", 570, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 450, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_562@ECM3", 571, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 449, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_563@ECM3", 572, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 448, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_564@ECM3", 573, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 447, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_565@ECM3", 574, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 446, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_566@ECM3", 575, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 445, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_567@ECM3", 576, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 444, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_568@ECM3", 577, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 443, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_569@ECM3", 578, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 442, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_570@ECM3", 579, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 441, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_571@ECM3", 580, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 440, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_572@ECM3", 581, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 439, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_573@ECM3", 582, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 438, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_574@ECM3", 583, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 437, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_575@ECM3", 584, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 436, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_576@ECM3", 585, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 435, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_577@ECM3", 586, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 434, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_578@ECM3", 587, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 433, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_579@ECM3", 588, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 432, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_580@ECM3", 589, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 431, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_581@ECM3", 590, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 430, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_582@ECM3", 591, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 429, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_583@ECM3", 592, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 428, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_584@ECM3", 593, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 427, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_585@ECM3", 594, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 426, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_586@ECM3", 595, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 425, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_587@ECM3", 596, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 424, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_588@ECM3", 597, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 423, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_589@ECM3", 598, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 422, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_590@ECM3", 599, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 421, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_591@ECM3", 600, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 420, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_592@ECM3", 601, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 419, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_593@ECM3", 602, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 418, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_594@ECM3", 603, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 417, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_595@ECM3", 604, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 416, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_596@ECM3", 605, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 415, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_597@ECM3", 606, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 414, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_598@ECM3", 607, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 413, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_599@ECM3", 608, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 412, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_600@ECM3", 609, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 411, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_601@ECM3", 610, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 410, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_602@ECM3", 611, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 409, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_603@ECM3", 612, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 408, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_604@ECM3", 613, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 407, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_605@ECM3", 614, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 406, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_606@ECM3", 615, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 405, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_607@ECM3", 616, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 404, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_608@ECM3", 617, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 403, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_609@ECM3", 618, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 402, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_610@ECM3", 619, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 401, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_611@ECM3", 620, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 400, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_612@ECM3", 621, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 399, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_613@ECM3", 622, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 398, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_614@ECM3", 623, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 397, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_615@ECM3", 624, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 396, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_616@ECM3", 625, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 395, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_617@ECM3", 626, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 394, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_618@ECM3", 627, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 393, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_619@ECM3", 628, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 392, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_620@ECM3", 629, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 391, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_621@ECM3", 630, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 390, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_622@ECM3", 631, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 389, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_623@ECM3", 632, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 388, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_624@ECM3", 633, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 387, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_625@ECM3", 634, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 386, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_626@ECM3", 635, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 385, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_627@ECM3", 636, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 384, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_628@ECM3", 637, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 383, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_629@ECM3", 638, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 382, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_630@ECM3", 639, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 381, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_631@ECM3", 640, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 380, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_632@ECM3", 641, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 379, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_633@ECM3", 642, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 378, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_634@ECM3", 643, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 377, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_635@ECM3", 644, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 376, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_636@ECM3", 645, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 375, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_637@ECM3", 646, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 374, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_638@ECM3", 647, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 373, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_639@ECM3", 648, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 372, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_640@ECM3", 649, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 371, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_641@ECM3", 650, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 370, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_642@ECM3", 651, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 369, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_643@ECM3", 652, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 368, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_644@ECM3", 653, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 367, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_645@ECM3", 654, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 366, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_646@ECM3", 655, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 365, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_647@ECM3", 656, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 364, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_648@ECM3", 657, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 363, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_649@ECM3", 658, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 362, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_650@ECM3", 659, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 361, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_651@ECM3", 660, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 360, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_652@ECM3", 661, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 359, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_653@ECM3", 662, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 358, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_654@ECM3", 663, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 357, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_655@ECM3", 664, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 356, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_656@ECM3", 665, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 355, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_657@ECM3", 666, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 354, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_658@ECM3", 667, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 353, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_659@ECM3", 668, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 352, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_660@ECM3", 669, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 351, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_661@ECM3", 670, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 350, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_662@ECM3", 671, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 349, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_663@ECM3", 672, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 348, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_664@ECM3", 673, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 347, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_665@ECM3", 674, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 346, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_666@ECM3", 675, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 345, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_667@ECM3", 676, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 344, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_668@ECM3", 677, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 343, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_669@ECM3", 678, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 342, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_670@ECM3", 679, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 341, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_671@ECM3", 680, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 340, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_672@ECM3", 681, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 339, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_673@ECM3", 682, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 338, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_674@ECM3", 683, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 337, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_675@ECM3", 684, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 336, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_676@ECM3", 685, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 335, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_677@ECM3", 686, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 334, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_678@ECM3", 687, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 333, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_679@ECM3", 688, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 332, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_680@ECM3", 689, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 331, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_681@ECM3", 690, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 330, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_682@ECM3", 691, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 329, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_683@ECM3", 692, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 328, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_684@ECM3", 693, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 327, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_685@ECM3", 694, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 326, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_686@ECM3", 695, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 325, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_687@ECM3", 696, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 324, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_688@ECM3", 697, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 323, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_689@ECM3", 698, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 322, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_690@ECM3", 699, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 321, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_691@ECM3", 700, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 320, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_692@ECM3", 701, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 319, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_693@ECM3", 702, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 318, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_694@ECM3", 703, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 317, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_695@ECM3", 704, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 316, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_696@ECM3", 705, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 315, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_697@ECM3", 706, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 314, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_698@ECM3", 707, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 313, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_699@ECM3", 708, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 312, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_700@ECM3", 709, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 311, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_701@ECM3", 710, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 310, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_702@ECM3", 711, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 309, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_703@ECM3", 712, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 308, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_704@ECM3", 713, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 307, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_705@ECM3", 714, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 306, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_706@ECM3", 715, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 305, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_707@ECM3", 716, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 304, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_708@ECM3", 717, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 303, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_709@ECM3", 718, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 302, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_710@ECM3", 719, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 301, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_711@ECM3", 720, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 300, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_712@ECM3", 721, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 299, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_713@ECM3", 722, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 298, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_714@ECM3", 723, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 297, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_715@ECM3", 724, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 296, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_716@ECM3", 725, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 295, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_717@ECM3", 726, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 294, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_718@ECM3", 727, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 293, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_719@ECM3", 728, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 292, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_720@ECM3", 729, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 291, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_721@ECM3", 730, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 290, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_722@ECM3", 731, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 289, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_723@ECM3", 732, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 288, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_724@ECM3", 733, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 287, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_725@ECM3", 734, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 286, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_726@ECM3", 735, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 285, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_727@ECM3", 736, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 284, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_728@ECM3", 737, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 283, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_729@ECM3", 738, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 282, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_730@ECM3", 739, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 281, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_731@ECM3", 740, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 280, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_732@ECM3", 741, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 279, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_733@ECM3", 742, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 278, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_734@ECM3", 743, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 277, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_735@ECM3", 744, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 276, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_736@ECM3", 745, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 275, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_737@ECM3", 746, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 274, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_738@ECM3", 747, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 273, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_739@ECM3", 748, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 272, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_740@ECM3", 749, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 271, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_741@ECM3", 750, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 270, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_742@ECM3", 751, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 269, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_743@ECM3", 752, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 268, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_744@ECM3", 753, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 267, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_745@ECM3", 754, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 266, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_746@ECM3", 755, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 265, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_747@ECM3", 756, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 264, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_748@ECM3", 757, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 263, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_749@ECM3", 758, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 262, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_750@ECM3", 759, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 261, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_751@ECM3", 760, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 260, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_752@ECM3", 761, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 259, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_753@ECM3", 762, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 258, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_754@ECM3", 763, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 257, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_755@ECM3", 764, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 256, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_756@ECM3", 765, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 255, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_757@ECM3", 766, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 254, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_758@ECM3", 767, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 253, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_759@ECM3", 768, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 252, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_760@ECM3", 769, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 251, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_761@ECM3", 770, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 250, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_762@ECM3", 771, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 249, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_763@ECM3", 772, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 248, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_764@ECM3", 773, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 247, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_765@ECM3", 774, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 246, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_766@ECM3", 775, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 245, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_767@ECM3", 776, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 244, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_768@ECM3", 777, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 243, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_769@ECM3", 778, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 242, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_770@ECM3", 779, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 241, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_771@ECM3", 780, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 240, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_772@ECM3", 781, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 239, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_773@ECM3", 782, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 238, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_774@ECM3", 783, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 237, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_775@ECM3", 784, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 236, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_776@ECM3", 785, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 235, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_777@ECM3", 786, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 234, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_778@ECM3", 787, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 233, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_779@ECM3", 788, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 232, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_780@ECM3", 789, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 231, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_781@ECM3", 790, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 230, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_782@ECM3", 791, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 229, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_783@ECM3", 792, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 228, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_784@ECM3", 793, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 227, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_785@ECM3", 794, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 226, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_786@ECM3", 795, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 225, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_787@ECM3", 796, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 224, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_788@ECM3", 797, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 223, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_789@ECM3", 798, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 222, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_790@ECM3", 799, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 221, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_791@ECM3", 800, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 220, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_792@ECM3", 801, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 219, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_793@ECM3", 802, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 218, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_794@ECM3", 803, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 217, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_795@ECM3", 804, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 216, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_796@ECM3", 805, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 215, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_797@ECM3", 806, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 214, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_798@ECM3", 807, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 213, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_799@ECM3", 808, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 212, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_800@ECM3", 809, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 211, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_801@ECM3", 810, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 210, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_802@ECM3", 811, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 209, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_803@ECM3", 812, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 208, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_804@ECM3", 813, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 207, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_805@ECM3", 814, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 206, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_806@ECM3", 815, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 205, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_807@ECM3", 816, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 204, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_808@ECM3", 817, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 203, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_809@ECM3", 818, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 202, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_810@ECM3", 819, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 201, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_811@ECM3", 820, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 200, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_812@ECM3", 821, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 199, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_813@ECM3", 822, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 198, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_814@ECM3", 823, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 197, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_815@ECM3", 824, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 196, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_816@ECM3", 825, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 195, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_817@ECM3", 826, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 194, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_818@ECM3", 827, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 193, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_819@ECM3", 828, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 192, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_820@ECM3", 829, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 191, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_821@ECM3", 830, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 190, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_822@ECM3", 831, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 189, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_823@ECM3", 832, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 188, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_824@ECM3", 833, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 187, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_825@ECM3", 834, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 186, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_826@ECM3", 835, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 185, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_827@ECM3", 836, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 184, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_828@ECM3", 837, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 183, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_829@ECM3", 838, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 182, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_830@ECM3", 839, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 181, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_831@ECM3", 840, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 180, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_832@ECM3", 841, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 179, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_833@ECM3", 842, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 178, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_834@ECM3", 843, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 177, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_835@ECM3", 844, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 176, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_836@ECM3", 845, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 175, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_837@ECM3", 846, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 174, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_838@ECM3", 847, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 173, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_839@ECM3", 848, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 172, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_840@ECM3", 849, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 171, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_841@ECM3", 850, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 170, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_842@ECM3", 851, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 169, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_843@ECM3", 852, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 168, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_844@ECM3", 853, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 167, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_845@ECM3", 854, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 166, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_846@ECM3", 855, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 165, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_847@ECM3", 856, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 164, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_848@ECM3", 857, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 163, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_849@ECM3", 858, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 162, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_850@ECM3", 859, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 161, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_851@ECM3", 860, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 160, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_852@ECM3", 861, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 159, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_853@ECM3", 862, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 158, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_854@ECM3", 863, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 157, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_855@ECM3", 864, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 156, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_856@ECM3", 865, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 155, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_857@ECM3", 866, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 154, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_858@ECM3", 867, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 153, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_859@ECM3", 868, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 152, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_860@ECM3", 869, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 151, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_861@ECM3", 870, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 150, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_862@ECM3", 871, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 149, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_863@ECM3", 872, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 148, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_864@ECM3", 873, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 147, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_865@ECM3", 874, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 146, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_866@ECM3", 875, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 145, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_867@ECM3", 876, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 144, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_868@ECM3", 877, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 143, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_869@ECM3", 878, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 142, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_870@ECM3", 879, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 141, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_871@ECM3", 880, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 140, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_872@ECM3", 881, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 139, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_873@ECM3", 882, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 138, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_874@ECM3", 883, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 137, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_875@ECM3", 884, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 136, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_876@ECM3", 885, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 135, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_877@ECM3", 886, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 134, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_878@ECM3", 887, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 133, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_879@ECM3", 888, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 132, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_880@ECM3", 889, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 131, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_881@ECM3", 890, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 130, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_882@ECM3", 891, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 129, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_883@ECM3", 892, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 128, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_884@ECM3", 893, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 127, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_885@ECM3", 894, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 126, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_886@ECM3", 895, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 125, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_887@ECM3", 896, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 124, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_888@ECM3", 897, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 123, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_889@ECM3", 898, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 122, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_890@ECM3", 899, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 121, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_891@ECM3", 900, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 120, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_892@ECM3", 901, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 119, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_893@ECM3", 902, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 118, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_894@ECM3", 903, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 117, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_895@ECM3", 904, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 116, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_896@ECM3", 905, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 115, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_897@ECM3", 906, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 114, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_898@ECM3", 907, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 113, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_899@ECM3", 908, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 112, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_900@ECM3", 909, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 111, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_901@ECM3", 910, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 110, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_902@ECM3", 911, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 109, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_903@ECM3", 912, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 108, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_904@ECM3", 913, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 107, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_905@ECM3", 914, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 106, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_906@ECM3", 915, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 105, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_907@ECM3", 916, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 104, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_908@ECM3", 917, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 103, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_909@ECM3", 918, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 102, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_910@ECM3", 919, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 101, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_911@ECM3", 920, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 100, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_912@ECM3", 921, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 99, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_913@ECM3", 922, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 98, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_914@ECM3", 923, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 97, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_915@ECM3", 924, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 96, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_916@ECM3", 925, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 95, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_917@ECM3", 926, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 94, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_918@ECM3", 927, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 93, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_919@ECM3", 928, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 92, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_920@ECM3", 929, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 91, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_921@ECM3", 930, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 90, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_922@ECM3", 931, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 89, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_923@ECM3", 932, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 88, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_924@ECM3", 933, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 87, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_925@ECM3", 934, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 86, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_926@ECM3", 935, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 85, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_927@ECM3", 936, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 84, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_928@ECM3", 937, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 83, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_929@ECM3", 938, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 82, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_930@ECM3", 939, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 81, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_931@ECM3", 940, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 80, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_932@ECM3", 941, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 79, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_933@ECM3", 942, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 78, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_934@ECM3", 943, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 77, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_935@ECM3", 944, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 76, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_936@ECM3", 945, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 75, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_937@ECM3", 946, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 74, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_938@ECM3", 947, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 73, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_939@ECM3", 948, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 72, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_940@ECM3", 949, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 71, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_941@ECM3", 950, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 70, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_942@ECM3", 951, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 69, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_943@ECM3", 952, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 68, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_944@ECM3", 953, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 67, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_945@ECM3", 954, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 66, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_946@ECM3", 955, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 65, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_947@ECM3", 956, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 64, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_948@ECM3", 957, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 63, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_949@ECM3", 958, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 62, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_950@ECM3", 959, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 61, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_951@ECM3", 960, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 60, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_952@ECM3", 961, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 59, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_953@ECM3", 962, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 58, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_954@ECM3", 963, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 57, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_955@ECM3", 964, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 56, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_956@ECM3", 965, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 55, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_957@ECM3", 966, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 54, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_958@ECM3", 967, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 53, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_959@ECM3", 968, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 52, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_960@ECM3", 969, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 51, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_961@ECM3", 970, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 50, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_962@ECM3", 971, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 49, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_963@ECM3", 972, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 48, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_964@ECM3", 973, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 47, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_965@ECM3", 974, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 46, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_966@ECM3", 975, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 45, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_967@ECM3", 976, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 44, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_968@ECM3", 977, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 43, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_969@ECM3", 978, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 42, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_970@ECM3", 979, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 41, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_971@ECM3", 980, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 40, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_972@ECM3", 981, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 39, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_973@ECM3", 982, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 38, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_974@ECM3", 983, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 37, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_975@ECM3", 984, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 36, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_976@ECM3", 985, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 35, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_977@ECM3", 986, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 34, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_978@ECM3", 987, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 33, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_979@ECM3", 988, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 32, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_980@ECM3", 989, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 31, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_981@ECM3", 990, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 30, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_982@ECM3", 991, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 29, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_983@ECM3", 992, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 28, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_984@ECM3", 993, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 27, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_985@ECM3", 994, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 26, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_986@ECM3", 995, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 25, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_987@ECM3", 996, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 24, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_988@ECM3", 997, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 23, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_989@ECM3", 998, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 22, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_990@ECM3", 999, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 21, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_991@ECM3", 1000, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 20, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_992@ECM3", 1001, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 19, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_993@ECM3", 1002, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 18, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_994@ECM3", 1003, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 17, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_995@ECM3", 1004, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 16, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_996@ECM3", 1005, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 15, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_997@ECM3", 1006, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 14, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_998@ECM3", 1007, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 13, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "lp_consumer_999@ECM3", 1008, 20000, 20000, 20000, 0, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 0, 59, 12, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "consumer_hp_supplier_00@ECM3", 1009, 20000, 20000, 20000, 2500000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 1, 59, 3, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "consumer_lp_supplier_00@ECM3", 1010, 20000, 20000, 20000, 2500000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 20000, 1, 59, 2, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "ACE_ES_Dispatch_Queue-25000.us", 1011, 0, 0, 0, 250000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1021, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "ACE_ES_Dispatch_Queue-50000.us", 1012, 0, 0, 0, 500000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1019, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "ACE_ES_Dispatch_Queue-100000.us", 1013, 0, 0, 0, 1000000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1017, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "ACE_ES_Dispatch_Queue-200000.us", 1014, 0, 0, 0, 2000000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 1015, 0, (RtecScheduler::Info_Type_t) 0 , (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED },
+{ "ACE_ES_Dispatch_Queue-1000000.us", 1015, 0, 0, 0, 10000000, (RtecScheduler::Criticality_t) 4, (RtecScheduler::Importance_t) 0, 0, 1, 59, 0, 0, (RtecScheduler::Info_Type_t) 0, (RtecScheduler::RT_Info_Enabled_Type_t) RtecScheduler::RT_INFO_ENABLED }
+};
+static int runtime_infos_3_size = sizeof(runtime_infos_3)/sizeof(runtime_infos_3[0]);
+
+static ACE_Scheduler_Factory::POD_Config_Info runtime_configs_3[] = {
+{ 0, 59, (RtecScheduler::Dispatching_Type_t) 2 }
+};
+static int runtime_configs_3_size = sizeof(runtime_configs_3)/sizeof(runtime_configs_3[0]);
+
+
+// EOF
diff --git a/TAO/orbsvcs/tests/EC_Multiple/dyn_plot b/TAO/orbsvcs/tests/EC_Multiple/dyn_plot
new file mode 100755
index 00000000000..ee3c5450ad0
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/dyn_plot
@@ -0,0 +1,77 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+#
+# Plots two lines, with min-max ranges, from two DYN.LCL.tbl files.
+#
+# The first three lines above let this script run without specifying the
+# full path to perl, as long as it is in the user's PATH.
+# Taken from perlrun man page.
+
+$usage="usage: $0 <first .tbl> <second .tbl>\n";
+
+########
+######## Process command line args.
+########
+while ( $#ARGV >= $[ && $ARGV[0] =~ /^-/ ) {
+ if ( $ARGV[0] eq '-?' ) {
+ print "$usage";
+ exit;
+ } else {
+ print STDERR "$0: unknown option $ARGV[0]\n";
+ die $usage;
+ }
+ shift;
+}
+
+die "$usage" unless $#ARGV == 1;
+$tbl1 = $ARGV[0];
+$tbl2 = $ARGV[1];
+
+########
+######## Plot separately for each number of suppliers.
+########
+&plot (1);
+
+
+sub extract {
+ my ($input, $suppliers, $output) = (@_);
+
+ open (INPUT, "$input") || die "$0: unable to open $input\n";
+ open (OUTPUT, "> $output") || die "$0: unable to open $output\n";
+
+ while (<INPUT>) {
+ if (/^$suppliers (\d+) ([\d.]+) ([\d.]+) (\d+) (\d+)/) {
+ print OUTPUT "$1 $4 $2 $3\n";
+ }
+ }
+
+ close OUTPUT;
+ close INPUT;
+}
+
+
+sub plot {
+ my ($suppliers) = (@_);
+
+ &extract ("$tbl1", $suppliers, "tmpS$suppliers-rms");
+ &extract ("$tbl2", $suppliers, "tmpS$suppliers-muf");
+
+ open (GNUPLOT, "| gnuplot") || die "$0: unable to open gnuplot\n";
+ print GNUPLOT "set xlabel 'Number of Consumers'\n";
+ print GNUPLOT "set ylabel 'Latency, usec'\n";
+ print GNUPLOT "set terminal postscript eps color\n";
+ print GNUPLOT "set output 'DYN.plot-S$suppliers.eps'\n";
+ print GNUPLOT "plot " .
+ "'tmpS$suppliers-rms' title 'RMS' w lines, " .
+ "'tmpS$suppliers-rms' using (\$1-0.05):2:3:4 " .
+ "notitle w errorbars, " .
+ "'tmpS$suppliers-muf' title 'MUF' w lines, " .
+ "'tmpS$suppliers-muf' using (\$1+0.05):2:3:4 " .
+ "notitle w errorbars\n";
+ close GNUPLOT;
+
+ unlink "tmpS$suppliers-rms", "tmpS$suppliers-muf";
+}
diff --git a/TAO/orbsvcs/tests/EC_Multiple/gen_dynamic b/TAO/orbsvcs/tests/EC_Multiple/gen_dynamic
new file mode 100755
index 00000000000..a1b80e258e6
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/gen_dynamic
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+HP_SUPPLIERS="1"
+LP_CONSUMERS="1 10 100 200 300 500 1000"
+
+for s in $HP_SUPPLIERS; do
+ echo Supplier = $s
+
+ for c in $LP_CONSUMERS; do
+ x=`expr $c - 1`
+ l=`printf %02.2d $x`
+ echo Consumer = $c, LAST = $l
+
+ echo DYN.LCL.S${s}.C${c}.log
+
+ ./histo.pl -k 'Latency\[LCL,HP00' DYN.LCL.S${s}.C${c}.log >DYN.LCL.S${s}.C${c}.FIRST.histo
+ ./histo.pl -k "Latency\[LCL,HP${l}" DYN.LCL.S${s}.C${c}.log >DYN.LCL.S${s}.C${c}.LAST.histo
+ ./histo.pl -k "Latency\[LCL,HP" DYN.LCL.S${s}.C${c}.log >DYN.LCL.S${s}.C${c}.histo
+ done
+done
+
+for f in DYN.*.histo; do
+ b=`basename $f .histo`
+ tail +3 $f | sort -n > ${b}.data
+done
+
+for i in LCL; do
+ grep Min DYN.${i}.*.FIRST.histo |
+ sed -e "s/DYN.$i.S//" -e 's/\.C/ /' -e 's/.FIRST.histo:/ /' -e 's/\,/ /g' |
+ awk '{print $1, $2, $4, $6, $8, $10}' |
+ sort -k 1n -k 2n > DYN.${i}.FIRST.tbl
+ grep Min DYN.${i}.*.LAST.histo |
+ sed -e "s/DYN.$i.S//" -e 's/\.C/ /' -e 's/.LAST.histo:/ /' -e 's/\,/ /g' |
+ awk '{print $1, $2, $4, $6, $8, $10}' |
+ sort -k 1n -k 2n > DYN.${i}.LAST.tbl
+ paste DYN.${i}.FIRST.tbl DYN.${i}.LAST.tbl |
+ awk '{print $1, $2, $3, $4, $5, $6, $9, $10, $11, $12}' > DYN.${i}.tbl
+done
+
+for i in LCL; do
+ grep Min `ls DYN.${i}.*.histo | grep -v FIRST | grep -v LAST` |
+ sed -e "s/DYN.$i.S//" -e 's/\.C/ /' -e 's/.histo:/ /' -e 's/\,/ /g' |
+ awk '{print $1, $2, $4, $6, $8, $10}' |
+ sort -k 1n -k 2n > DYN.${i}.tbl
+done
+
+for s in $HP_SUPPLIERS; do
+ gnuplot <<_EOF_
+ set grid xtics ytics
+ set ylabel "Relative frequency"
+ set xlabel "Latency (usecs) [$s suppliers, local events]"
+ set terminal postscript eps color
+ set output "DYN.LCL.S${s}.eps"
+ plot 'DYN.LCL.S${s}.C1.data' w i
+ set terminal x11
+ plot 'DYN.LCL.S${s}.C1.data' w i
+ pause 2
+_EOF_
+done
+
+for i in DYN.*.eps; do
+ b=`basename $i .eps`
+ gs -sDEVICE=jpeg -g640x480 -r110x110 -sNOPAUSE \
+ -sOutputFile="${b}.jpg" ${b}.eps quit.ps
+done
diff --git a/TAO/orbsvcs/tests/EC_Multiple/gen_latency b/TAO/orbsvcs/tests/EC_Multiple/gen_latency
new file mode 100755
index 00000000000..4d79000e45d
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/gen_latency
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+HP_SUPPLIERS="1 2 10"
+HP_CONSUMERS="1 5 10 20"
+
+for s in $HP_SUPPLIERS; do
+ echo Supplier = $s
+ ./histo.pl -k 'Latency\[LCL' LTC.ECM1.S${s}.*.log LTC.ECM2.S${s}.*.log >LTC.LCL.S${s}.histo
+ ./histo.pl -k 'Latency\[RMT' LTC.ECM1.S${s}.*.log LTC.ECM2.S${s}.*.log >LTC.RMT.S${s}.histo
+
+ for c in $HP_CONSUMERS; do
+ x=`expr $c - 1`
+ l=`printf %02.2d $x`
+ echo Consumer = $c, LAST = $l
+ ./histo.pl -k 'Latency\[LCL,HP00' LTC.ECM1.S${s}.C${c}.log LTC.ECM2.S${s}.C${c}.log >LTC.LCL.S${s}.C${c}.FIRST.histo
+ ./histo.pl -k 'Latency\[RMT,HP00' LTC.ECM1.S${s}.C${c}.log LTC.ECM2.S${s}.C${c}.log >LTC.RMT.S${s}.C${c}.FIRST.histo
+ ./histo.pl -k "Latency\[LCL,HP${l}" LTC.ECM1.S${s}.C${c}.log LTC.ECM2.S${s}.C${c}.log >LTC.LCL.S${s}.C${c}.LAST.histo
+ ./histo.pl -k "Latency\[RMT,HP${l}" LTC.ECM1.S${s}.C${c}.log LTC.ECM2.S${s}.C${c}.log >LTC.RMT.S${s}.C${c}.LAST.histo
+
+ ./histo.pl -k "Latency\[LCL,HP" LTC.ECM1.S${s}.C${c}.log LTC.ECM2.S${s}.C${c}.log >LTC.LCL.S${s}.C${c}.histo
+ ./histo.pl -k "Latency\[RMT,HP" LTC.ECM1.S${s}.C${c}.log LTC.ECM2.S${s}.C${c}.log >LTC.RMT.S${s}.C${c}.histo
+
+ ./histo.pl -k 'Latency\[LCL,HP00' LTC.LCL.S${s}.C${c}.log >LTC.XLCL.S${s}.C${c}.FIRST.histo
+ ./histo.pl -k "Latency\[LCL,HP${l}" LTC.LCL.S${s}.C${c}.log >LTC.XLCL.S${s}.C${c}.LAST.histo
+ ./histo.pl -k "Latency\[LCL,HP" LTC.LCL.S${s}.C${c}.log >LTC.XLCL.S${s}.C${c}.histo
+ done
+done
+
+for f in LTC.*.histo; do
+ b=`basename $f .histo`
+ tail +3 $f | sort -n > ${b}.data
+done
+
+for i in XLCL; do
+ grep Min LTC.${i}.*.FIRST.histo |
+ sed -e "s/LTC.$i.S//" -e 's/\.C/ /' -e 's/.FIRST.histo:/ /' -e 's/\,/ /g' |
+ awk '{print $1, $2, $4, $6, $8, $10}' |
+ sort -k 1n -k 2n > LTC.${i}.FIRST.tbl
+ grep Min LTC.${i}.*.LAST.histo |
+ sed -e "s/LTC.$i.S//" -e 's/\.C/ /' -e 's/.LAST.histo:/ /' -e 's/\,/ /g' |
+ awk '{print $1, $2, $4, $6, $8, $10}' |
+ sort -k 1n -k 2n > LTC.${i}.LAST.tbl
+ paste LTC.${i}.FIRST.tbl LTC.${i}.LAST.tbl |
+ awk '{print $1, $2, $3, $4, $5, $6, $9, $10, $11, $12}' > LTC.${i}.tbl
+done
+
+for i in LCL RMT; do
+ grep Min `ls LTC.${i}.*.histo | grep -v FIRST | grep -v LAST` |
+ sed -e "s/LTC.$i.S//" -e 's/\.C/ /' -e 's/.histo:/ /' -e 's/\,/ /g' |
+ awk '{print $1, $2, $4, $6, $8, $10}' |
+ sort -k 1n -k 2n > LTC.${i}.tbl
+done
+
+paste LTC.LCL.tbl LTC.RMT.tbl |
+ awk '{print $1, $2, $3, $4, $5, $6, $9, $10, $11, $12}' > LTC.LCLRMT.tbl
+
+exit 0
+
+for s in $HP_SUPPLIERS; do
+ gnuplot <<_EOF_
+set grid xtics ytics
+set ylabel "Relative frequency"
+
+set xlabel "Latency (usecs) [$s suppliers, local events]"
+set terminal postscript eps color
+set output "LTC.LCL.S${s}.eps"
+plot 'LTC.LCL.S${s}.data' w i
+#set terminal x11
+#plot 'LTC.LCL.S${s}.data' w i
+#pause 2
+
+set xlabel "Time (usecs) [$s suppliers, remote events]"
+set terminal postscript eps
+set output "LTC.RMT.S${s}.eps"
+plot 'LTC.RMT.S${s}.data' w i
+#set terminal x11
+#plot 'LTC.RMT.S${s}.data' w i
+#pause 2
+
+_EOF_
+done
+
+for i in LTC.*.eps; do
+ b=`basename $i .eps`
+ gs -sDEVICE=jpeg -g640x480 -r110x110 -sNOPAUSE \
+ -sOutputFile="${b}.jpg" ${b}.eps quit.ps
+done
diff --git a/TAO/orbsvcs/tests/EC_Multiple/gen_overhead b/TAO/orbsvcs/tests/EC_Multiple/gen_overhead
new file mode 100755
index 00000000000..3f6cf50acd5
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/gen_overhead
@@ -0,0 +1,114 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+#TESTS_SOURCES="X LCL RMT1 RMT2 RPT.X RPT.LCL RPT.RMT1 RPT.RMT2"
+TESTS_SOURCES="RPT.X RPT.LCL RPT.RMT1 RPT.RMT2"
+
+#TESTS="$TEST_SOURCES RPT.RMT RMT"
+TESTS="$TEST_SOURCES RPT.RMT"
+
+for i in $TESTS_SOURCES; do
+ grep "Scavenger time" OVH.${i}.*.log |
+ sed -e "s/^OVH\.${i}\.//" -e 's/\.log:Scavenger time://' |
+ sort -n > OVH.${i}.scav.data
+ grep "Push time" OVH.${i}.*.log |
+ sed -e "s/^OVH\.${i}\.//" -e 's/\.log:Push time://' |
+ sort -n > OVH.${i}.push.data
+# | awk '{printf ("%d %.3f\n", $1, $2/$1);}'
+done
+
+paste scav.RMT1.data scav.RMT2.data |
+ awk '{printf("%d %.3f\n", $1, ($2 + $4)/2);}' > OVH.RMT.scav.data
+paste push.RMT1.data push.RMT2.data |
+ awk '{printf("%d %.3f\n", $1, ($2 + $4)/2);}' > OVH.RMT.push.data
+
+paste scav.RPT.RMT1.data scav.RPT.RMT2.data |
+ awk '{printf("%d %.3f\n", $1, ($2 + $4)/2);}' > OVH.RPT.RMT.scav.data
+paste push.RPT.RMT1.data push.RPT.RMT2.data |
+ awk '{printf("%d %.3f\n", $1, ($2 + $4)/2);}' > OVH.RPT.RMT.push.data
+
+for i in X LCL RMT RMT1 RMT2; do
+ paste OVH.${i}.scav.data OVH.${i}.push.data |
+ awk '{
+ if (NR == 1) {
+ b = $2;
+ } else {
+ printf ("%d %.3f\n", $1, ($2 - $4 - b) / $1);
+ }}' > OVH.${i}.over.data
+done
+
+for i in RPT.X RPT.LCL RPT.RMT RPT.RMT1 RPT.RMT2; do
+ paste OVH.${i}.scav.data OVH.${i}.push.data |
+ awk '{
+ printf ("%d %.3f\n", $1, ($2 - $4));
+ }' > OVH.${i}.over.data
+done
+
+for i in $TESTS; do
+ case $i in
+ X) LABEL="Number of Messages [short circuit test]"
+ ;;
+ LCL) LABEL="Number of Messages [local EC test]"
+ ;;
+ RMT) LABEL="Number of Messages [remote EC test]"
+ ;;
+ RMT1) LABEL="Number of Messages [remote EC test 1]"
+ ;;
+ RMT2) LABEL="Number of Messages [remote EC test 2]"
+ ;;
+ RPT.X) LABEL="Test Number [short circuit test]"
+ ;;
+ RPT.LCL) LABEL="Test Number [local EC test]"
+ ;;
+ RPT.RMT) LABEL="Test Number [remote EC test]"
+ ;;
+ RPT.RMT1) LABEL="Test Number [remote EC test 1]"
+ ;;
+ RPT.RMT2) LABEL="Test Number [remote EC test 2]"
+ ;;
+
+ *) LABEL="Test Number [unknown test]"
+ ;;
+ esac
+
+ gnuplot <<_EOF_
+set grid xtics ytics
+set xlabel "$LABEL"
+
+set terminal postscript eps color
+set ylabel "Time in scavenger (usecs)"
+set output "OVH.${i}.scav.eps"
+plot 'OVH.${i}.scav.data' w l
+set terminal x11
+plot 'OVH.${i}.scav.data' w l
+pause 2
+
+set terminal postscript eps
+set ylabel "Time in push (usecs)"
+set output "OVH.${i}.push.eps"
+plot 'OVH.${i}.push.data' w l
+set terminal x11
+plot 'OVH.${i}.push.data' w l
+pause 2
+
+set terminal postscript eps
+set ylabel "Overhead (usecs)"
+set output "OVH.${i}.over.eps"
+plot 'OVH.${i}.over.data' w l
+set terminal x11
+plot 'OVH.${i}.over.data' w l
+pause 2
+_EOF_
+done
+
+for i in OVH.push OVH.scav OVH.over; do
+ for j in $TESTS; do
+ gs -sDEVICE=jpeg -g640x480 -r110x110 -sNOPAUSE \
+ -sOutputFile="${i}.${j}.jpg" ${i}.${j}.eps quit.ps
+ done
+done
+
+exit 0
+
diff --git a/TAO/orbsvcs/tests/EC_Multiple/gen_throughput b/TAO/orbsvcs/tests/EC_Multiple/gen_throughput
new file mode 100755
index 00000000000..6dce32939d0
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/gen_throughput
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+HP_CONSUMERS="1 5 10 20"
+# The number of high priority consumers.
+
+HP_SUPPLIERS="1 2 10"
+# The number of high priority suppliers
+
+for s in $HP_SUPPLIERS; do
+ for c in $HP_CONSUMERS; do
+ grep TOTAL THR.LCL.S${s}.C${c}.*.log |
+ sed -e "s/THR.LCL.S${s}.C${c}.I//" -e 's/\.log:Time\[TOTAL\]://' |
+ nawk -v f=$s '{print 1000000 / $1, $2 * f / 500 / $1}' |
+ sort -n > THR.LCL.S${s}.C${c}.data
+ done
+done
+
+cat >/tmp/genthr.$$ <<EOF
+set grid xtics ytics
+set ylabel "Effective/Expected Event Rate"
+set xlabel "Event Rate (Hz)"
+set output "THR.LCL.eps"
+set terminal postscript eps color
+plot 1
+EOF
+for s in $HP_SUPPLIERS; do
+ for c in $HP_CONSUMERS; do
+ cat >>/tmp/genthr.$$ <<EOF
+replot 'THR.LCL.S${s}.C${c}.data' title "$s supp. $c cons." w l
+EOF
+ done
+done
+
+gnuplot < /tmp/genthr.$$
+
+for i in THR.*.eps; do
+ b=`basename $i .eps`
+ gs -sDEVICE=jpeg -g640x480 -r110x110 -sNOPAUSE \
+ -sOutputFile="${b}.jpg" ${b}.eps quit.ps
+done
diff --git a/TAO/orbsvcs/tests/EC_Multiple/gen_utilization b/TAO/orbsvcs/tests/EC_Multiple/gen_utilization
new file mode 100755
index 00000000000..f39760531f0
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/gen_utilization
@@ -0,0 +1,80 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+HP_WORKLOADS="60 65 70 72 74 76 78 80 81 82 83 84 85 86 87 88 89 90"
+
+
+for w in $HP_WORKLOADS; do
+ echo $w
+ ./histo.pl -k 'Laxity\[LCL,LP' UTL.LCL.${w}.log > UTL.XLCL.${w}.LP.histo
+ ./histo.pl -k 'Laxity\[LCL,HP' UTL.LCL.${w}.log > UTL.XLCL.${w}.HP.histo
+ ./histo.pl -k 'Laxity\[LCL,LP' UTL.ECM1.${w}.log UTL.ECM2.${w}.log > UTL.LCL.${w}.LP.histo
+ ./histo.pl -k 'Laxity\[LCL,HP' UTL.ECM1.${w}.log UTL.ECM2.${w}.log > UTL.LCL.${w}.HP.histo
+done
+
+HP_MSGS=200
+HP_CONSUMERS=1
+
+LP_WORKLOAD=500
+LP_MSGS=50
+LP_CONSUMERS=1
+
+WORK_USEC=118
+
+# awk '{print $1, 100 * ($1 * 200 + 500 * 50) * 118 / $2}' |
+
+grep 'Min' UTL.XLCL.*.LP.histo |
+ sed -e 's/UTL.XLCL.//' -e s'/.LP.histo:Min://' -e 's/,//g' |
+ awk '{print $1, $6, $2, $4}' |
+ sort -n > UTL.XLCL.LP.LAX.data
+
+grep 'Min' UTL.XLCL.*.HP.histo |
+ sed -e 's/UTL.XLCL.//' -e s'/.HP.histo:Min://' -e 's/,//g' |
+ awk '{print $1, $6, $2, $4}' |
+ sort -n > UTL.XLCL.HP.LAX.data
+
+grep 'Min' UTL.LCL.*.LP.histo |
+ sed -e 's/UTL.LCL.//' -e s'/.LP.histo:Min://' -e 's/,//g' |
+ awk '{print $1, $6, $2, $4}' |
+ sort -n > UTL.LCL.LP.LAX.data
+
+grep 'Min' UTL.LCL.*.HP.histo |
+ sed -e 's/UTL.LCL.//' -e s'/.HP.histo:Min://' -e 's/,//g' |
+ awk '{print $1, $6, $2, $4}' |
+ sort -n > UTL.LCL.HP.LAX.data
+
+cat UTL.LCL.LP.LAX.data |
+ awk '{print ($1 * 4 + 500) * 118 / 1000, $2, $3, $4}' > UTL.LCL.LP.data
+cat UTL.XLCL.LP.LAX.data |
+ awk '{print ($1 * 4 + 500) * 118 / 1000, $2, $3, $4}' > UTL.XLCL.LP.data
+cat UTL.LCL.HP.LAX.data |
+ awk '{print ($1 * 4 + 500) * 118 / 1000, $2, $3, $4}' > UTL.LCL.HP.data
+cat UTL.XLCL.HP.LAX.data |
+ awk '{print ($1 * 4 + 500) * 118 / 1000, $2, $3, $4}' > UTL.XLCL.HP.data
+
+exit 0
+
+gnuplot <<_EOF_
+set grid xtics ytics
+set terminal postscript eps color
+set xlabel "CPU Utilization (percentage)"
+
+set ylabel "Minimum laxity for low-priority task"
+set output "UTL.LCL.eps"
+plot 'UTL.LCL.data' w l
+#set terminal x11
+#plot 'UTL.LCL.data' w l
+#pause 2
+
+_EOF_
+
+for i in UTL.*.eps; do
+ b=`basename $i .eps`
+ gs -sDEVICE=jpeg -g640x480 -r110x110 -sNOPAUSE \
+ -sOutputFile="${b}.jpg" ${b}.eps quit.ps
+done
+
+grep 'Time\[LCL,HP' UTL.LCL.*.log | sed -e 's/UTL.LCL.//' -e s'/.log:Time\[.*\]://' | awk '{if ($1 != 0) {print $2 / $1 / 200}}'
+
diff --git a/TAO/orbsvcs/tests/EC_Multiple/histo.pl b/TAO/orbsvcs/tests/EC_Multiple/histo.pl
new file mode 100755
index 00000000000..dcd13f27320
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/histo.pl
@@ -0,0 +1,76 @@
+#
+# $Id$
+#
+# Extract a histogram, minimum, maximum and average from a file,
+# filtering by a given RE.
+#
+
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# The first three lines above let this script run without specifying the
+# full path to perl, as long as it is in the user's PATH.
+# Taken from perlrun man page.
+
+use Getopt::Std;
+
+$opt_k = 'Latency\[LCL,[A-Z]*\]';
+$opt_r = 1;
+
+getopts ('k:r:');
+
+$max = 0;
+$min = 0;
+$sum = 0;
+$sum2 = 0;
+$n = 0;
+%histo = ();
+
+while (<>) {
+ if (!m/^$opt_k/) {
+ next;
+ }
+ chop;
+ @f = split(/:/, $_);
+ if ($n == 0) {
+ $min = $f[1];
+ $max = $f[1];
+ $sum = $f[1];
+ $sum2 = $f[1] * $f[1];
+ $n = 1;
+ } else {
+ if ($min > $f[1]) {
+ $min = $f[1];
+ }
+ if ($max < $f[1]) {
+ $max = $f[1];
+ }
+ $sum += $f[1];
+ $sum2 += $f[1] * $f[1];
+ $n++;
+ }
+ $i = int ($f[1] * $opt_r);
+ $histo{"$i"}++;
+}
+
+print "Latency results for $opt_k:\n";
+$s2 = $sum2 / ($n - 1) - $sum / $n * $sum / ($n - 1);
+if ($s2 >= 0) {
+ $sigma = int(sqrt ( $s2 ));
+} else {
+ print "Error: $sum, $sum2, $n\n";
+ $sigma = $sum2;
+}
+
+print "Min: $min,",
+ " Max: $max,",
+ " Avg: ", int($sum / $n),
+ " Dev: ", $sigma,
+ "\n";
+
+while ( ($key,$value) = each %histo ) {
+ $t = ($key / $opt_r);
+ print $t, " ", 100 * $value / $n, "\n";
+}
+
diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_dynamic b/TAO/orbsvcs/tests/EC_Multiple/run_dynamic
new file mode 100755
index 00000000000..9a1e98fc31c
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/run_dynamic
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+# The number of messages to send.
+MSG_COUNT=100
+
+# The number of high-priority consumers.
+HP_CONSUMERS="1"
+
+# The number of high-priority suppliers
+HP_SUPPLIERS="1"
+
+# The number of low-priority consumers
+# LP_CONSUMERS="1 5 10 20"
+LP_CONSUMERS="1 10 100 200 300 500 1000"
+
+HP_INTERVAL=250000
+LP_INTERVAL=250000
+
+########
+######## Enable signal handler.
+########
+done=0
+trap 'done=1; \
+ if [ "$NameServicePID" ]; then \
+ kill -1 $NameServicePID; NameServicePID=; \
+ fi; \
+ /bin/rm -f NameService.ior' 0 1 2 3 15
+
+
+for s in $HP_SUPPLIERS; do
+ for c in $LP_CONSUMERS; do
+ ../../Naming_Service/Naming_Service \
+ -ORBobjrefstyle url -o NameService.ior >/dev/null 2>&1 &
+ NameServicePID=$!
+ sleep 2
+ while [ ! -f NameService.ior -a $done -eq 0 ]; do
+ echo waiting for NameService.ior; sleep 2
+ done
+ NameService=`cat NameService.ior`
+ export NameService
+
+ echo Consumers = $c Suppliers = $s
+# ./EC_Multiple -l ECM3 -s local -d sched \
+# -h ${s},${s},0,${HP_INTERVAL},${MSG_COUNT},1,2,1,2 \
+# -w 1,${c},0,${LP_INTERVAL},${MSG_COUNT},3,4,3,4 > \
+# DYN.LCL.S${s}.C${c}.log 2>&1
+ ./EC_Multiple -l ECM3 -s runtime \
+ -h ${s},${s},0,${HP_INTERVAL},${MSG_COUNT},1,2,1,2 \
+ -w 1,${c},0,${LP_INTERVAL},${MSG_COUNT},3,4,3,4 > \
+ DYN.LCL.S${s}.C${c}.log 2>&1
+
+ if [ $done -eq 1 ]; then exit 1; fi
+
+ kill -1 $NameServicePID; NameServicePID=
+ done
+done
diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_latency b/TAO/orbsvcs/tests/EC_Multiple/run_latency
new file mode 100755
index 00000000000..b387707ac5b
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/run_latency
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+# The number of messages to send.
+MSG_COUNT=100
+
+# The number of high-priority consumers.
+HP_CONSUMERS="1 5 10 20"
+
+# The number of high-priority suppliers
+HP_SUPPLIERS="1 2 10"
+
+HP_INTERVAL=250000
+
+/bin/rm -f NameService.ior NameService.pid EC1.pid EC2.pid EC.pid
+
+for s in $HP_SUPPLIERS; do
+ for c in $HP_CONSUMERS; do
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+
+ echo Consumers = $c Suppliers = $s
+ ./EC_Multiple -l ECM1 -p ECM1.pid -s runtime \
+ -h ${s},${c},0,${HP_INTERVAL},${MSG_COUNT},1,2,1,2 > \
+ LTC.LCL.S${s}.C${c}.log 2>&1
+ kill `cat NameService.pid`
+
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+
+ ./EC_Multiple -l ECM1 -r ECM2 -p ECM1.pid -s runtime \
+ -h ${s},${c},0,${HP_INTERVAL},${MSG_COUNT},1,2,1,3 > \
+ LTC.ECM1.S${s}.C${c}.log 2>&1 &
+ ./EC_Multiple -l ECM2 -r ECM1 -p ECM2.pid -s runtime \
+ -h ${s},${c},0,${HP_INTERVAL},${MSG_COUNT},4,3,4,2 > \
+ LTC.ECM2.S${s}.C${c}.log 2>&1 &
+ sleep 2
+ wait `cat ECM1.pid`
+ wait `cat ECM2.pid`
+ kill `cat NameService.pid`
+ done
+done
diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_overhead b/TAO/orbsvcs/tests/EC_Multiple/run_overhead
new file mode 100755
index 00000000000..bcafe566537
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/run_overhead
@@ -0,0 +1,113 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+MSG_INTERVAL=5000 # 50000
+# The interval between the messages, in usecs
+
+UTL_COUNT=50000 # 500000
+# The number of iterations in the scavenger thread; each iteration is
+# (roughly) 20 usecs (On a Sparc Ultra 30); and the number of
+# iterations must be high enough so all the messages are sent while
+# the scavenger is still running.
+
+MSG_COUNTS="1 50 100 150 200 250 300 350 400 450 500 550 600 650 700 "
+"750 800 850 900 950 1000"
+# The number of messages sent on each test...
+
+RPT_ITER="01 02 03 04 05 06 07 08 09 10"
+# The iterations for the final test.
+
+RPT_MSGS=1000
+# The number of messages in the final test.
+
+/bin/rm -f NameService.ior NameService.pid EC1.pid EC2.pid EC.pid
+
+for i in $RPT_ITER; do
+ echo Short circuit RPT test $i
+ sleep 1
+ ./EC_Multiple -l EC1 -s RUNTIME1 \
+ -a 1 -b 2 -c 2 -p EC1.pid -m $RPT_MSGS -u $UTL_COUNT \
+ -i $MSG_INTERVAL -x > OVH.RPT.X.${i}.log 2>&1
+
+ echo Local RPT EC test $i
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+ ./EC_Multiple -l EC1 -s RUNTIME1 \
+ -a 1 -b 2 -c 2 -p EC1.pid -m $RPT_MSGS -u $UTL_COUNT \
+ -i $MSG_INTERVAL > OVH.RPT.LCL.${i}.log 2>&1
+ kill `cat NameService.pid`
+
+ echo Remote RPT EC test $i
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+ ./EC_Multiple -l EC1 -r EC2 -s RUNTIME1 -o RUNTIME2 \
+ -a 1 -b 2 -c 3 -p EC1.pid -m $RPT_MSGS -u $UTL_COUNT \
+ -i $MSG_INTERVAL > OVH.RPT.RMT1.${i}.log 2>&1 &
+ ./EC_Multiple -l EC2 -r EC1 -s RUNTIME2 -o RUNTIME1 \
+ -a 4 -b 3 -c 2 -p EC2.pid -m $RPT_MSGS -u $UTL_COUNT \
+ -i $MSG_INTERVAL > OVH.RPT.RMT2.${i}.log 2>&1 &
+ sleep 2
+ wait `cat EC1.pid`
+ wait `cat EC2.pid`
+ kill `cat NameService.pid`
+ wait
+done
+
+exit 0
+
+# This tests prove that the overhead is linear on the number of
+# messages...
+
+# Generate the baseline data, i.e. shortcircuit the EC.
+
+for i in $MSG_COUNTS; do
+ echo Short circuit test $i
+ sleep 1
+ ./EC_Multiple -l EC1 -s RUNTIME1 \
+ -a 1 -b 2 -c 2 -m $i -u $UTL_COUNT \
+ -i $MSG_INTERVAL -x > OVH.X.${i}.log 2>&1
+done
+
+# Generate the local data, i.e. what is the overhead of using the local EC.
+for i in $MSG_COUNTS; do
+ echo Local EC test $i
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+ ./EC_Multiple -ORBport 0 -l EC1 -s RUNTIME1 \
+ -a 1 -b 2 -c 2 -m $i -u $UTL_COUNT \
+ -i $MSG_INTERVAL -p EC1.pid > OVH.LCL.${i}.log 2>&1
+ kill `cat NameService.pid`
+done
+
+# Generate the remote data, this test is much slower since the latency
+# can be as high as 2 msec
+for i in $MSG_COUNTS; do
+ echo Remote EC test $i
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+ ./EC_Multiple -l EC1 -r EC2 -s RUNTIME1 -o RUNTIME2 \
+ -a 1 -b 2 -c 3 -p EC1.pid -m $i -u $UTL_COUNT \
+ -i $MSG_INTERVAL > OVH.RMT1.${i}.log 2>&1 &
+ ./EC_Multiple -l EC2 -r EC1 -s RUNTIME2 -o RUNTIME1 \
+ -a 4 -b 3 -c 2 -p EC2.pid -m $i -u $UTL_COUNT \
+ -i $MSG_INTERVAL > OVH.RMT2.${i}.log 2>&1 &
+ sleep 2
+ wait `cat EC1.pid`
+ wait `cat EC2.pid`
+ kill `cat NameService.pid`
+ wait
+done
diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_schedule b/TAO/orbsvcs/tests/EC_Multiple/run_schedule
new file mode 100755
index 00000000000..7512b8914d1
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/run_schedule
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+# The number of high-priority messages to send.
+HP_MSG_COUNT=400
+
+# The number of high-priority consumers.
+HP_CONSUMERS=25
+
+# The number of high-priority suppliers
+HP_SUPPLIERS=10
+
+# The number of low-priority messages to send.
+LP_MSG_COUNT=10
+
+# The number of low-priority consumers.
+LP_CONSUMERS=5
+
+# The number of low-priority suppliers
+LP_SUPPLIERS=5
+
+/bin/rm -f NameService.ior NameService.pid EC1.pid EC2.pid EC.pid
+
+../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+sleep 2
+NameService=`cat NameService.ior`
+export NameService
+
+./EC_Multiple -l ECM1 -r ECM2 -p ECM1.pid \
+ -h ${HP_SUPPLIERS},${HP_CONSUMERS},1,${HP_MSG_COUNT},1,2,1,3 \
+ -w ${LP_SUPPLIERS},${LP_CONSUMERS},1,${LP_MSG_COUNT},4,5,4,5 \
+ -d SCHED_ECM1.cpp > SCH1.log 2>&1 &
+./EC_Multiple -l ECM2 -r ECM1 -p ECM2.pid \
+ -h ${HP_SUPPLIERS},${HP_CONSUMERS},1,${HP_MSG_COUNT},6,3,6,2 \
+ -w ${LP_SUPPLIERS},${LP_CONSUMERS},1,${LP_MSG_COUNT},7,8,7,8 \
+ -d SCHED_ECM2.cpp > SCH2.log 2>&1 &
+sleep 2
+wait `cat ECM1.pid`
+wait `cat ECM2.pid`
+kill `cat NameService.pid`
diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_test.pl b/TAO/orbsvcs/tests/EC_Multiple/run_test.pl
new file mode 100755
index 00000000000..704b47511d2
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$NS_ior = PerlACE::LocalFile ("NameService.ior");
+
+$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o $NS_ior");
+$T = new PerlACE::Process ("EC_Multiple",
+ "-ORBInitRef NameService=file://$NS_ior"
+ ." -s local");
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($NS_ior, 5) == -1) {
+ print STDERR "ERROR: waiting for naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+# This is a very simple test, no multiple consumers and no gateways.
+$test = $T->SpawnWaitKill (60);
+
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: naming service returned $nserver\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_throughput b/TAO/orbsvcs/tests/EC_Multiple/run_throughput
new file mode 100755
index 00000000000..4c922b89658
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/run_throughput
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $Id$
+#
+
+MSG_COUNT=500
+# The number of messages to send.
+
+HP_CONSUMERS="1 5 10 20"
+# The number of high priority consumers.
+
+HP_SUPPLIERS="1 2 10"
+# The number of high priority suppliers
+
+HP_INTERVALS="30000 25000 20000 19000 18000 17000 16000 15000 12000 10000"
+
+/bin/rm -f NameService.ior NameService.pid EC1.pid EC2.pid EC.pid
+
+for s in $HP_SUPPLIERS; do
+ for c in $HP_CONSUMERS; do
+ for i in $HP_INTERVALS; do
+ echo echo Supplier = $s Consumer = $c Interval = $i
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+
+ ./EC_Multiple -l ECM1 -p ECM1.pid -s runtime \
+ -h ${s},${c},0,${i},${MSG_COUNT},1,2,1,2 > \
+ THR.LCL.S${s}.C${c}.I${i}.log 2>&1
+ kill `cat NameService.pid`
+ done
+ done
+done
diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_utilization b/TAO/orbsvcs/tests/EC_Multiple/run_utilization
new file mode 100755
index 00000000000..4a40e6c7e06
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Multiple/run_utilization
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# $Id$
+
+HP_WORKLOADS="0 60 65 70 72 74 76 78 80 81 82 83 84 85 86 87 88 89 90"
+HP_MSGS=200
+HP_CONSUMERS=1
+HP_INTERVAL=25000
+
+LP_WORKLOAD=500
+LP_MSGS=50
+LP_CONSUMERS=1
+LP_INTERVAL=100000
+
+/bin/rm -f NameService.ior NameService.pid EC1.pid EC2.pid EC.pid
+
+# Generate the baseline data, i.e. shortcircuit the EC.
+
+for w in $HP_WORKLOADS; do
+ echo Local EC test $w
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+ ./EC_Multiple -l ECM1 -s runtime -p ECM1.pid \
+ -w 1,${LP_CONSUMERS},${LP_WORKLOAD},${LP_INTERVAL},${LP_MSGS},3,4,3,4 \
+ -h 1,${HP_CONSUMERS},${w},${HP_INTERVAL},${HP_MSGS},1,2,1,2 > \
+ UTL.LCL.${w}.log 2>&1
+
+ kill `cat NameService.pid`
+
+ ../../Naming_Service/Naming_Service \
+ -o NameService.ior -p NameService.pid >/dev/null 2>&1 &
+ sleep 2
+ NameService=`cat NameService.ior`
+ export NameService
+
+ ./EC_Multiple -l ECM1 -r ECM2 -s runtime -p ECM1.pid \
+ -w 1,${LP_CONSUMERS},${LP_WORKLOAD},${LP_INTERVAL},${LP_MSGS},1,2,1,3 \
+ -h 1,${HP_CONSUMERS},${w},${HP_INTERVAL},${HP_MSGS},4,5,4,6 > \
+ UTL.ECM1.${w}.log 2>&1 &
+ ./EC_Multiple -l ECM2 -r ECM1 -s runtime -p ECM2.pid \
+ -w 1,${LP_CONSUMERS},${LP_WORKLOAD},${LP_INTERVAL},${LP_MSGS},7,3,7,2 \
+ -h 1,${HP_CONSUMERS},${w},${HP_INTERVAL},${HP_MSGS},8,6,8,5 > \
+ UTL.ECM2.${w}.log 2>&1 &
+
+ sleep 2
+ wait `cat ECM1.pid`
+ wait `cat ECM2.pid`
+ kill `cat NameService.pid`
+
+done
+
+exit 0
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp
new file mode 100644
index 00000000000..ade2d62e17a
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.cpp
@@ -0,0 +1,183 @@
+// $Id$
+
+#include "ECT_Consumer.h"
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+
+ACE_RCSID (EC_Throughput,
+ ECT_Consumer,
+ "$Id$")
+
+Test_Consumer::Test_Consumer (ECT_Driver *driver,
+ void *cookie,
+ int n_suppliers)
+ : driver_ (driver),
+ cookie_ (cookie),
+ n_suppliers_ (n_suppliers),
+ recv_count_ (0),
+ shutdown_count_ (0)
+{
+}
+
+void
+Test_Consumer::connect (RtecScheduler::Scheduler_ptr scheduler,
+ const char* name,
+ int type_start,
+ int type_count,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ RtecScheduler::handle_t rt_info =
+ scheduler->create (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The worst case execution time is far less than 2
+ // milliseconds, but that is a safe estimate....
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ scheduler->set (rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ 0,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ qos.insert_type (ACE_ES_EVENT_SHUTDOWN, rt_info);
+ for (int i = 0; i != type_count; ++i)
+ {
+ qos.insert_type (type_start + i, rt_info);
+ }
+
+ // = Connect as a consumer.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushConsumer_var objref = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_->connect_push_consumer (objref.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ return;
+
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+
+ // Deactivate the servant
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_Consumer::dump_results (const char* name,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (name, gsf);
+}
+
+void
+Test_Consumer::accumulate (ACE_Throughput_Stats& stats) const
+{
+ stats.accumulate (this->throughput_);
+}
+
+void
+Test_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (events.length () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ECT_Consumer (%P|%t) no events\n"));
+ return;
+ }
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ // We start the timer as soon as we receive the first event...
+ if (this->recv_count_ == 0)
+ this->first_event_ = ACE_OS::gethrtime ();
+
+ this->recv_count_ += events.length ();
+
+ if (TAO_debug_level > 0
+ && this->recv_count_ % 100 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ECT_Consumer (%P|%t): %d events received\n",
+ this->recv_count_));
+ }
+
+ // ACE_DEBUG ((LM_DEBUG, "%d event(s)\n", events.length ()));
+
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ const RtecEventComm::Event& e = events[i];
+
+ if (e.header.type == ACE_ES_EVENT_SHUTDOWN)
+ {
+ this->shutdown_count_++;
+ if (this->shutdown_count_ >= this->n_suppliers_)
+ {
+ // We stop the timer as soon as we realize it is time to
+ // do so.
+ this->driver_->shutdown_consumer (this->cookie_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ {
+ ACE_hrtime_t creation;
+ ORBSVCS_Time::TimeT_to_hrtime (creation,
+ e.header.creation_time);
+
+ const ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->throughput_.sample (now - this->first_event_,
+ now - creation);
+ }
+ }
+}
+
+void
+Test_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.h b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.h
new file mode 100644
index 00000000000..6a086b38087
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer.h
@@ -0,0 +1,96 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// This test to measure how many events per minute can the EC
+// process, it also serves as an example how how to encode complex
+// data types in a octet sequence.
+//
+// ============================================================================
+
+#ifndef ECT_CONSUMER_H
+#define ECT_CONSUMER_H
+
+#include "ECT_Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Channel_Clients_T.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Task.h"
+#include "ace/OS_NS_time.h"
+
+class Test_Consumer : public POA_RtecEventComm::PushConsumer
+{
+ // = TITLE
+ // Receive the events.
+ //
+ // = DESCRIPTION
+ // This class is a consumer of events. It subscribes for a
+ // continous ranges of event types, this permits studying the
+ // effect of the number of subscriptions for each particular kind
+ // of event on the EC.
+ //
+public:
+ Test_Consumer (ECT_Driver* driver,
+ void* cookie,
+ int n_suppliers);
+
+ void connect (RtecScheduler::Scheduler_ptr scheduler,
+ const char* name,
+ int type_start,
+ int type_count,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // This method connects the consumer to the EC.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ void dump_results (const char* name,
+ ACE_UINT32 global_scale_factor);
+ // Print out the results
+
+ void accumulate (ACE_Throughput_Stats& stats) const;
+ // Add our throughput and latency statistics to <stats>
+
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The skeleton methods.
+
+private:
+ ECT_Driver* driver_;
+ // The main driver for the test.
+
+ void* cookie_;
+ // A magic cookie passed by the driver that we pass back in our
+ // callbacks.
+
+ int n_suppliers_;
+ // The number of suppliers that are feeding this consumer, we
+ // terminate once we receive a shutdown event from each supplier.
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+ // We talk to the EC using this proxy.
+
+ TAO_SYNCH_MUTEX lock_;
+ int recv_count_;
+ ACE_hrtime_t first_event_;
+ // How many events we have received.
+
+ ACE_Throughput_Stats throughput_;
+ // Used for reporting stats.
+
+ int shutdown_count_;
+ // How many shutdown events we have received.
+};
+
+#endif /* ECT_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp
new file mode 100644
index 00000000000..609bf639245
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.cpp
@@ -0,0 +1,377 @@
+// $Id$
+
+#include "ECT_Consumer_Driver.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Throughput,
+ ECT_Consumer_Driver,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ ECT_Consumer_Driver driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+ECT_Consumer_Driver::ECT_Consumer_Driver (void)
+ : n_consumers_ (1),
+ n_suppliers_ (1),
+ type_start_ (ACE_ES_EVENT_UNDEFINED),
+ type_count_ (1),
+ shutdown_event_channel_ (1),
+ pid_file_name_ (0),
+ active_count_ (0)
+{
+}
+
+ECT_Consumer_Driver::~ECT_Consumer_Driver (void)
+{
+}
+
+int
+ECT_Consumer_Driver::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " consumers = <%d>\n"
+ " suppliers = <%d>\n"
+ " type start = <%d>\n"
+ " type count = <%d>\n"
+ " pid file name = <%s>\n",
+
+ this->n_consumers_,
+ this->n_suppliers_,
+ this->type_start_,
+ this->type_count_,
+
+ this->pid_file_name_?this->pid_file_name_:"nil") );
+ }
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_file_name_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ int min_priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_FIFO);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ min_priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: user is not superuser, "
+ "so remain in time-sharing class\n", argv[0]));
+ else
+ ACE_ERROR ((LM_ERROR,
+ "%s: ACE_OS::sched_params failed\n", argv[0]));
+ }
+
+ if (ACE_OS::thr_setprio (min_priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "(%P|%t) main thr_setprio failed,"
+ "no real-time features\n"));
+ }
+
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name schedule_name (1);
+ schedule_name.length (1);
+ schedule_name[0].id = CORBA::string_dup ("ScheduleService");
+
+ CORBA::Object_var sched_obj =
+ naming_context->resolve (schedule_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (sched_obj.in ()))
+ return 1;
+ RtecScheduler::Scheduler_var scheduler =
+ RtecScheduler::Scheduler::_narrow (sched_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("EventService");
+
+ CORBA::Object_var ec_obj =
+ naming_context->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var channel;
+ if (CORBA::is_nil (ec_obj.in ()))
+ channel = RtecEventChannelAdmin::EventChannel::_nil ();
+ else
+ channel = RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect_consumers (scheduler.in (), channel.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected consumer(s)\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "running the test\n"));
+ for (;;)
+ {
+ ACE_Time_Value tv (1, 0);
+ this->orb_->perform_work (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 1);
+ if (this->active_count_ <= 0)
+ break;
+ }
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ this->dump_results ();
+
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->shutdown_event_channel_ != 0)
+ {
+ channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+ECT_Consumer_Driver::shutdown_consumer (void*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // int ID =
+ // (reinterpret_cast<Test_Consumer**> (consumer_cookie)
+ // - this->consumers_);
+ //
+ // ACE_DEBUG ((LM_DEBUG, "(%t) events received by consumer %d\n", ID));
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->active_count_--;
+}
+
+void
+ECT_Consumer_Driver::connect_consumers
+ (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL)
+{
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->active_count_ = this->n_consumers_;
+ }
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "consumer_%02d", i);
+
+ ACE_NEW (this->consumers_[i],
+ Test_Consumer (this,
+ this->consumers_ + i,
+ this->n_suppliers_));
+
+ this->consumers_[i]->connect (scheduler,
+ buf,
+ this->type_start_,
+ this->type_count_,
+ channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECT_Consumer_Driver::dump_results (void)
+{
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+
+ ACE_Throughput_Stats throughput;
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "consumer_%02d", i);
+
+ this->consumers_[i]->dump_results (buf, gsf);
+ this->consumers_[i]->accumulate (throughput);
+ }
+ throughput.dump_results ("ECT_Consumer/totals", gsf);
+}
+
+void
+ECT_Consumer_Driver::disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ this->consumers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ delete this->consumers_[i];
+ this->consumers_[i] = 0;
+ }
+}
+
+int
+ECT_Consumer_Driver::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "xdc:s:h:p:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'x':
+ this->shutdown_event_channel_ = 0;
+ break;
+
+ case 'c':
+ this->n_consumers_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 's':
+ this->n_suppliers_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'h':
+ {
+ char* aux;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->type_start_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->type_count_ = ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'p':
+ this->pid_file_name_ = get_opt.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[ORB options] "
+ "-d -x "
+ "-c <n_consumers> "
+ "-s <n_suppliers> "
+ "-h <type_start,type_count> "
+ "-p <pid file name> "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->n_suppliers_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: number of suppliers (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->n_suppliers_,
+ 1));
+ this->n_suppliers_ = 1;
+ }
+
+ if (this->n_consumers_ <= 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: number of consumers or "
+ "suppliers out of range\n", argv[0]), -1);
+ }
+
+ if (this->type_count_ <= 0)
+ {
+ this->type_count_ = 1;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: number of event types "
+ "suppliers out of range, reset to default (1)\n",
+ argv[0]), -1);
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.h b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.h
new file mode 100644
index 00000000000..4af70e0f7a8
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Consumer_Driver.h
@@ -0,0 +1,97 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// This test to measure how many events per minute can the EC
+// process, it also serves as an example how how to encode complex
+// data types in a octet sequence.
+//
+// ============================================================================
+
+#ifndef ECT_CONSUMER_DRIVER_H
+#define ECT_CONSUMER_DRIVER_H
+
+#include "ECT_Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ECT_Consumer.h"
+#include "orbsvcs/Channel_Clients_T.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Task.h"
+#include "ace/High_Res_Timer.h"
+
+class ECT_Consumer_Driver : public ECT_Driver
+{
+ //
+ // = TITLE
+ //
+ // = DESCRIPTION
+ //
+public:
+ ECT_Consumer_Driver (void);
+ virtual ~ECT_Consumer_Driver (void);
+
+ enum {
+ MAX_CONSUMERS = 16
+ // Maximum number of consumers.
+ };
+
+ int run (int argc, char* argv[]);
+ // Execute the test.
+
+ virtual void shutdown_consumer (void* consumer_cookie
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Callback method for consumers, each consumer will call this
+ // method once it receives all the shutdown events from the
+ // suppliers.
+
+private:
+ int parse_args (int argc, char* argv[]);
+ // parse the command line args
+
+ void connect_consumers (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect and disconnect the consumers.
+
+ void dump_results (void);
+ // Print out the results
+
+private:
+ Test_Consumer* consumers_[ECT_Consumer_Driver::MAX_CONSUMERS];
+ // The consumer array.
+
+ int n_consumers_;
+ // The number of consumers.
+
+ int n_suppliers_;
+ // How many suppliers are sending events, used for shutdown, each
+ // supplier sends a shutdown message after it finishes, the consumer
+ // finishes when all the suppliers do.
+
+ int type_start_;
+ int type_count_;
+ // We receive the events whose type is in the range
+ // [type_start,type_start+type_count)
+
+ int shutdown_event_channel_;
+ // If not zero it will shutdown the event channel upon exit.
+
+ const char* pid_file_name_;
+ // The name of a file where the process stores its pid
+
+ CORBA::ORB_var orb_;
+ // A reference to the ORB, to shut it down properly.
+
+ TAO_SYNCH_MUTEX lock_;
+ int active_count_;
+ // How many consumers are still receiving events.
+};
+
+#endif /* ECT_CONSUMER_DRIVER_H */
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.cpp
new file mode 100644
index 00000000000..0aaabaaa42e
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.cpp
@@ -0,0 +1,10 @@
+// $Id$
+
+#include "ECT_Driver.h"
+#include "ace/High_Res_Timer.h"
+
+ACE_RCSID(EC_Throughput, ECT_Driver, "$Id$")
+
+ECT_Driver::~ECT_Driver (void)
+{
+}
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.h b/TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.h
new file mode 100644
index 00000000000..1debc666c37
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Driver.h
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// Abstract base class for the test driver, this let us implement a
+// collocated and a non-collocated test.
+//
+// ============================================================================
+
+#ifndef ECT_DRIVER_H
+#define ECT_DRIVER_H
+
+#include "tao/orbconf.h"
+#include "ace/Stats.h"
+#include "ace/CORBA_macros.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace CORBA
+{
+ class Environment;
+}
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+class ECT_Driver
+{
+ //
+ // = TITLE
+ //
+ // = DESCRIPTION
+ //
+public:
+ virtual ~ECT_Driver (void);
+
+ virtual void shutdown_consumer (void* consumer_cookie
+ ACE_ENV_ARG_DECL_NOT_USED) = 0;
+ // Callback method for consumers, each consumer will call this
+ // method once it receives all the shutdown events from the
+ // suppliers.
+};
+
+#endif /* ECT_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Scheduler_Info.h b/TAO/orbsvcs/tests/EC_Throughput/ECT_Scheduler_Info.h
new file mode 100644
index 00000000000..591904a2129
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Scheduler_Info.h
@@ -0,0 +1,80 @@
+// This file was automatically generated by Scheduler_Factory
+// before editing the file please consider generating it again
+// $Id$
+
+#include "orbsvcs/Scheduler_Factory.h"
+
+static ACE_Scheduler_Factory::POD_RT_Info runtime_infos[] = {
+{ "Reactor_Task-25000.us", 1, 0, 0, 0, 250000,
+ 4, 0, 0, 1, 127, 0, 0, 0 },
+{ "Reactor_Task-50000.us", 2, 0, 0, 0, 500000,
+ 4, 0, 0, 1, 125, 0, 0, 0 },
+{ "Reactor_Task-100000.us", 3, 0, 0, 0, 1000000,
+ 4, 0, 0, 1, 123, 0, 0, 0 },
+{ "Reactor_Task-200000.us", 4, 0, 0, 0, 2000000,
+ 4, 0, 0, 1, 121, 0, 0, 0 },
+{ "Reactor_Task-1000000.us", 5, 0, 0, 0, 10000000,
+ 4, 0, 0, 1, 119, 0, 0, 0 },
+
+{ "ACE_ES_Dispatch_Queue-25000.us", 6, 0, 0, 0, 0,
+ 4, 0, 0, 1, 128, 0, 0, 0 },
+{ "ACE_ES_Dispatch_Queue-50000.us", 7, 0, 0, 0, 0,
+ 4, 0, 0, 1, 126, 0, 0, 0 },
+{ "ACE_ES_Dispatch_Queue-100000.us", 8, 0, 0, 0, 0,
+ 4, 0, 0, 1, 124, 0, 0, 0 },
+{ "ACE_ES_Dispatch_Queue-200000.us", 9, 0, 0, 0, 0,
+ 4, 0, 0, 1, 122, 0, 0, 0 },
+{ "ACE_ES_Dispatch_Queue-1000000.us", 10, 0, 0, 0, 0,
+ 4, 0, 0, 1, 120, 0, 0, 0 },
+
+{ "supplier_00", 11, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_01", 12, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_02", 13, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_03", 14, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_04", 15, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_05", 16, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_06", 17, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_07", 18, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_08", 19, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+{ "supplier_09", 20, 20000, 20000, 20000, 250000,
+ 4, 0, 20000, 1, 127, 0, 0, 0 },
+
+{ "consumer_00", 28, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_01", 29, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_02", 30, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_03", 31, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_04", 32, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_05", 33, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_06", 34, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_07", 35, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_08", 36, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 },
+{ "consumer_09", 37, 20000, 20000, 20000, 0,
+ 4, 0, 20000, 0, 128, 0, 0, 0 }
+};
+
+static int runtime_infos_size = sizeof(runtime_infos)/sizeof(runtime_infos[0]);
+
+static ACE_Scheduler_Factory::POD_Config_Info runtime_configs[] = {
+{ 0, 59, (RtecScheduler::Dispatching_Type_t) 0 }
+};
+static int runtime_configs_size = sizeof(runtime_configs)/sizeof(runtime_configs[0]);
+
+// EOF
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp
new file mode 100644
index 00000000000..0d75c42b29b
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp
@@ -0,0 +1,260 @@
+// $Id$
+
+#include "ECT_Supplier.h"
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/ACE.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Throughput,
+ ECT_Supplier,
+ "$Id$")
+
+Test_Supplier::Test_Supplier (ECT_Driver *driver)
+ : driver_ (driver),
+ supplier_ (this),
+ burst_count_ (0),
+ burst_size_ (0),
+ event_size_ (0),
+ burst_pause_ (0),
+ type_start_ (ACE_ES_EVENT_UNDEFINED),
+ type_count_ (1)
+{
+}
+
+void
+Test_Supplier::connect (RtecScheduler::Scheduler_ptr scheduler,
+ const char* name,
+ int burst_count,
+ int burst_size,
+ int event_size,
+ int burst_pause,
+ int type_start,
+ int type_count,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ this->burst_count_ = burst_count;
+ this->burst_size_ = burst_size;
+ this->event_size_ = event_size;
+ this->burst_pause_ = burst_pause;
+ this->type_start_ = type_start;
+ this->type_count_ = type_count;
+
+ RtecScheduler::handle_t rt_info =
+ scheduler->create (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_Time_Value tv (0, burst_pause);
+ RtecScheduler::Period_t rate = tv.usec () * 10;
+
+ // The execution times are set to reasonable values, but
+ // actually they are changed on the real execution, i.e. we
+ // lie to the scheduler to obtain right priorities; but we
+ // don't care if the set is schedulable.
+ tv.set (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ scheduler->set (rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ rate,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 1,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_id_ = ACE::crc32 (name);
+ ACE_DEBUG ((LM_DEBUG, "ID for <%s> is %04.4x\n", name,
+ this->supplier_id_));
+
+ ACE_SupplierQOS_Factory qos;
+ for (int i = 0; i != type_count; ++i)
+ {
+ qos.insert (this->supplier_id_,
+ type_start + i,
+ rt_info, 1);
+ }
+ qos.insert (this->supplier_id_,
+ ACE_ES_EVENT_SHUTDOWN,
+ rt_info, 1);
+
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventComm::PushSupplier_var objref =
+ this->supplier_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_->connect_push_supplier (objref.in (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Test_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ this->consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+
+ // Deactivate the servant
+ PortableServer::POA_var poa =
+ this->supplier_._default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (&this->supplier_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Test_Supplier::svc ()
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize a time value to pace the test
+ ACE_Time_Value tv (0, this->burst_pause_);
+
+ // Pre-allocate a message to send
+ ACE_Message_Block mb (this->event_size_);
+ mb.wr_ptr (this->event_size_);
+
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.source = this->supplier_id ();
+ event[0].header.ttl = 1;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time, t);
+
+ // We use replace to minimize the copies, this should result
+ // in just one memory allocation;
+#if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
+ event[0].data.payload.replace (this->event_size_,
+ &mb);
+#else
+ // If the replace method is not available, we will need
+ // to do the copy manually. First, set the octet sequence length.
+ event[0].data.payload.length (this->event_size_);
+
+ // Now copy over each byte.
+ char* base = mb.data_block ()->base ();
+ for(CORBA::ULong i = 0; i < (CORBA::ULong)this->event_size_; i++)
+ {
+ event[0].data.payload[i] = base[i];
+ }
+#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */
+
+ ACE_hrtime_t test_start = ACE_OS::gethrtime ();
+
+ for (int i = 0; i < this->burst_count_; ++i)
+ {
+ for (int j = 0; j < this->burst_size_; ++j)
+ {
+ event[0].header.type =
+ this->type_start_ + j % this->type_count_;
+
+ ACE_hrtime_t request_start = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
+ request_start);
+ // ACE_DEBUG ((LM_DEBUG, "(%t) supplier push event\n"));
+ this->consumer_proxy ()->push (event ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ ACE_hrtime_t end = ACE_OS::gethrtime ();
+ this->throughput_.sample (end - test_start,
+ end - request_start);
+ }
+
+ if (TAO_debug_level > 0
+ && i % 100 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ECT_Supplier (%P|%t): %d bursts sent\n",
+ i));
+ }
+
+ ACE_OS::sleep (tv);
+ }
+
+ // Send one event shutdown from each supplier
+ event[0].header.type = ACE_ES_EVENT_SHUTDOWN;
+ ACE_hrtime_t request_start = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
+ request_start);
+ this->consumer_proxy ()->push(event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_hrtime_t end = ACE_OS::gethrtime ();
+ this->throughput_.sample (end - test_start,
+ end - request_start);
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Supplier %4.4x completed\n",
+ this->supplier_id_));
+ return 0;
+}
+
+void
+Test_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+int Test_Supplier::supplier_id (void) const
+{
+ return this->supplier_id_;
+}
+
+RtecEventChannelAdmin::ProxyPushConsumer_ptr
+Test_Supplier::consumer_proxy (void)
+{
+ return this->consumer_proxy_.in ();
+}
+
+void
+Test_Supplier::dump_results (const char* name,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (name, gsf);
+}
+
+void
+Test_Supplier::accumulate (ACE_Throughput_Stats& stats) const
+{
+ stats.accumulate (this->throughput_);
+}
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.h b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.h
new file mode 100644
index 00000000000..17fbcb8ce02
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.h
@@ -0,0 +1,101 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// This is a helper class for the throughput tests of the Event
+// Channel.
+//
+// ============================================================================
+
+#ifndef ECT_SUPPLIER_H
+#define ECT_SUPPLIER_H
+
+#include "ECT_Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Channel_Clients_T.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/RtecSchedulerC.h"
+#include "ace/Task.h"
+
+class Test_Supplier : public ACE_Task<ACE_SYNCH>
+{
+ //
+ // = TITLE
+ // Simplifies the supplier task startup.
+ //
+ // = DESCRIPTION
+ //
+public:
+ Test_Supplier (ECT_Driver *driver);
+
+ int svc (void);
+ // Run the test, just forwards to the driver
+
+ void connect (RtecScheduler::Scheduler_ptr scheduler,
+ const char* name,
+ int burst_count,
+ int burst_size,
+ int event_size,
+ int burst_pause,
+ int type_start,
+ int type_count,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ // This method connects the supplier to the EC.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the EC.
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // The methods in the skeleton.
+
+ RtecEventComm::EventSourceID supplier_id (void) const;
+ // The supplier ID.
+
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer_proxy (void);
+ // We talk to the EC (as a supplier) using this proxy, no duplicates
+ // are done here...
+
+ void dump_results (const char* name,
+ ACE_UINT32 global_scale_factor);
+ // Dump the results...
+
+ void accumulate (ACE_Throughput_Stats& stats) const;
+ // Add our statistics to <stats>
+
+private:
+ ECT_Driver *driver_;
+ // Class we forward to.
+
+ void *cookie_;
+ // The test provide us a cookie so we can give back our identity.
+
+ RtecEventComm::EventSourceID supplier_id_;
+ // We generate an id based on the name....
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+ // We talk to the EC (as a supplier) using this proxy.
+
+ ACE_PushSupplier_Adapter<Test_Supplier> supplier_;
+ // We also connect to the EC as a consumer so we can receive the
+ // timeout events.
+
+ ACE_Throughput_Stats throughput_;
+ // Measure the elapsed time spent while sending the events.
+
+ int burst_count_;
+ int burst_size_;
+ int event_size_;
+ int burst_pause_;
+ int type_start_;
+ int type_count_;
+ // The test data.
+};
+
+#endif /* ECT_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp
new file mode 100644
index 00000000000..d2350ca9a04
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.cpp
@@ -0,0 +1,406 @@
+// $Id$
+
+#include "ECT_Supplier_Driver.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Throughput,
+ ECT_Supplier_Driver,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ ECT_Supplier_Driver driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+ECT_Supplier_Driver::ECT_Supplier_Driver (void)
+ : n_suppliers_ (1),
+ burst_count_ (10),
+ burst_size_ (100),
+ event_size_ (128),
+ burst_pause_ (100),
+ type_start_ (ACE_ES_EVENT_UNDEFINED),
+ type_count_ (1),
+ pid_file_name_ (0)
+{
+}
+
+ECT_Supplier_Driver::~ECT_Supplier_Driver (void)
+{
+}
+
+void
+ECT_Supplier_Driver::shutdown_consumer (void*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+int
+ECT_Supplier_Driver::run (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " suppliers = <%d>\n"
+ " burst count = <%d>\n"
+ " burst size = <%d>\n"
+ " event size = <%d>\n"
+ " burst pause = <%d>\n"
+ " type start = <%d>\n"
+ " type count = <%d>\n"
+ " pid file name = <%s>\n",
+
+ this->n_suppliers_,
+ this->burst_count_,
+ this->burst_size_,
+ this->event_size_,
+ this->burst_pause_,
+ this->type_start_,
+ this->type_count_,
+
+ this->pid_file_name_?this->pid_file_name_:"nil") );
+ }
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_file_name_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ int min_priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_FIFO);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ min_priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: user is not superuser, "
+ "so remain in time-sharing class\n", argv[0]));
+ else
+ ACE_ERROR ((LM_ERROR,
+ "%s: ACE_OS::sched_params failed\n", argv[0]));
+ }
+
+ if (ACE_OS::thr_setprio (min_priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "(%P|%t) main thr_setprio failed,"
+ "no real-time features\n"));
+ }
+
+ CORBA::Object_var naming_obj =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name schedule_name (1);
+ schedule_name.length (1);
+ schedule_name[0].id = CORBA::string_dup ("ScheduleService");
+
+ CORBA::Object_var sched_obj =
+ naming_context->resolve (schedule_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (sched_obj.in ()))
+ return 1;
+ RtecScheduler::Scheduler_var scheduler =
+ RtecScheduler::Scheduler::_narrow (sched_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("EventService");
+
+ CORBA::Object_var ec_obj =
+ naming_context->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var channel;
+ if (CORBA::is_nil (ec_obj.in ()))
+ channel = RtecEventChannelAdmin::EventChannel::_nil ();
+ else
+ channel = RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect_suppliers (scheduler.in (),
+ channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected supplier(s)\n"));
+
+ this->activate_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers are active\n"));
+
+ // Wait for the supplier threads...
+ if (ACE_Thread_Manager::instance ()->wait () == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Thread_Manager wait failed\n"));
+ return 1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers finished\n"));
+
+ this->dump_results ();
+
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers disconnected\n"));
+
+ // @@ Deactivate the suppliers (as CORBA Objects?)
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "orb and poa destroyed\n"));
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "NON SYS EX");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+ECT_Supplier_Driver::connect_suppliers
+ (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "supplier_%02d", i);
+
+ ACE_NEW (this->suppliers_[i], Test_Supplier (this));
+
+ this->suppliers_[i]->connect (scheduler,
+ buf,
+ this->burst_count_,
+ this->burst_size_,
+ this->event_size_,
+ this->burst_pause_,
+ this->type_start_,
+ this->type_count_,
+ channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECT_Supplier_Driver::activate_suppliers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->activate ();
+ }
+}
+
+void
+ECT_Supplier_Driver::disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ delete this->suppliers_[i];
+ this->suppliers_[i] = 0;
+ }
+}
+
+void
+ECT_Supplier_Driver::dump_results (void)
+{
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+
+ ACE_Throughput_Stats throughput;
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "supplier_%02d", i);
+
+ this->suppliers_[i]->dump_results (buf, gsf);
+ this->suppliers_[i]->accumulate (throughput);
+ }
+ throughput.dump_results ("ECT_Supplier/totals", gsf);
+}
+
+int
+ECT_Supplier_Driver::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "ds:u:n:t:b:h:p:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 's':
+ this->n_suppliers_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'u':
+ this->burst_count_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'n':
+ this->burst_size_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'b':
+ this->event_size_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 't':
+ this->burst_pause_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'h':
+ {
+ char* aux;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->type_start_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->type_count_ = ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'p':
+ this->pid_file_name_ = get_opt.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[ORB options] "
+ "-s <nsuppliers> "
+ "-u <burst count> "
+ "-n <burst size> "
+ "-b <event payload size> "
+ "-t <burst pause (usecs)> "
+ "-h <type_start,type_count> "
+ "-p <pid file name> "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->burst_count_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: burst count (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->burst_count_,
+ 100));
+ this->burst_count_ = 100;
+ }
+
+ if (this->burst_size_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: burst size (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->burst_size_,
+ 10));
+ this->burst_size_ = 10;
+ }
+
+ if (this->event_size_ < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: event size (%d) is out of range, "
+ "reseting to default (%d)\n",
+ argv[0], this->event_size_,
+ 128));
+ this->event_size_ = 128;
+ }
+
+ if (this->n_suppliers_ <= 0)
+ {
+ this->n_suppliers_ = 1;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: number of suppliers out of range, "
+ "reset to default (%d)\n",
+ argv[0], 1), -1);
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.h b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.h
new file mode 100644
index 00000000000..e51f0f73551
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier_Driver.h
@@ -0,0 +1,92 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// This is a helper class for the throughput tests of the Event
+// Channel.
+//
+// ============================================================================
+
+#ifndef ECT_SUPPLIER_DRIVER_H
+#define ECT_SUPPLIER_DRIVER_H
+
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/High_Res_Timer.h"
+#include "orbsvcs/Channel_Clients_T.h"
+#include "ECT_Driver.h"
+#include "ECT_Supplier.h"
+
+class ECT_Supplier_Driver : public ECT_Driver
+{
+ //
+ // = TITLE
+ //
+ // = DESCRIPTION
+ //
+public:
+ ECT_Supplier_Driver (void);
+ virtual ~ECT_Supplier_Driver (void);
+
+ virtual void shutdown_consumer (void* consumer_cookie
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Not used....
+
+ enum {
+ MAX_SUPPLIERS = 16
+ // Maximum number of suppliers.
+ };
+
+ int run (int argc, char* argv[]);
+ // Execute the test.
+
+private:
+ int parse_args (int argc, char* argv[]);
+ // parse the command line args
+
+ void connect_suppliers (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect the suppliers.
+
+ void activate_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // Activate the suppliers, i.e. they start generating events.
+
+ void dump_results (void);
+ // Dump the results for each supplier.
+
+private:
+ Test_Supplier* suppliers_[ECT_Supplier_Driver::MAX_SUPPLIERS];
+ // The suppliers array.
+
+ int n_suppliers_;
+ // The number of suppliers.
+
+ int burst_count_;
+ // How many bursts we will send from each supplier.
+
+ int burst_size_;
+ // The number of events
+
+ int event_size_;
+ // The size of the payload on each event.
+
+ int burst_pause_;
+ // The time between each event burst, in microseconds.
+
+ int type_start_;
+ int type_count_;
+ // We send two types of events, with different contents.
+
+ const char* pid_file_name_;
+ // The name of a file where the process stores its pid
+};
+
+#endif /* ECT_SUPPLIER_DRIVER_H */
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp
new file mode 100644
index 00000000000..8aeb5fbbc40
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp
@@ -0,0 +1,639 @@
+// $Id$
+
+#include "ECT_Throughput.h"
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Sched/Config_Scheduler.h"
+#include "orbsvcs/Runtime_Scheduler.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#include "tao/Timeprobe.h"
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Sched_Params.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID (EC_Throughput,
+ ECT_Throughput,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ECT_Throughput driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+ECT_Throughput::ECT_Throughput (void)
+ : n_consumers_ (1),
+ n_suppliers_ (1),
+ burst_count_ (10),
+ burst_size_ (100),
+ event_size_ (128),
+ burst_pause_ (100),
+ consumer_type_start_ (ACE_ES_EVENT_UNDEFINED),
+ consumer_type_count_ (1),
+ consumer_type_shift_ (0),
+ supplier_type_start_ (ACE_ES_EVENT_UNDEFINED),
+ supplier_type_count_ (1),
+ supplier_type_shift_ (0),
+ pid_file_name_ (0),
+ active_count_ (0),
+ ec_concurrency_hwm_ (1),
+ thr_create_flags_ (THR_NEW_LWP|THR_BOUND|THR_SCHED_FIFO)
+{
+}
+
+ECT_Throughput::~ECT_Throughput (void)
+{
+}
+
+int
+ECT_Throughput::run (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Calibrate the high resolution timer *before* starting the
+ // test.
+ ACE_High_Res_Timer::calibrate ();
+
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " consumers = <%d>\n"
+ " suppliers = <%d>\n"
+ " burst count = <%d>\n"
+ " burst size = <%d>\n"
+ " event size = <%d>\n"
+ " burst pause = <%d>\n"
+ " consumer type start = <%d>\n"
+ " consumer type count = <%d>\n"
+ " consumer type shift = <%d>\n"
+ " supplier type start = <%d>\n"
+ " supplier type count = <%d>\n"
+ " supplier type shift = <%d>\n"
+ " pid file name = <%s>\n"
+ " concurrency HWM = <%d>\n",
+
+ this->n_consumers_,
+ this->n_suppliers_,
+ this->burst_count_,
+ this->burst_size_,
+ this->event_size_,
+ this->burst_pause_,
+ this->consumer_type_start_,
+ this->consumer_type_count_,
+ this->consumer_type_shift_,
+ this->supplier_type_start_,
+ this->supplier_type_count_,
+ this->supplier_type_shift_,
+
+ this->pid_file_name_?this->pid_file_name_:"nil",
+ this->ec_concurrency_hwm_
+ ) );
+ }
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_file_name_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ int priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
+ priority);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: user is not superuser, "
+ "so remain in time-sharing class\n", argv[0]));
+ this->thr_create_flags_ = THR_NEW_LWP;
+ }
+ else
+ ACE_ERROR ((LM_ERROR,
+ "%s: ACE_OS::sched_params failed\n", argv[0]));
+ }
+
+ if (ACE_OS::thr_setprio (priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "(%P|%t) main thr_setprio failed,"
+ "no real-time features\n"));
+ }
+
+#if 1
+ ACE_Config_Scheduler scheduler_impl;
+#else
+#include "ECT_Scheduler_Info.h"
+ ACE_Runtime_Scheduler scheduler_impl (
+ runtime_configs_size,
+ runtime_configs,
+ runtime_infos_size,
+ runtime_infos);
+#endif
+ RtecScheduler::Scheduler_var scheduler =
+ scheduler_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if 0
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get the Naming Service.\n"),
+ 1);
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This is the name we (potentially) register the Scheduling
+ // Service in the Naming Service.
+ CosNaming::Name schedule_name (1);
+ schedule_name.length (1);
+ schedule_name[0].id = CORBA::string_dup ("ScheduleService");
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (scheduler.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "The (local) scheduler IOR is <%s>\n",
+ str.in ()));
+
+ // Register the servant with the Naming Context....
+ naming_context->rebind (schedule_name, scheduler.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::use_config (naming_context.in ());
+#endif /* 0 */
+
+ auto_ptr<POA_RtecEventChannelAdmin::EventChannel> ec_impl;
+
+ TAO_EC_Event_Channel_Attributes attr (root_poa.in (),
+ root_poa.in ());
+
+ TAO_EC_Event_Channel *ec =
+ new TAO_EC_Event_Channel (attr);
+
+ ec->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ auto_ptr<POA_RtecEventChannelAdmin::EventChannel> auto_ec_impl (ec);
+ ec_impl = auto_ec_impl;
+
+ RtecEventChannelAdmin::EventChannel_var channel =
+ ec_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->connect_consumers (scheduler.in (),
+ channel.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected consumer(s)\n"));
+
+ this->connect_suppliers (scheduler.in (),
+ channel.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "connected supplier(s)\n"));
+
+ this->activate_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers are active\n"));
+
+ // Wait for the supplier threads...
+ if (ACE_Thread_Manager::instance ()->wait () == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Thread_Manager wait failed\n"));
+ return 1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers finished\n"));
+
+ this->dump_results ();
+
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "consumers disconnected\n"));
+
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "suppliers disconnected\n"));
+
+ channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "channel destroyed\n"));
+
+ {
+ // Deactivate the EC
+ PortableServer::POA_var poa =
+ ec_impl->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (ec_impl.get () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "EC deactivated\n"));
+ }
+
+ {
+ // Deactivate the Scheduler
+ PortableServer::POA_var poa =
+ scheduler_impl._default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (&scheduler_impl ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "scheduler deactivated\n"));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ECT_Throughput::run");
+ }
+ ACE_CATCHALL
+ {
+ ACE_ERROR ((LM_ERROR, "non-corba exception raised\n"));
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+ECT_Throughput::shutdown_consumer (void*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ // int ID =
+ // (reinterpret_cast<Test_Consumer**> (consumer_cookie)
+ // - this->consumers_);
+ //
+ // ACE_DEBUG ((LM_DEBUG, "(%t) events received by consumer %d\n", ID));
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->active_count_--;
+ if (this->active_count_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) shutting down the ORB\n"));
+ // Not needed: this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ }
+}
+
+void
+ECT_Throughput::connect_consumers
+ (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL)
+{
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->active_count_ = this->n_consumers_;
+ }
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "consumer_%02d", i);
+
+ ACE_NEW (this->consumers_[i],
+ Test_Consumer (this,
+ this->consumers_ + i,
+ this->n_suppliers_));
+
+ int start = this->consumer_type_start_
+ + i * this->consumer_type_shift_;
+
+ this->consumers_[i]->connect (scheduler,
+ buf,
+ start,
+ this->consumer_type_count_,
+ channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECT_Throughput::connect_suppliers
+ (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr channel
+ ACE_ENV_ARG_DECL)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "supplier_%02d", i);
+
+ ACE_NEW (this->suppliers_[i], Test_Supplier (this));
+
+ int start = this->supplier_type_start_ + i*this->supplier_type_shift_;
+ this->suppliers_[i]->connect (scheduler,
+ buf,
+ this->burst_count_,
+ this->burst_size_,
+ this->event_size_,
+ this->burst_pause_,
+ start,
+ this->supplier_type_count_,
+ channel
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECT_Throughput::activate_suppliers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ int priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ if (this->suppliers_[i]->activate (this->thr_create_flags_,
+ 1, 0, priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot activate thread for supplier %d\n",
+ i));
+ }
+ }
+}
+
+void
+ECT_Throughput::disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECT_Throughput::disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ this->consumers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+ECT_Throughput::dump_results (void)
+{
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+
+ ACE_Throughput_Stats consumers;
+ for (int j = 0; j < this->n_consumers_; ++j)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "consumer_%02d", j);
+
+ this->consumers_[j]->dump_results (buf, gsf);
+ this->consumers_[j]->accumulate (consumers);
+ }
+ consumers.dump_results ("ECT_Consumer/totals", gsf);
+
+ ACE_Throughput_Stats suppliers;
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "supplier_%02d", i);
+
+ this->suppliers_[i]->dump_results (buf, gsf);
+ this->suppliers_[i]->accumulate (suppliers);
+ }
+ suppliers.dump_results ("ECT_Supplier/totals", gsf);
+}
+
+int
+ECT_Throughput::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "dc:s:u:n:t:b:h:l:p:w:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'c':
+ this->n_consumers_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 's':
+ this->n_suppliers_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'u':
+ this->burst_count_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'n':
+ this->burst_size_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'b':
+ this->event_size_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 't':
+ this->burst_pause_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case 'h':
+ {
+ char* aux;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->consumer_type_start_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->consumer_type_count_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->consumer_type_shift_ = ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'l':
+ {
+ char* aux;
+ char* arg = ACE_OS::strtok_r (get_opt.opt_arg (), ",", &aux);
+
+ this->supplier_type_start_ = ACE_ES_EVENT_UNDEFINED + ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->supplier_type_count_ = ACE_OS::atoi (arg);
+ arg = ACE_OS::strtok_r (0, ",", &aux);
+ this->supplier_type_shift_ = ACE_OS::atoi (arg);
+ }
+ break;
+
+ case 'p':
+ this->pid_file_name_ = get_opt.opt_arg ();
+ break;
+
+ case 'w':
+ this->ec_concurrency_hwm_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "[ORB options] "
+ "-r -d -x "
+ "-c <n_consumers> "
+ "-s <n_suppliers> "
+ "-u <burst count> "
+ "-n <burst size> "
+ "-b <event payload size> "
+ "-t <burst pause (usecs)> "
+ "-h <consumer_start,consumer_count,consumer_shift> "
+ "-l <supplier_start,supplier_count,supplier_shift> "
+ "-p <pid file name> "
+ "-w <concurrency HWM> "
+ "-r "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ if (this->burst_count_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: burst count (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->burst_count_,
+ 100));
+ this->burst_count_ = 100;
+ }
+
+ if (this->burst_size_ <= 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: burst size (%d) is out of range, "
+ "reset to default (%d)\n",
+ argv[0], this->burst_size_,
+ 10));
+ this->burst_size_ = 10;
+ }
+
+ if (this->event_size_ < 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s: event size (%d) is out of range, "
+ "reseting to default (%d)\n",
+ argv[0], this->event_size_,
+ 128));
+ this->event_size_ = 128;
+ }
+
+ if (this->n_consumers_ < 0
+ || this->n_consumers_ >= ECT_Throughput::MAX_CONSUMERS)
+ {
+ this->n_consumers_ = 1;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: number of consumers or "
+ "suppliers out of range, "
+ "reset to default (%d)\n",
+ argv[0], 1), -1);
+ }
+
+ if (this->n_suppliers_ < 0
+ || this->n_suppliers_ >= ECT_Throughput::MAX_SUPPLIERS)
+ {
+ this->n_suppliers_ = 1;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: number of suppliers out of range, "
+ "reset to default (%d)\n",
+ argv[0], 1), -1);
+ }
+
+ if (this->n_suppliers_ == 0 && this->n_consumers_ == 0)
+ {
+ this->n_suppliers_ = 1;
+ this->n_consumers_ = 1;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: no suppliers or consumers, "
+ "reset to default (%d of each)\n",
+ argv[0], 1), -1);
+ }
+
+ if (this->ec_concurrency_hwm_ <= 0)
+ {
+ this->ec_concurrency_hwm_ = 1;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: invalid concurrency HWM, "
+ "reset to default (%d)\n",
+ argv[0], 1), -1);
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.h b/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.h
new file mode 100644
index 00000000000..cb1ceae4a8b
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.h
@@ -0,0 +1,134 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = DESCRIPTION
+// This is a helper class for the throughput tests of the Event
+// Channel.
+// Used for the collocated test.
+//
+// ============================================================================
+
+#ifndef ECT_THROUGHPUT_H
+#define ECT_THROUGHPUT_H
+
+#include "ECT_Driver.h"
+#include "ECT_Consumer.h"
+#include "ECT_Supplier.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class ECT_Throughput : public ECT_Driver
+{
+ //
+ // = TITLE
+ //
+ // = DESCRIPTION
+ //
+public:
+ ECT_Throughput (void);
+
+ virtual ~ECT_Throughput (void);
+
+ enum {
+ MAX_CONSUMERS = 16,
+ // Maximum number of consumers.
+ MAX_SUPPLIERS = 16
+ // Maximum number of suppliers.
+ };
+
+ int run (int argc, char* argv[]);
+ // Execute the test.
+
+ virtual void shutdown_consumer (void* consumer_cookie
+ ACE_ENV_ARG_DECL_NOT_USED);
+ // Callback method for consumers, each consumer will call this
+ // method once it receives all the shutdown events from the
+ // suppliers.
+
+private:
+ int parse_args (int argc, char* argv[]);
+ // parse the command line args
+
+ void connect_consumers (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect and disconnect the consumers.
+
+ void connect_suppliers (RtecScheduler::Scheduler_ptr scheduler,
+ RtecEventChannelAdmin::EventChannel_ptr local_ec
+ ACE_ENV_ARG_DECL);
+ void disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // Connect the suppliers.
+
+ void activate_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // Activate the suppliers, i.e. they start generating events.
+
+ void dump_results (void);
+ // Dump the results for each supplier.
+
+private:
+ Test_Consumer* consumers_[ECT_Throughput::MAX_CONSUMERS];
+ // The consumer array.
+
+ int n_consumers_;
+ // The number of consumers.
+
+ Test_Supplier* suppliers_[ECT_Throughput::MAX_SUPPLIERS];
+ // The suppliers array.
+
+ int n_suppliers_;
+ // The number of suppliers.
+
+ int burst_count_;
+ // How many bursts we will send from each supplier.
+
+ int burst_size_;
+ // The number of events
+
+ int event_size_;
+ // The size of the payload on each event.
+
+ int burst_pause_;
+ // The time between each event burst, in microseconds.
+
+ int consumer_type_start_;
+ int consumer_type_count_;
+ int consumer_type_shift_;
+ // The consumers subscribe to different sets of events, as follows:
+ // Consumer0: [start , start + count)
+ // Consumer1: [start + 1*shift, start + 1*shift + count)
+ // Consumer2: [start + 2*shift, start + 2*shift + count)
+ // And so on.
+
+ int supplier_type_start_;
+ int supplier_type_count_;
+ int supplier_type_shift_;
+ // The suppliers generate different sets of events, as follows:
+ // Supplier0: [start , start + count)
+ // Supplier1: [start + 1*shift, start + 1*shift + count)
+ // Supplier2: [start + 2*shift, start + 2*shift + count)
+ // And so on.
+
+ const char* pid_file_name_;
+ // The name of a file where the process stores its pid
+
+ CORBA::ORB_var orb_;
+ // A reference to the ORB, to shut it down properly.
+
+ TAO_SYNCH_MUTEX lock_;
+ int active_count_;
+ // How many consumers are still receiving events.
+
+ int ec_concurrency_hwm_;
+ // Set the HWM for the concurrency in the EC.
+
+ int thr_create_flags_;
+ // The thread creation flags
+};
+
+#endif /* ECT_TRHOUGHPUT_H */
diff --git a/TAO/orbsvcs/tests/EC_Throughput/EC_Throughput.mpc b/TAO/orbsvcs/tests/EC_Throughput/EC_Throughput.mpc
new file mode 100644
index 00000000000..ebbb7c450a8
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/EC_Throughput.mpc
@@ -0,0 +1,34 @@
+// -*- MPC -*-
+// $Id$
+
+project(ECT Supplier): rteventexe, rtevent, rtsched, naming, iortable, messaging {
+ avoids += ace_for_tao
+ exename = ECT_Supplier
+
+ Source_Files {
+ ECT_Driver.cpp
+ ECT_Supplier_Driver.cpp
+ ECT_Supplier.cpp
+ }
+}
+
+project(ECT Consumer): rteventexe, rtevent, rtsched, naming, iortable, messaging {
+ exename = ECT_Consumer
+
+ Source_Files {
+ ECT_Driver.cpp
+ ECT_Consumer_Driver.cpp
+ ECT_Consumer.cpp
+ }
+}
+
+project(ECT Throughput): rteventexe, rtevent_serv, rtsched, naming, iortable, messaging {
+ exename = ECT_Throughput
+
+ Source_Files {
+ ECT_Driver.cpp
+ ECT_Consumer.cpp
+ ECT_Supplier.cpp
+ ECT_Throughput.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/EC_Throughput/Makefile.am b/TAO/orbsvcs/tests/EC_Throughput/Makefile.am
new file mode 100644
index 00000000000..170b9b086cd
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/Makefile.am
@@ -0,0 +1,151 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.ECT_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+
+noinst_PROGRAMS += ECT_Consumer
+
+ECT_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ECT_Consumer_SOURCES = \
+ ECT_Consumer.cpp \
+ ECT_Consumer_Driver.cpp \
+ ECT_Driver.cpp \
+ ECT_Consumer.h \
+ ECT_Consumer_Driver.h \
+ ECT_Driver.h
+
+ECT_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.ECT_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ECT_Supplier
+
+ECT_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ECT_Supplier_SOURCES = \
+ ECT_Driver.cpp \
+ ECT_Supplier.cpp \
+ ECT_Supplier_Driver.cpp \
+ ECT_Driver.h \
+ ECT_Supplier.h \
+ ECT_Supplier_Driver.h
+
+ECT_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.ECT_Throughput.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += ECT_Throughput
+
+ECT_Throughput_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+ECT_Throughput_SOURCES = \
+ ECT_Consumer.cpp \
+ ECT_Driver.cpp \
+ ECT_Supplier.cpp \
+ ECT_Throughput.cpp \
+ ECT_Consumer.h \
+ ECT_Driver.h \
+ ECT_Supplier.h \
+ ECT_Throughput.h
+
+ECT_Throughput_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/EC_Throughput/README b/TAO/orbsvcs/tests/EC_Throughput/README
new file mode 100644
index 00000000000..1ff4896f5c9
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/README
@@ -0,0 +1,49 @@
+# $Id$
+
+ This test can be used to measure the performance of TAO's
+Real-time Event Service. The test can be configured to change:
+
+1) The number of suppliers connected to the event service.
+2) The number of consumers connected to the event service.
+3) The types of events generated by the suppliers and the consumer
+ subscriptions.
+4) The event payload size.
+5) The number of events generated.
+6) Events are sent in "burst", i.e. a number of events is
+ generated without any pacing, the user can prescribe the number of
+ events in each burst as well as the period between bursts.
+
+ There are two versions of the test, a collocated version,
+contained in the ECT_Throughput executable. The non-collocated
+version uses the event channel executable in the ../../Event_Service
+direction, and two local binaries (ECT_Consumer and
+ECT_Supplier). Both versions require a Naming Service.
+
+ To run the test you can use (as usual) the run_test.pl script
+on this directory. If you want to manually run the tests here are
+some examples, usually each one of the commands below is executed on
+its own window:
+
+# Run the collocated test using the default configuration:
+$ ../../Naming_Service/Naming_Service
+$ ./ECT_Throughput
+
+# Run the non-collocated test using the default configuration:
+$ ../../Naming_Service/Naming_Service
+$ ../../Event_Service/Event_Service
+$ ./ECT_Consumer
+$ ./ECT_Supplier
+
+# Run the non-collocated tests using 4 suppliers, notice that the
+# ECT_Consumer needs to know the number of suppliers to terminate
+# correctly:
+$ ../../Naming_Service/Naming_Service
+$ ../../Event_Service/Event_Service
+$ ./ECT_Consumer -s 4
+$ ./ECT_Supplier -s 4
+
+ Other options for the tests can be obtained using the -?, for
+example:
+
+# Find out the options for the collocated test:
+$ ./ECT_Throughput -?
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ec.conf b/TAO/orbsvcs/tests/EC_Throughput/ec.conf
new file mode 100644
index 00000000000..ebab986872a
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ec.conf
@@ -0,0 +1,3 @@
+# $Id$
+static EC_Factory "-ECdispatching reactive -ECfiltering basic -ECproxyconsumerlock thread -ECsupplierfiltering per-supplier"
+static Resource_Factory "-ORBDropRepliesDuringShutdown 0"
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ec.conf.xml b/TAO/orbsvcs/tests/EC_Throughput/ec.conf.xml
new file mode 100644
index 00000000000..33c1ba2e392
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ec.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/EC_Throughput/ec.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECdispatching reactive -ECfiltering basic -ECproxyconsumerlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf b/TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf
new file mode 100644
index 00000000000..f0b21964ce3
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf
@@ -0,0 +1,4 @@
+#
+# $Id$
+#
+static EC_Factory "-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECDispatching mt -ECDispatchingThreads 4 -ECFiltering basic -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECSupplierFiltering per-supplier"
diff --git a/TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf.xml b/TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf.xml
new file mode 100644
index 00000000000..af8714ddd69
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/ec_mt.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/EC_Throughput/ec_mt.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- -->
+ <!-- $Id$ -->
+ <!-- -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECDispatching mt -ECDispatchingThreads 4 -ECFiltering basic -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECSupplierFiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/EC_Throughput/run_test.pl b/TAO/orbsvcs/tests/EC_Throughput/run_test.pl
new file mode 100755
index 00000000000..d889797ed04
--- /dev/null
+++ b/TAO/orbsvcs/tests/EC_Throughput/run_test.pl
@@ -0,0 +1,110 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$ec_conf = PerlACE::LocalFile ("ec$PerlACE::svcconf_ext");
+$ec_mt_conf = PerlACE::LocalFile ("ec$PerlACE::svcconf_ext");
+
+print STDERR "================ Collocated tests, single threaded\n";
+
+$T = new PerlACE::Process ("ECT_Throughput",
+ "-ORBSvcConf $ec_conf"
+ . " -u 10000 -n 1 -t 0 -c 4");
+
+
+$test = $T->SpawnWaitKill (120);
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ $status = 1;
+}
+
+print STDERR "================ Collocated tests, multi threaded\n";
+
+$T = new PerlACE::Process ("ECT_Throughput",
+ "-ORBSvcConf $ec_mt_conf"
+ . " -u 10000 -n 1 -t 0 -c 4");
+
+$test = $T->SpawnWaitKill (120);
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ $status = 1;
+}
+
+print STDERR "================ Remote test\n";
+
+$ns_ior = PerlACE::LocalFile ("NameService.ior");
+
+unlink $ns_ior;
+
+$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service",
+ "-o $ns_ior");
+
+$ES = new PerlACE::Process ("../../Event_Service/Event_Service",
+ "-ORBInitRef NameService=file://$ns_ior "
+ . " -ORBSvcConf $ec_conf "
+ . " -s local");
+
+$C = new PerlACE::Process ("ECT_Consumer",
+ "-ORBInitRef NameService=file://$ns_ior "
+ . " -c 4 -s 1");
+
+$S = new PerlACE::Process ("ECT_Supplier",
+ "-ORBInitRef NameService=file://$ns_ior "
+ . " -s 1 -u 5000 -n 1 -t 0");
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ns_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_ior>\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$ES->Spawn ();
+
+sleep 10;
+
+$C->Spawn ();
+$S->Spawn ();
+
+$supplier = $S->WaitKill (300);
+
+if ($supplier != 0) {
+ print STDERR "ERROR: supplier returned $supplier\n";
+ $status = 1;
+}
+
+$consumer = $C->WaitKill (60);
+
+if ($consumer != 0) {
+ print STDERR "ERROR: consumer returned $consumer\n";
+ $status = 1;
+}
+
+$eserver = $ES->WaitKill (5);
+
+if ($eserver != 0) {
+ print STDERR "ERROR: event server returned $eserver\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: name server returned $nserver\n";
+ $status = 1;
+}
+
+unlink $ns_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.cpp b/TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.cpp
new file mode 100644
index 00000000000..6e4b0d31665
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.cpp
@@ -0,0 +1,317 @@
+// $Id$
+
+#include "Atomic_Reconnect.h"
+#include "Counting_Supplier.h"
+
+#include "ace/OS_NS_unistd.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Atomic_Reconnect,
+ "$Id$")
+
+const int event_type = 20;
+const int event_source = 10;
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier supplier0;
+ EC_Counting_Supplier supplier1;
+
+ supplier0.connect (supplier_admin.in (),
+ event_source,
+ event_type,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier1.connect (supplier_admin.in (),
+ event_source,
+ event_type + 1,
+ event_source,
+ event_type + 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ Consumer consumer01 ("Consumer/01", event_type);
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ ACE_ConsumerQOS_Factory consumer_qos0;
+ consumer_qos0.start_disjunction_group ();
+ consumer_qos0.insert (event_source, event_type, 0);
+
+ ACE_ConsumerQOS_Factory consumer_qos1;
+ consumer_qos1.start_disjunction_group ();
+ consumer_qos1.insert (event_source, event_type + 1, 0);
+
+ ACE_ConsumerQOS_Factory consumer_qos01;
+ consumer_qos01.start_disjunction_group ();
+ consumer_qos01.insert (event_source, event_type, 0);
+ consumer_qos01.insert (event_source, event_type + 1, 0);
+
+ consumer01.connect (consumer_admin.in (),
+ consumer_qos01.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Consumer consumer0 ("Consumer/0", event_type);
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ consumer0.connect (consumer_admin.in (),
+ consumer_qos0.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Consumer consumer1 ("Consumer/1", event_type);
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ consumer1.connect (consumer_admin.in (),
+ consumer_qos1.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier_Task task0 (&supplier0);
+ EC_Counting_Supplier_Task task1 (&supplier1);
+
+ task0.activate ();
+ task1.activate ();
+
+ // ****************************************************************
+
+ const int iterations = 1000;
+
+ for (int i = 0; i != iterations; ++i)
+ {
+ ACE_Time_Value tv (0, 10000);
+ consumer0.connect (consumer_admin.in (),
+ consumer_qos0.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer1.connect (consumer_admin.in (),
+ consumer_qos1.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (i % 2 == 0)
+ {
+ consumer01.connect (consumer_admin.in (),
+ consumer_qos0.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ consumer01.connect (consumer_admin.in (),
+ consumer_qos01.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_OS::sleep (tv);
+ }
+
+ task0.stop ();
+ task1.stop ();
+
+ ACE_Thread_Manager::instance ()->wait ();
+
+
+ // ****************************************************************
+
+ // Cleanup..
+
+ consumer01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ supplier1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Task 0 pushed %d events\n", task0.push_count ()));
+ ACE_DEBUG ((LM_DEBUG,
+ "Task 1 pushed %d events\n", task1.push_count ()));
+ ACE_DEBUG ((LM_DEBUG,
+ "Supplier 0 pushed %d events\n", supplier0.event_count));
+ ACE_DEBUG ((LM_DEBUG,
+ "Supplier 1 pushed %d events\n", supplier1.event_count));
+ consumer0.dump_results (task0.push_count (), 5);
+ consumer1.dump_results (task1.push_count (), 5);
+ consumer01.dump_results (task0.push_count (),
+ task1.push_count (),
+ 1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+Consumer::Consumer (const char* name,
+ int base_type)
+ : EC_Counting_Consumer (name),
+ event_base_count (0),
+ event_base_type_ (base_type)
+{
+}
+
+void
+Consumer::dump_results (int expected_count,
+ int tolerance)
+{
+ this->EC_Counting_Consumer::dump_results (expected_count, tolerance);
+}
+
+void
+Consumer::dump_results (int base_count,
+ int extra_count,
+ int tolerance)
+{
+ int diff = this->event_base_count - base_count;
+ if (diff > tolerance || diff < -tolerance)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ERROR - %s unexpected number of base events <%d>\n",
+ this->name_,
+ this->event_base_count));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s - number of base events <%d> within margins\n",
+ this->name_,
+ this->event_base_count));
+ }
+
+ if (this->event_count < CORBA::ULong(base_count)
+ || this->event_count >= CORBA::ULong(base_count + extra_count))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ERROR - %s unexpected number of events <%d,%d,%d>\n",
+ this->name_,
+ base_count,
+ this->event_count,
+ base_count + extra_count));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s number of events "
+ "<%d,%d,%d> within margins\n",
+ this->name_,
+ base_count,
+ this->event_count,
+ base_count + extra_count));
+ }
+}
+
+void
+Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (events.length () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%P|%t) no events\n", this->name_));
+ return;
+ }
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->event_count++;
+
+ // ACE_DEBUG ((LM_DEBUG,
+ // "Consumer %s has received %d events\n",
+ // this->name_, this->event_count));
+
+ if (events[0].header.type == this->event_base_type_)
+ this->event_base_count++;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.h b/TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.h
new file mode 100644
index 00000000000..1cb23396ef5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Atomic_Reconnect.h
@@ -0,0 +1,58 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Atomic_Reconnect.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_ATOMIC_RECONNECT_H
+#define EC_ATOMIC_RECONNECT_H
+
+#include "Counting_Consumer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Consumer
+ *
+ * @brief Simple consumer object
+ *
+ */
+class Consumer : public EC_Counting_Consumer
+{
+public:
+ /// Constructor
+ Consumer (const char* name,
+ int event_base_type);
+
+ void dump_results (int expected_count,
+ int tolerance);
+ void dump_results (int base_count,
+ int extra_count,
+ int tolerance);
+
+ // = The RtecEventComm::PushConsumer methods
+
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Number of events of type <event_base_type_> received.
+ CORBA::ULong event_base_count;
+
+private:
+ /// Base event type
+ int event_base_type_;
+
+ /// Synchronize access to the counter
+ TAO_SYNCH_MUTEX lock_;
+};
+
+#endif /* EC_ATOMIC_RECONNECT_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/BCast.cpp b/TAO/orbsvcs/tests/Event/Basic/BCast.cpp
new file mode 100644
index 00000000000..93e068b6d84
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/BCast.cpp
@@ -0,0 +1,157 @@
+// $Id$
+
+#include "BCast.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/ECG_Mcast_Gateway.h"
+#include "tao/ORB_Core.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/INET_Addr.h"
+
+ACE_RCSID (EC_Tests_Basic,
+ BCast,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_BCast driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_BCast::EC_BCast (void)
+ : bcast_address_ ("255.255.255.255"),
+ bcast_port_ (12345)
+{
+}
+
+int
+EC_BCast::parse_args (int& argc, char* argv[])
+{
+ if (this->EC_Driver::parse_args (argc, argv) != 0)
+ return -1;
+
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (arg, "-port") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->bcast_port_ = ACE_OS::atoi (arg_shifter.get_current ());
+ }
+
+ else if (ACE_OS::strcmp (arg, "-address") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->bcast_address_ = arg_shifter.get_current ();
+ }
+
+ arg_shifter.ignore_arg ();
+ }
+
+ return 0;
+}
+
+void
+EC_BCast::print_args (void) const
+{
+ this->EC_Driver::print_args ();
+}
+
+void
+EC_BCast::print_usage (void)
+{
+ this->EC_Driver::print_usage ();
+}
+
+void
+EC_BCast::modify_attributes (TAO_EC_Event_Channel_Attributes&)
+{
+}
+
+void
+EC_BCast::execute_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Subscription determining which EC events will get sent out on the
+ // UDP socket.
+ RtecEventChannelAdmin::ConsumerQOS sub;
+ int shutdown_event_type;
+ this->build_consumer_qos (0, sub, shutdown_event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain UDP address in the string format for Gateway initialization.
+ char address_server_arg [256];
+ ACE_INET_Addr udp_addr;
+ if (udp_addr.set (this->bcast_port_, this->bcast_address_) == -1
+ || udp_addr.addr_to_string (address_server_arg, 256) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "%N (%l): Problems with specified UDP address\n"));
+ return;
+ }
+
+ // Set up UDP federation.
+ TAO_ECG_Mcast_Gateway::Attributes lAttributes;
+ lAttributes.address_server_type = TAO_ECG_Mcast_Gateway::ECG_ADDRESS_SERVER_BASIC;
+ lAttributes.handler_type = TAO_ECG_Mcast_Gateway::ECG_HANDLER_UDP;
+ lAttributes.service_type = TAO_ECG_Mcast_Gateway::ECG_MCAST_TWO_WAY;
+
+ TAO_ECG_Mcast_Gateway gateway;
+ if (gateway.init (sub,
+ address_server_arg,
+ lAttributes)
+ == -1)
+ return;
+
+ gateway.run (this->orb_.in (),
+ this->event_channel_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->allocate_tasks () == -1)
+ return;
+
+ this->activate_tasks (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "BCast (%P|%t) suppliers are active\n"));
+
+ ACE_Time_Value tv (30, 0);
+ this->orb_->run (tv);
+
+ // Wait for the supplier threads...
+ if (ACE_Thread_Manager::instance ()->wait () == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "BCast (%P|%t) Thread_Manager wait failed\n"));
+ }
+}
+
+void
+EC_BCast::dump_results (void)
+{
+ this->EC_Driver::dump_results ();
+}
+
+// ****************************************************************
+
+Simple_Address_Server::
+Simple_Address_Server (const ACE_INET_Addr& address)
+{
+ this->address_.ipaddr = address.get_ip_address ();
+ this->address_.port = address.get_port_number ();
+}
+
+void
+Simple_Address_Server::get_addr (const RtecEventComm::EventHeader&,
+ RtecUDPAdmin::UDP_Addr& address
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ address = this->address_;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/BCast.h b/TAO/orbsvcs/tests/Event/Basic/BCast.h
new file mode 100644
index 00000000000..3d1b701984a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/BCast.h
@@ -0,0 +1,85 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file BCast.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_BCAST_H
+#define EC_BCAST_H
+
+#include "Driver.h"
+#include "orbsvcs/RtecUDPAdminS.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_INET_Addr;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class EC_BCast
+ *
+ * @brief Test the EC bcast
+ *
+ */
+class EC_BCast : public EC_Driver
+{
+public:
+ /// Constructor
+ EC_BCast (void);
+
+ // = The EC_Driver methods
+ /// add some command line args to enable/disable bcastions
+ virtual int parse_args (int& argc, char* argv[]);
+ virtual void print_args (void) const;
+ virtual void print_usage (void);
+
+ /// set the bcastion flags
+ virtual void modify_attributes (TAO_EC_Event_Channel_Attributes& attr);
+
+ /// Don't run the suppliers, just test connect and disconnect calls.
+ void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Don't dump the EC_Driver results, they are meaningless.
+ void dump_results (void);
+
+private:
+ /// The IP address used to broadcast
+ const char* bcast_address_;
+
+ /// The port used to send and receive bcast messages...
+ u_short bcast_port_;
+};
+
+// ****************************************************************
+
+/**
+ * @class Simple_Address_Server
+ *
+ * A fixed address server
+ */
+class Simple_Address_Server : public POA_RtecUDPAdmin::AddrServer
+{
+public:
+ /// constructo
+ Simple_Address_Server (const ACE_INET_Addr& address);
+
+ virtual void get_addr (const RtecEventComm::EventHeader& header,
+ RtecUDPAdmin::UDP_Addr& address
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// The UDP addres...
+ RtecUDPAdmin::UDP_Addr address_;
+};
+
+#endif /* EC_BCAST_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/Bitmask.cpp b/TAO/orbsvcs/tests/Event/Basic/Bitmask.cpp
new file mode 100644
index 00000000000..83ee58c7eb8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Bitmask.cpp
@@ -0,0 +1,254 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Bitmask,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ const int milliseconds = 50;
+
+ EC_Counting_Supplier first_supplier;
+
+ first_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ first_supplier.connect (supplier_admin.in (),
+ 0x00001111UL,
+ 0x11110000UL,
+ 0x00001111UL,
+ 0x11110000UL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ EC_Counting_Supplier second_supplier;
+
+ second_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ second_supplier.connect (supplier_admin.in (),
+ 0x01100000UL,
+ 0x00000110UL,
+ 0x01100000UL,
+ 0x00000110UL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_bitmask_reject ("Consumer/bitmask/reject");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_bitmask (0x00001111, 0x11110000);
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert (0x01100000, 0x00000110, 0);
+
+ consumer_bitmask_reject.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_bitmask_accept ("Consumer/bitmask/accept");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_bitmask (0x01100110, 0x01100110);
+ consumer_qos.insert_null_terminator ();
+
+ consumer_bitmask_accept.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_bitmask_filter ("Consumer/bitmask/filter");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_bitmask (0x00000110, 0x01100000);
+ consumer_qos.insert_null_terminator ();
+
+ consumer_bitmask_filter.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_bitmask_value ("Consumer/bitmask/value");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert_bitmasked_value (0x11110000, 0x00001111,
+ 0x01100000, 0x00000110);
+
+ consumer_bitmask_value.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_bitmask_loose ("Consumer/bitmask/loose");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert_bitmasked_value (0x11111111, 0x11111111,
+ 0x01100000, 0x00000110);
+
+ consumer_bitmask_loose.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (5, 0);
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run (tv);
+
+ // ****************************************************************
+
+ consumer_bitmask_loose.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer_bitmask_value.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer_bitmask_filter.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer_bitmask_accept.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer_bitmask_reject.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ second_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ second_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ first_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ first_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ consumer_bitmask_reject.dump_results (0, 5);
+ CORBA::ULong expected =
+ first_supplier.event_count
+ + second_supplier.event_count;
+ consumer_bitmask_accept.dump_results (expected, 5);
+
+ expected = second_supplier.event_count;
+ consumer_bitmask_filter.dump_results (expected, 5);
+ expected = second_supplier.event_count;
+ consumer_bitmask_value.dump_results (expected, 5);
+ expected = second_supplier.event_count;
+ consumer_bitmask_loose.dump_results (expected, 5);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Complex.cpp b/TAO/orbsvcs/tests/Event/Basic/Complex.cpp
new file mode 100644
index 00000000000..5a021eb4e08
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Complex.cpp
@@ -0,0 +1,238 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Complex,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ const int event_type = 20;
+ const int event_source = 10;
+ const int milliseconds = 50;
+
+ EC_Counting_Supplier supplier_00;
+
+ supplier_00.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.connect (supplier_admin.in (),
+ event_source,
+ event_type,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier supplier_01;
+
+ supplier_01.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_01.connect (supplier_admin.in (),
+ event_source,
+ event_type + 1,
+ event_source,
+ event_type + 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier supplier_10;
+
+ supplier_10.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_10.connect (supplier_admin.in (),
+ event_source + 1,
+ event_type,
+ event_source + 1,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier supplier_11;
+
+ supplier_11.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_11.connect (supplier_admin.in (),
+ event_source + 1,
+ event_type + 1,
+ event_source + 1,
+ event_type + 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_00 ("Consumer/00");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_logical_and_group (2);
+ consumer_qos.start_negation ();
+ consumer_qos.insert_source (event_source + 1, 0);
+ consumer_qos.insert_type (event_type, 0);
+
+ consumer_00.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_01 ("Consumer/01");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_logical_and_group (2);
+ consumer_qos.insert_null_terminator (); // Any event
+ consumer_qos.start_negation (); // but for (source,type)
+ consumer_qos.insert (event_source, event_type, 0);
+
+ consumer_01.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (5, 0);
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run (tv);
+
+ // ****************************************************************
+
+ consumer_01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier_11.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_10.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_01.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier_11.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_10.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (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;
+
+ // ****************************************************************
+
+ CORBA::ULong expected =
+ supplier_00.event_count;
+ consumer_00.dump_results (expected, 5);
+
+ expected =
+ supplier_01.event_count
+ + supplier_10.event_count
+ + supplier_11.event_count;
+ consumer_01.dump_results (expected, 5);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Control.cpp b/TAO/orbsvcs/tests/Event/Basic/Control.cpp
new file mode 100644
index 00000000000..d5e07b61bb9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Control.cpp
@@ -0,0 +1,205 @@
+// $Id$
+
+#include "Control.h"
+#include "Counting_Supplier.h"
+
+#include "ace/OS_NS_unistd.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Control,
+ "$Id$")
+
+const int event_type = 20;
+const int event_source = 10;
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier supplier0;
+
+ supplier0.connect (supplier_admin.in (),
+ event_source,
+ event_type,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+ Consumer consumer0 ("Consumer/0", 100);
+
+ ACE_ConsumerQOS_Factory consumer_qos0;
+ consumer_qos0.start_disjunction_group ();
+ consumer_qos0.insert (event_source, event_type, 0);
+
+ consumer0.connect (consumer_admin.in (),
+ consumer_qos0.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+ Consumer consumer1 ("Consumer/1", 200);
+
+ consumer1.connect (consumer_admin.in (),
+ consumer_qos0.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier_Task task0 (&supplier0);
+
+ task0.activate ();
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (10, 0);
+ ACE_OS::sleep (tv);
+
+ task0.stop ();
+
+ ACE_Thread_Manager::instance ()->wait ();
+
+ // ****************************************************************
+
+ // Cleanup..
+
+ // The consumers should be disconnected already, but make sure
+ // that they did...
+ //consumer1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ //ACE_TRY_CHECK;
+ //consumer0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ //ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ supplier0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (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;
+
+ // ****************************************************************
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Task 0 pushed %d events\n", task0.push_count ()));
+ ACE_DEBUG ((LM_DEBUG,
+ "Supplier 0 pushed %d events\n", supplier0.event_count));
+
+ consumer0.dump_results (100, 5);
+ consumer1.dump_results (200, 5);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+Consumer::Consumer (const char* name,
+ int shutdown_count)
+ : EC_Counting_Consumer (name),
+ shutdown_count_ (shutdown_count)
+{
+}
+
+void
+Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (events.length () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%P|%t) no events\n", this->name_));
+ return;
+ }
+
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->event_count++;
+
+ if (this->event_count != this->shutdown_count_)
+ return;
+ }
+
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Control.h b/TAO/orbsvcs/tests/Event/Basic/Control.h
new file mode 100644
index 00000000000..f8e27523603
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Control.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Control.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_CONTROL_H
+#define EC_CONTROL_H
+
+#include "Counting_Consumer.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Consumer
+ *
+ * @brief Simple consumer object
+ *
+ */
+class Consumer : public EC_Counting_Consumer
+{
+public:
+ /// Constructor
+ Consumer (const char* name,
+ int event_count);
+
+ // = The RtecEventComm::PushConsumer methods
+
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// After this number of events the consumer disconnects from the
+ /// event service.
+ CORBA::ULong shutdown_count_;
+
+ /// Synchronize access to the counter
+ TAO_SYNCH_MUTEX lock_;
+};
+
+#endif /* EC_CONTROL_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/Disconnect.cpp b/TAO/orbsvcs/tests/Event/Basic/Disconnect.cpp
new file mode 100644
index 00000000000..f0a3aafbcae
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Disconnect.cpp
@@ -0,0 +1,223 @@
+// $Id$
+
+#include "Counting_Supplier.h"
+#include "Counting_Consumer.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Disconnect,
+ "$Id$")
+
+static void run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL);
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ run_test (poa.in (), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ run_test (poa.in (), 1 ACE_ENV_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;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+void
+deactivate_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Event_Channel_Attributes attributes (poa, poa);
+ attributes.disconnect_callbacks = use_callbacks;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // and the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ int iterations = 100;
+
+ EC_Counting_Supplier supplier_0;
+ EC_Counting_Supplier supplier_1;
+ EC_Counting_Consumer consumer_0 ("Consumer/0");
+ EC_Counting_Consumer consumer_1 ("Consumer/1");
+
+ const int event_type = 20;
+ const int event_source = 10;
+
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (event_source, event_type, 0);
+
+ ACE_SupplierQOS_Factory supplier_qos;
+ supplier_qos.insert (event_source,
+ event_type,
+ 0, 1);
+
+ for (int i = 0; i != iterations; ++i)
+ {
+ supplier_0.connect (supplier_admin.in (),
+ supplier_qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ supplier_1.connect (supplier_admin.in (),
+ supplier_qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_1.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ supplier_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ consumer_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ supplier_0.connect (supplier_admin.in (),
+ supplier_qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&supplier_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&consumer_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&ec_impl ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong count_0 = 1;
+ CORBA::ULong count_1 = 0;
+ if (use_callbacks)
+ {
+ count_0 += iterations;
+ count_1 += iterations / 2;
+ }
+
+ if (consumer_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 0 (%d)\n",
+ consumer_0.disconnect_count, count_0,
+ use_callbacks));
+ if (supplier_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 0 (%d)\n",
+ supplier_0.disconnect_count, count_0,
+ use_callbacks));
+
+ if (consumer_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 1 (%d)\n",
+ consumer_1.disconnect_count, count_1,
+ use_callbacks));
+ if (supplier_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 1 (%d)\n",
+ supplier_1.disconnect_count, count_1,
+ use_callbacks));
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Event_Basic.mpc b/TAO/orbsvcs/tests/Event/Basic/Event_Basic.mpc
new file mode 100644
index 00000000000..d18e0dd4515
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Event_Basic.mpc
@@ -0,0 +1,93 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Reconnect): rteventtestexe {
+ Source_Files {
+ Reconnect.cpp
+ }
+}
+
+project(*Shutdown): rteventtestexe {
+ Source_Files {
+ Shutdown.cpp
+ }
+}
+
+project(*Observer): rteventtestexe {
+ Source_Files {
+ Observer.cpp
+ }
+}
+
+project(*BCast): rteventtestexe {
+ Source_Files {
+ BCast.cpp
+ }
+}
+
+project(*Timeout): rteventtestexe {
+ Source_Files {
+ Timeout.cpp
+ }
+}
+
+project(*Wildcard): rteventtestexe {
+ Source_Files {
+ Wildcard.cpp
+ }
+}
+
+project(*Negation): rteventtestexe {
+ Source_Files {
+ Negation.cpp
+ }
+}
+
+project(*Disconnect): rteventtestexe {
+ Source_Files {
+ Disconnect.cpp
+ }
+}
+
+project(*MT_Disconnect): rteventtestexe {
+ Source_Files {
+ MT_Disconnect.cpp
+ }
+}
+
+project(*Atomic_Reconnect): rteventtestexe {
+ Source_Files {
+ Atomic_Reconnect.cpp
+ }
+}
+
+project(*Bitmask): rteventtestexe {
+ Source_Files {
+ Bitmask.cpp
+ }
+}
+
+project(*Complex): rteventtestexe {
+ Source_Files {
+ Complex.cpp
+ }
+}
+
+project(*Gateway): rteventtestexe {
+ Source_Files {
+ Gateway.cpp
+ }
+}
+
+project(*Control): rteventtestexe {
+ Source_Files {
+ Control.cpp
+ }
+}
+
+project(*Random) : rteventtestexe {
+ Source_Files {
+ Random.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Event/Basic/Gateway.cpp b/TAO/orbsvcs/tests/Event/Basic/Gateway.cpp
new file mode 100644
index 00000000000..39c750d1a4d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Gateway.cpp
@@ -0,0 +1,359 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+
+ACE_RCSID (EC_Tests,
+ Gateway,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_EC_Event_Channel ec_impl_1 (attributes);
+ ec_impl_1.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel_1 =
+ ec_impl_1._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel ec_impl_2 (attributes);
+ ec_impl_2.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel_2 =
+ ec_impl_2._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_1 =
+ event_channel_1->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin_1 =
+ event_channel_1->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_2 =
+ event_channel_2->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin_2 =
+ event_channel_2->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Gateway_IIOP gateway;
+ gateway.init (event_channel_1.in (),
+ event_channel_2.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ RtecEventChannelAdmin::Observer_var obs =
+ gateway._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::Observer_Handle h =
+ event_channel_2->append_observer (obs.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ gateway.observer_handle (h);
+
+ // ****************************************************************
+
+ const int event_type = 20;
+ const int event_source = 10;
+ const int milliseconds = 50;
+
+ EC_Counting_Supplier supplier_00;
+
+ supplier_00.activate (consumer_admin_1.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.connect (supplier_admin_1.in (),
+ event_source,
+ event_type,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ EC_Counting_Supplier supplier_01;
+
+ supplier_01.activate (consumer_admin_1.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_01.connect (supplier_admin_1.in (),
+ event_source,
+ event_type + 1,
+ event_source,
+ event_type + 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Consumer consumer_00 ("Consumer/00");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert (event_source, event_type, 0);
+
+ consumer_00.connect (consumer_admin_2.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (5, 0);
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run (tv);
+
+ // ****************************************************************
+
+ CORBA::ULong expected =
+ supplier_00.event_count;
+ consumer_00.dump_results (expected, 5);
+
+ CORBA::ULong last_count = consumer_00.event_count;
+ CORBA::ULong last_supplier_00 = supplier_00.event_count;
+ CORBA::ULong last_supplier_01 = supplier_01.event_count;
+
+ // ****************************************************************
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (2);
+ consumer_qos.insert (event_source, event_type, 0);
+ consumer_qos.insert (event_source, event_type + 1, 0);
+
+ consumer_00.connect (consumer_admin_2.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ tv = ACE_Time_Value (5, 0);
+ orb->run (tv);
+
+ expected = last_count
+ + supplier_00.event_count - last_supplier_00
+ + supplier_01.event_count - last_supplier_01;
+ consumer_00.dump_results (expected, 5);
+
+ last_count = consumer_00.event_count;
+ last_supplier_00 = supplier_00.event_count;
+ last_supplier_01 = supplier_01.event_count;
+
+ // ****************************************************************
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert (event_source, event_type, 0);
+
+ consumer_00.connect (consumer_admin_2.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ tv = ACE_Time_Value (5, 0);
+ orb->run (tv);
+
+ expected = last_count
+ + supplier_00.event_count - last_supplier_00;
+ consumer_00.dump_results (expected, 5);
+
+ last_count = consumer_00.event_count;
+ last_supplier_00 = supplier_00.event_count;
+ last_supplier_01 = supplier_01.event_count;
+
+ // ****************************************************************
+
+ consumer_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert_type (event_type, 0);
+
+ consumer_00.connect (consumer_admin_2.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ tv = ACE_Time_Value (5, 0);
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run (tv);
+
+ // ****************************************************************
+
+ expected = last_count
+ + supplier_00.event_count - last_supplier_00;
+ consumer_00.dump_results (expected, 5);
+
+ last_count = consumer_00.event_count;
+ last_supplier_00 = supplier_00.event_count;
+ last_supplier_01 = supplier_01.event_count;
+
+ // ****************************************************************
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (2);
+ consumer_qos.insert_type (event_type, 0);
+ consumer_qos.insert_type (event_type + 1, 0);
+
+ consumer_00.connect (consumer_admin_2.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ tv = ACE_Time_Value (5, 0);
+ orb->run (tv);
+
+ expected = last_count
+ + supplier_00.event_count - last_supplier_00
+ + supplier_01.event_count - last_supplier_01;
+ consumer_00.dump_results (expected, 5);
+
+ last_count = consumer_00.event_count;
+ last_supplier_00 = supplier_00.event_count;
+ last_supplier_01 = supplier_01.event_count;
+
+ // ****************************************************************
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert_type (event_type, 0);
+
+ consumer_00.connect (consumer_admin_2.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ tv = ACE_Time_Value (5, 0);
+ orb->run (tv);
+
+ expected = last_count
+ + supplier_00.event_count - last_supplier_00;
+ consumer_00.dump_results (expected, 5);
+
+ last_count = consumer_00.event_count;
+ last_supplier_00 = supplier_00.event_count;
+ last_supplier_01 = supplier_01.event_count;
+
+ // ****************************************************************
+
+ consumer_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier_01.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier_01.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier_00.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ gateway.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel_1->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ event_channel_2->destroy (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;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp b/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp
new file mode 100644
index 00000000000..9f91b760a0a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.cpp
@@ -0,0 +1,254 @@
+// $Id$
+
+#include "MT_Disconnect.h"
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ MT_Disconnect,
+ "$Id$")
+
+static void run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL);
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ run_test (poa.in (), 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ run_test (poa.in (), 1 ACE_ENV_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;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+void
+deactivate_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+run_test (PortableServer::POA_ptr poa,
+ int use_callbacks
+ ACE_ENV_ARG_DECL)
+{
+ TAO_EC_Event_Channel_Attributes attributes (poa, poa);
+ attributes.disconnect_callbacks = use_callbacks;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Task task (event_channel.in (), use_callbacks);
+
+ if (task.activate (THR_BOUND|THR_NEW_LWP, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "Cannot activate the tasks\n"));
+ }
+
+ // Wait for all the threads to complete and the return
+ ACE_Thread_Manager::instance ()->wait ();
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&ec_impl ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+Task::Task (RtecEventChannelAdmin::EventChannel_ptr ec,
+ int callbacks)
+ : event_channel (RtecEventChannelAdmin::EventChannel::_duplicate (ec)),
+ use_callbacks (callbacks)
+{
+}
+
+
+int
+Task::svc ()
+{
+ for (int i = 0; i < 10; ++i)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ this->run_iteration (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ }
+ return 0;
+}
+
+void
+Task::run_iteration (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // and the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // ****************************************************************
+
+ int iterations = 100;
+
+ EC_Counting_Supplier supplier_0;
+ EC_Counting_Supplier supplier_1;
+ EC_Counting_Consumer consumer_0 ("Consumer/0");
+ EC_Counting_Consumer consumer_1 ("Consumer/1");
+
+ const int event_type = 20;
+ const int event_source = 10;
+
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (event_source, event_type, 0);
+
+ ACE_SupplierQOS_Factory supplier_qos;
+ supplier_qos.insert (event_source,
+ event_type,
+ 0, 1);
+
+ for (int i = 0; i != iterations; ++i)
+ {
+ supplier_0.connect (supplier_admin.in (),
+ supplier_qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ supplier_1.connect (supplier_admin.in (),
+ supplier_qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_1.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ supplier_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_0.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (i % 2 == 1)
+ {
+ consumer_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_1.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ deactivate_servant (&supplier_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ deactivate_servant (&consumer_0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong count_0 = 0;
+ CORBA::ULong count_1 = 0;
+ if (use_callbacks)
+ {
+ count_0 += iterations;
+ count_1 += iterations / 2;
+ }
+
+ if (consumer_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 0 (%d)\n",
+ consumer_0.disconnect_count, count_0,
+ use_callbacks));
+ if (supplier_0.disconnect_count != count_0)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 0 (%d)\n",
+ supplier_0.disconnect_count, count_0,
+ use_callbacks));
+
+ if (consumer_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "consumer 1 (%d)\n",
+ consumer_1.disconnect_count, count_1,
+ use_callbacks));
+ if (supplier_1.disconnect_count != count_1)
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: incorrect number of disconnect calls (%d/%d) for "
+ "supplier 1 (%d)\n",
+ supplier_1.disconnect_count, count_1,
+ use_callbacks));
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.h b/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.h
new file mode 100644
index 00000000000..06855260d66
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/MT_Disconnect.h
@@ -0,0 +1,45 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file MT_Disconnect.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_MT_DISCONNECT_H
+#define EC_MT_DISCONNECT_H
+
+#include "ace/Task.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Task : public ACE_Task_Base
+{
+public:
+ /// Create the task...
+ Task (RtecEventChannelAdmin::EventChannel_ptr ec,
+ int use_callbacks);
+
+ // = Check the ACE_Task_Base documentation.
+ int svc (void);
+
+ /// Run a single iteration of the test
+ void run_iteration (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The event channel used on the test
+ RtecEventChannelAdmin::EventChannel_var event_channel;
+
+ /// Does the event channel send any callback messages when a client
+ /// diconnects
+ int use_callbacks;
+};
+
+#endif /* EC_DISCONNECT_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/Makefile.am b/TAO/orbsvcs/tests/Event/Basic/Makefile.am
new file mode 100644
index 00000000000..b68828bdc89
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Makefile.am
@@ -0,0 +1,680 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Event_Basic_Atomic_Reconnect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Atomic_Reconnect
+
+Atomic_Reconnect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Atomic_Reconnect_SOURCES = \
+ Atomic_Reconnect.cpp \
+ Atomic_Reconnect.h
+
+Atomic_Reconnect_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_BCast.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += BCast
+
+BCast_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+BCast_SOURCES = \
+ BCast.cpp \
+ BCast.h
+
+BCast_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Bitmask.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Bitmask
+
+Bitmask_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Bitmask_SOURCES = \
+ Bitmask.cpp \
+ Atomic_Reconnect.h \
+ BCast.h \
+ Control.h \
+ MT_Disconnect.h \
+ Observer.h \
+ Random.h \
+ Reconnect.h \
+ Schedule.h \
+ Shutdown.h
+
+Bitmask_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Complex.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Complex
+
+Complex_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Complex_SOURCES = \
+ Complex.cpp \
+ Atomic_Reconnect.h \
+ BCast.h \
+ Control.h \
+ MT_Disconnect.h \
+ Observer.h \
+ Random.h \
+ Reconnect.h \
+ Schedule.h \
+ Shutdown.h
+
+Complex_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Control.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Control
+
+Control_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Control_SOURCES = \
+ Control.cpp \
+ Control.h
+
+Control_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Disconnect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Disconnect
+
+Disconnect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Disconnect_SOURCES = \
+ Disconnect.cpp \
+ Atomic_Reconnect.h \
+ BCast.h \
+ Control.h \
+ MT_Disconnect.h \
+ Observer.h \
+ Random.h \
+ Reconnect.h \
+ Schedule.h \
+ Shutdown.h
+
+Disconnect_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Gateway.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Gateway
+
+Gateway_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Gateway_SOURCES = \
+ Gateway.cpp \
+ Atomic_Reconnect.h \
+ BCast.h \
+ Control.h \
+ MT_Disconnect.h \
+ Observer.h \
+ Random.h \
+ Reconnect.h \
+ Schedule.h \
+ Shutdown.h
+
+Gateway_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_MT_Disconnect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += MT_Disconnect
+
+MT_Disconnect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+MT_Disconnect_SOURCES = \
+ MT_Disconnect.cpp \
+ MT_Disconnect.h
+
+MT_Disconnect_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Negation.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Negation
+
+Negation_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Negation_SOURCES = \
+ Negation.cpp \
+ Atomic_Reconnect.h \
+ BCast.h \
+ Control.h \
+ MT_Disconnect.h \
+ Observer.h \
+ Random.h \
+ Reconnect.h \
+ Schedule.h \
+ Shutdown.h
+
+Negation_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Observer.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Observer
+
+Observer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Observer_SOURCES = \
+ Observer.cpp \
+ Observer.h
+
+Observer_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Random.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Random
+
+Random_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Random_SOURCES = \
+ Random.cpp \
+ Random.h
+
+Random_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Reconnect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Reconnect
+
+Reconnect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Reconnect_SOURCES = \
+ Reconnect.cpp \
+ Reconnect.h
+
+Reconnect_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Shutdown.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Shutdown
+
+Shutdown_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Shutdown_SOURCES = \
+ Shutdown.cpp \
+ Shutdown.h
+
+Shutdown_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Timeout.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Timeout
+
+Timeout_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Timeout_SOURCES = \
+ Timeout.cpp \
+ Atomic_Reconnect.h \
+ BCast.h \
+ Control.h \
+ MT_Disconnect.h \
+ Observer.h \
+ Random.h \
+ Reconnect.h \
+ Schedule.h \
+ Shutdown.h
+
+Timeout_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Basic_Wildcard.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Wildcard
+
+Wildcard_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Wildcard_SOURCES = \
+ Wildcard.cpp \
+ Atomic_Reconnect.h \
+ BCast.h \
+ Control.h \
+ MT_Disconnect.h \
+ Observer.h \
+ Random.h \
+ Reconnect.h \
+ Schedule.h \
+ Shutdown.h
+
+Wildcard_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Event/Basic/Negation.cpp b/TAO/orbsvcs/tests/Event/Basic/Negation.cpp
new file mode 100644
index 00000000000..37ab5c1fb30
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Negation.cpp
@@ -0,0 +1,214 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Negation,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ const int event_type = 20;
+ const int event_source = 10;
+ const int milliseconds = 50;
+
+ EC_Counting_Supplier first_supplier;
+
+ first_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ first_supplier.connect (supplier_admin.in (),
+ event_source,
+ event_type,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ EC_Counting_Supplier second_supplier;
+
+ second_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ second_supplier.connect (supplier_admin.in (),
+ event_source,
+ event_type + 1,
+ event_source,
+ event_type + 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ EC_Counting_Supplier third_supplier;
+
+ third_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ third_supplier.connect (supplier_admin.in (),
+ event_source,
+ event_type + 1,
+ event_source,
+ event_type + 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Consumer regular_consumer ("Consumer/regular");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (event_source, event_type, 0);
+
+ regular_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer negation_consumer ("Consumer/negation");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_negation ();
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (event_source, event_type, 0);
+
+ negation_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (5, 0);
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run (tv);
+
+ // ****************************************************************
+
+ negation_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ regular_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ third_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ third_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ second_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ second_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ first_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ first_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ CORBA::ULong expected =
+ third_supplier.event_count
+ + second_supplier.event_count;
+ negation_consumer.dump_results (expected, 5);
+ expected =
+ first_supplier.event_count;
+ regular_consumer.dump_results (expected, 5);
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Observer.cpp b/TAO/orbsvcs/tests/Event/Basic/Observer.cpp
new file mode 100644
index 00000000000..d58d828573f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Observer.cpp
@@ -0,0 +1,415 @@
+// $Id$
+
+#include "Observer.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/High_Res_Timer.h"
+
+ACE_RCSID (EC_Tests_Basic,
+ Observer,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+ EC_Master master;
+ return master.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Master::EC_Master (void)
+ : seed_ (0),
+ n_channels_ (4),
+ channels_ (0)
+{
+}
+
+EC_Master::~EC_Master (void)
+{
+ if (this->channels_ != 0)
+ {
+ for (int i = 0; i < this->n_channels_; ++i)
+ delete this->channels_[i];
+ delete[] this->channels_;
+ }
+}
+
+int
+EC_Master::run (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Calibrate the high resolution timer *before* starting the
+ // test.
+ ACE_High_Res_Timer::calibrate ();
+
+ this->seed_ = ACE_OS::time (0);
+
+ this->initialize_orb_and_poa (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->parse_args (argc, argv))
+ return 1;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "The seed value is %d\n", this->seed_));
+
+ ACE_NEW_RETURN (this->channels_,
+ EC_Observer*[this->n_channels_],
+ 1);
+
+ {
+ for (int i = 0; i != this->n_channels_; ++i)
+ {
+ ACE_OS::rand_r (this->seed_);
+ ACE_NEW_RETURN (this->channels_[i],
+ EC_Observer (this,
+ this->seed_,
+ this->orb_.in (),
+ this->root_poa_.in (),
+ i),
+ 1);
+ }
+ }
+
+ {
+ char** targv;
+ ACE_NEW_RETURN (targv, char*[argc], 1);
+
+ for (int i = 0; i != this->n_channels_; ++i)
+ {
+ int targc = argc;
+ for (int j = 0; j < targc; ++j)
+ targv[j] = argv[j];
+ this->channels_[i]->run_init (targc, targv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ delete[] targv;
+ }
+
+ {
+ for (int i = 0; i != this->n_channels_; ++i)
+ {
+ this->channels_[i]->execute_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ if (ACE_Thread_Manager::instance ()->wait () == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Master (%P|%t) thread manager wait failed\n"));
+ return 1;
+ }
+
+ {
+ for (int i = 0; i != this->n_channels_; ++i)
+ {
+ this->channels_[i]->dump_results ();
+ }
+ }
+
+ {
+ for (int i = 0; i != this->n_channels_; ++i)
+ {
+ this->channels_[i]->run_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ {
+ for (int i = 0; i != this->n_channels_; ++i)
+ {
+ this->channels_[i]->disconnect_clients (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->channels_[i]->shutdown_clients (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->channels_[i]->destroy_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->channels_[i]->deactivate_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->channels_[i]->cleanup_tasks ();
+ this->channels_[i]->cleanup_suppliers ();
+ this->channels_[i]->cleanup_consumers ();
+ this->channels_[i]->cleanup_ec ();
+ }
+ }
+
+ this->root_poa_->destroy (1,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "EC_Driver::run");
+ }
+ ACE_CATCHALL
+ {
+ ACE_ERROR ((LM_ERROR, "EC_Driver (%P|%t) non-corba exception raised\n"));
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+EC_Master::initialize_orb_and_poa (int &argc, char* argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Driver (%P|%t) Unable to initialize the POA.\n"));
+ return;
+ }
+
+ this->root_poa_ =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+EC_Master::parse_args (int &argc, char *argv [])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (arg, "-channels") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->n_channels_ = ACE_OS::atoi (arg_shifter.get_current ());
+ }
+ else if (ACE_OS::strcmp (arg, "-seed") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->seed_ = ACE_OS::atoi (arg_shifter.get_current ());
+ }
+
+ arg_shifter.ignore_arg ();
+ }
+ return 0;
+}
+
+int
+EC_Master::channel_count (void) const
+{
+ return this->n_channels_;
+}
+
+EC_Observer*
+EC_Master::channel (int i) const
+{
+ return this->channels_[i];
+}
+
+// ****************************************************************
+
+EC_Observer::EC_Observer (EC_Master *master,
+ ACE_RANDR_TYPE seed,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa,
+ int id)
+ : master_ (master),
+ seed_ (seed),
+ id_ (id),
+ gwys_ (0)
+{
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->root_poa_ = PortableServer::POA::_duplicate (root_poa);
+}
+
+EC_Observer::~EC_Observer (void)
+{
+ if (this->gwys_ != 0)
+ delete[] this->gwys_;
+}
+
+void
+EC_Observer::initialize_orb_and_poa (int&, char*[]
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+int
+EC_Observer::parse_args (int& argc, char* argv[])
+{
+ return this->EC_Driver::parse_args (argc, argv);
+}
+
+void
+EC_Observer::print_args (void) const
+{
+ this->EC_Driver::print_args ();
+}
+
+void
+EC_Observer::print_usage (void)
+{
+ this->EC_Driver::print_usage ();
+}
+
+void
+EC_Observer::execute_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int peer_count = this->master_->channel_count ();
+ ACE_NEW (this->gwys_, TAO_EC_Gateway_IIOP[peer_count]);
+
+ for (int i = 0; i != peer_count; ++i)
+ {
+ if (i == this->id_)
+ continue;
+
+ RtecEventChannelAdmin::EventChannel_ptr rmt_ec =
+ this->master_->channel (i)->event_channel_.in ();
+
+ this->gwys_[i].init (rmt_ec,
+ this->event_channel_.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ RtecEventChannelAdmin::Observer_var obs =
+ this->gwys_[i]._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::Observer_Handle h =
+ rmt_ec->append_observer (obs.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->gwys_[i].observer_handle (h);
+
+ ACE_CHECK;
+ }
+
+ if (this->allocate_tasks () == -1)
+ return;
+
+ this->activate_tasks (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Observer[%d] (%P|%t) suppliers are active\n",
+ this->id_));
+}
+
+void
+EC_Observer::run_cleanup (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int j = 0; j != this->master_->channel_count (); ++j)
+ {
+ if (j == this->id_)
+ continue;
+
+ RtecEventChannelAdmin::EventChannel_ptr rmt_ec =
+ this->master_->channel (j)->event_channel_.in ();
+ rmt_ec->remove_observer (this->gwys_[j].observer_handle ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->gwys_[j].shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+EC_Observer::dump_results (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "===== Results for %d =====\n", this->id_));
+
+ ACE_Throughput_Stats throughput;
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ for (int j = 0; j < this->n_consumers_; ++j)
+ {
+ this->consumers_[j]->accumulate (throughput);
+ }
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+
+ ACE_Throughput_Stats suppliers;
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->accumulate (suppliers);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\nTotals:\n"));
+ throughput.dump_results ("EC_Consumer/totals", gsf);
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ suppliers.dump_results ("EC_Supplier/totals", gsf);
+}
+
+void
+EC_Observer::connect_consumer (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int i
+ ACE_ENV_ARG_DECL)
+{
+ if (i == 0)
+ {
+ this->EC_Driver::connect_consumer (consumer_admin, i
+ ACE_ENV_ARG_PARAMETER);
+ return;
+ }
+ unsigned int x = ACE_OS::rand_r (this->seed_);
+ if (x < RAND_MAX / 8)
+ this->EC_Driver::connect_consumer (consumer_admin, i
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+EC_Observer::consumer_push (void*,
+ const RtecEventComm::EventSet&
+ ACE_ENV_ARG_DECL)
+{
+ unsigned int x = ACE_OS::rand_r (this->seed_);
+ if (x < (RAND_MAX / 64))
+ {
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Observer[%d] (%P|%t) reconnecting\n", this->id_));
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (int i = 1; i < this->n_consumers_; ++i)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->consumers_[i]->connected ())
+ {
+ this->consumers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ this->EC_Driver::connect_consumer (consumer_admin.in (),
+ i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Observer.h b/TAO/orbsvcs/tests/Event/Basic/Observer.h
new file mode 100644
index 00000000000..bb788c01258
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Observer.h
@@ -0,0 +1,120 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Observer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_OBSERVER_H
+#define EC_OBSERVER_H
+
+#include "Driver.h"
+#include "orbsvcs/Event/EC_Gateway_IIOP.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class EC_Observer;
+
+/**
+ * @class EC_Master
+ *
+ * @brief Run multiple events channels
+ *
+ * This test runs multiple event channels, all connected using
+ * gateways.
+ */
+class EC_Master
+{
+public:
+ EC_Master (void);
+
+ virtual ~EC_Master (void);
+
+ /// Execute the test.
+ virtual int run (int argc, char* argv[]);
+
+ /// Obtain the orb and the poa pointers
+ virtual void initialize_orb_and_poa (int& argc, char* argv[]
+ ACE_ENV_ARG_DECL);
+
+ /// Accessors
+ int channel_count (void) const;
+ EC_Observer* channel (int i) const;
+
+private:
+ int parse_args (int &argc, char *argv []);
+
+private:
+ /// The seed
+ ACE_RANDR_TYPE seed_;
+
+ /// The driver programs
+ int n_channels_;
+ EC_Observer** channels_;
+
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// The Root POA
+ PortableServer::POA_var root_poa_;
+};
+
+/**
+ * @class EC_Observer
+ *
+ * @brief Test the EC observers
+ *
+ */
+class EC_Observer : public EC_Driver
+{
+public:
+ /// Constructor
+ EC_Observer (EC_Master *master,
+ ACE_RANDR_TYPE seed,
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa,
+ int id);
+
+ /// Destructor
+ ~EC_Observer (void);
+
+ // = The EC_Driver methods
+ /// add some command line args to enable/disable observerions
+ virtual void initialize_orb_and_poa (int& argc, char* argv[]
+ ACE_ENV_ARG_DECL);
+ virtual int parse_args (int& argc, char* argv[]);
+ virtual void print_args (void) const;
+ virtual void print_usage (void);
+
+ /// Run the suppliers, using the <thread_manager> parameter
+ void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+ void run_cleanup (ACE_ENV_SINGLE_ARG_DECL);
+
+ void dump_results (void);
+ void connect_consumer (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int i
+ ACE_ENV_ARG_DECL);
+ void consumer_push (void*,
+ const RtecEventComm::EventSet&
+ ACE_ENV_ARG_DECL);
+
+private:
+ EC_Master *master_;
+ ACE_RANDR_TYPE seed_;
+ int id_;
+
+ TAO_EC_Gateway_IIOP *gwys_;
+
+ /// lock internal state
+ TAO_SYNCH_MUTEX lock_;
+};
+
+#endif /* EC_OBSERVER_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/README b/TAO/orbsvcs/tests/Event/Basic/README
new file mode 100644
index 00000000000..26408823b69
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/README
@@ -0,0 +1,43 @@
+# $Id$
+
+ Basic tests for the real-time event channel.
+
+This directory contains several tests to exercise the real-time event
+channel features, debug it and stress test it. The tests are as simple
+as possible, but not simpler.
+
+ Here are some canonical test configurations:
+
+# Connect 100 suppliers, 100 consumers. Then disconnect and connect
+# one particular consumer, 100. Then do the same for one supplier
+
+$ Reconnect -verbose -suppliers 100 -consumers 100 -d 100
+
+# Same as above, but instead of disconnecting and connecting again
+# simply reconnect. Should be faster
+$ Reconnect -verbose -suppliers 100 -consumers 100 -d 100 -c -s
+
+# Connect 10 suppliers, 10 consumers and then shutdown the EC
+$ Shutdown -verbose -suppliers 5 -consumer 5
+
+# Create 4 event channels, connect all of them using IIOP gateways,
+# then attach 5 consumers and 2 supplier to each, next generate 10000
+# events (each supplier on its own thread). It randomly connect and
+# disconnects the consumers, hence the gateways also do.
+
+$ Observer -ORBsvcconf observer.conf \
+ -consumer_tshift 0 -supplier_tshift 0 \
+ -suppliers 2 -consumers 5 \
+ -channels 4 -burstsize 1000 -burstcount 10 \
+ -burstpause 0 -busyhwm 1024 -maxwritedelay 1024
+
+# Create an event channel in a configuration that informs the
+# scheduler of the dependencies between consumers and suppliers.
+# THIS IS WORK IN PROGRESS
+
+$ Schedule -ORBsvcconf sched.conf -suppliers 5 -consumers 5
+
+NOTES
+
+ Don't worry about the "incomplete data" warning, it is a
+deffect in the test.
diff --git a/TAO/orbsvcs/tests/Event/Basic/Random.cpp b/TAO/orbsvcs/tests/Event/Basic/Random.cpp
new file mode 100644
index 00000000000..b9397f997ed
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Random.cpp
@@ -0,0 +1,578 @@
+// $Id$
+
+#include "Random.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Tests,
+ Random,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ RND_Driver driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+const int base_type = 20;
+
+void
+deactivate_servant (PortableServer::Servant servant
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::POA_var poa =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var oid =
+ poa->servant_to_id (servant ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+RND_Driver::RND_Driver (void)
+ : timer_ (this),
+ supplier_ (0),
+ nsuppliers_ (4),
+ nconsumers_ (4),
+ max_recursion_ (1),
+ verbose_ (0)
+{
+ TAO_EC_Default_Factory::init_svcs ();
+}
+
+int
+RND_Driver::run (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcasecmp (arg, "-suppliers") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ int n = ACE_OS::atoi (opt);
+ if (n >= 1)
+ this->nsuppliers_ = n;
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (ACE_OS::strcasecmp (arg, "-consumers") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ int n = ACE_OS::atoi (opt);
+ if (n >= 1)
+ this->nconsumers_ = n;
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (ACE_OS::strcasecmp (arg, "-max_recursion") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ int n = ACE_OS::atoi (opt);
+ if (n >= 0)
+ this->max_recursion_ = n;
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (ACE_OS::strcasecmp (arg, "-verbose") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->verbose_ = 1;
+ }
+ else
+ arg_shifter.ignore_arg ();
+ }
+
+ // ****************************************************************
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+ attributes.consumer_reconnect = 1;
+ attributes.supplier_reconnect = 1;
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ this->consumer_admin_ =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ this->supplier_admin_ =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ {
+ // Let's say that the execution time for event 2 is 1
+ // milliseconds...
+ ACE_Time_Value tv (0, 50000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ // The types int the range [0,ACE_ES_EVENT_UNDEFINED) are
+ // reserved for the EC...
+ qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ time,
+ 0);
+
+ this->timer_.connect (this->consumer_admin_.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ {
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (0, base_type, 0, 1);
+
+ this->supplier_.connect (this->supplier_admin_.in (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_NEW_RETURN (this->consumers_,
+ RND_Consumer*[this->nconsumers_],
+ 1);
+ for (int i = 0; i != this->nconsumers_; ++i)
+ {
+ ACE_NEW_RETURN (this->consumers_[i],
+ RND_Consumer (this),
+ 1);
+
+ CORBA::Object_var obj =
+ this->consumers_[i]->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_NEW_RETURN (this->suppliers_,
+ RND_Supplier*[this->nsuppliers_],
+ 1);
+ for (int j = 0; j != this->nsuppliers_; ++j)
+ {
+ ACE_NEW_RETURN (this->suppliers_[j],
+ RND_Supplier (this->verbose_),
+ 1);
+ this->suppliers_[j]->activate ();
+
+ CORBA::Object_var obj =
+ this->suppliers_[j]->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (30, 0);
+ orb->run (tv);
+
+ ACE_Thread_Manager::instance ()->wait ();
+
+ // ****************************************************************
+
+ {
+ for (int k = 0; k != this->nsuppliers_; ++k)
+ {
+ deactivate_servant (this->suppliers_[k]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->suppliers_[k]->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ delete[] this->suppliers_;
+ this->suppliers_ = 0;
+ }
+
+ // ****************************************************************
+
+ // We destroy now to verify that the callbacks work and do not
+ // produce any problems.
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ {
+ for (int k = 0; k != this->nconsumers_; ++k)
+ {
+ deactivate_servant (this->consumers_[k]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->consumers_[k]->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ delete[] this->consumers_;
+ this->consumers_ = 0;
+ }
+
+ // ****************************************************************
+
+ deactivate_servant (&ec_impl
+ ACE_ENV_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;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Random");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+RND_Driver::timer (const RtecEventComm::Event &e
+ ACE_ENV_ARG_DECL)
+{
+ int r = ACE_OS::rand ();
+ if (r < 0)
+ r = -r;
+
+ int n = r% 20;
+
+ switch (n)
+ {
+ case 0:
+ case 1:
+ {
+ // ACE_DEBUG ((LM_DEBUG, "Pushing an event\n"));
+ if (e.header.source < this->max_recursion_)
+ {
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0] = e;
+ event[0].header.source ++;
+ this->supplier_.push (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ break;
+
+ default:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ // ACE_DEBUG ((LM_DEBUG, "Received event\n"));
+ break;
+
+ case 6:
+ {
+ int n = ACE_OS::rand () % this->nsuppliers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Connecting supplier %d\n", n));
+
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (0, base_type, 0, 1);
+
+ this->suppliers_[n]->connect (this->supplier_admin_.in (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+
+ case 7:
+ {
+ int n = ACE_OS::rand () % this->nconsumers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Connecting consumer %d\n", n));
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group ();
+ qos.insert_type (base_type, 0);
+
+ this->consumers_[n]->connect (this->consumer_admin_.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+
+ case 8:
+ {
+ int n = ACE_OS::rand () % this->nsuppliers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Disconnecting supplier %d\n", n));
+
+ this->suppliers_[n]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+
+ case 9:
+ {
+ int n = ACE_OS::rand () % this->nconsumers_;
+
+ // ACE_DEBUG ((LM_DEBUG, "Disconnecting consumer %d\n", n));
+
+ this->consumers_[n]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ break;
+ }
+}
+
+void
+RND_Driver::event (const RtecEventComm::Event &e
+ ACE_ENV_ARG_DECL)
+{
+ this->timer (e ACE_ENV_ARG_PARAMETER);
+}
+
+// ****************************************************************
+
+void
+RND_Timer::push (const RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ this->driver_->timer (event[0] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+}
+
+// ****************************************************************
+
+void
+RND_Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr admin,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ {
+ this->proxy_ = admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ proxy =
+ RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(this->proxy_.in ());
+ }
+ RtecEventComm::PushConsumer_var me =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ proxy->connect_push_consumer (me.in (),
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RND_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ return;
+ this->proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+void
+RND_Consumer::push (const RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->driver_->event (event[0] ACE_ENV_ARG_PARAMETER);
+}
+
+void
+RND_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+// ****************************************************************
+
+void
+RND_Supplier::connect (RtecEventChannelAdmin::SupplierAdmin_ptr admin,
+ const RtecEventChannelAdmin::SupplierQOS &qos
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ {
+ this->proxy_ = admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ proxy =
+ RtecEventChannelAdmin::ProxyPushConsumer::_duplicate(this->proxy_.in ());
+ }
+ RtecEventComm::PushSupplier_var me =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ proxy->connect_push_supplier (me.in (),
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RND_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ return;
+ this->proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+RND_Supplier::push_new_event (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.type = base_type;
+ event[0].header.source = 0;
+
+ this->push (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+RND_Supplier::push (RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy;
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (CORBA::is_nil (this->proxy_.in ()))
+ return;
+
+ proxy =
+ RtecEventChannelAdmin::ProxyPushConsumer::_duplicate(this->proxy_.in ());
+ }
+
+ proxy->push (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+RND_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+int
+RND_Supplier::svc (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Thread %t started\n"));
+ int percent = 10;
+ int niterations = 5000;
+ for (int i = 0; i != niterations; ++i)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_Time_Value tv (0, 10000);
+ ACE_OS::sleep (tv);
+
+ this->push_new_event (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ if (this->verbose_
+ && i * 100 / niterations >= percent)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Thread %t %d%%\n", percent));
+ percent += 10;
+ }
+ }
+ ACE_DEBUG ((LM_DEBUG, "Thread %t completed\n"));
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Random.h b/TAO/orbsvcs/tests/Event/Basic/Random.h
new file mode 100644
index 00000000000..a1821d24c0b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Random.h
@@ -0,0 +1,183 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Random.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_RANDOM_H
+#define EC_RANDOM_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class RND_Driver;
+
+class RND_Consumer
+ : public POA_RtecEventComm::PushConsumer
+{
+ // = TITLE
+ // Simple consumer object
+ //
+ // = DESCRIPTION
+ //
+public:
+ /// Constructor
+ RND_Consumer (RND_Driver *driver);
+
+ void push (const RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void connect (RtecEventChannelAdmin::ConsumerAdmin_ptr admin,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// The driver
+ RND_Driver *driver_;
+
+ /// The supplier.
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy_;
+
+ /// Synch
+ TAO_SYNCH_MUTEX lock_;
+};
+
+inline
+RND_Consumer::RND_Consumer (RND_Driver *driver)
+ : driver_ (driver)
+{
+}
+
+// ****************************************************************
+
+class RND_Timer : public RND_Consumer
+{
+public:
+ RND_Timer (RND_Driver *driver);
+
+ void push (const RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+inline
+RND_Timer::RND_Timer (RND_Driver *driver)
+ : RND_Consumer (driver)
+{
+}
+
+// ****************************************************************
+
+class RND_Supplier
+ : public POA_RtecEventComm::PushSupplier
+ , public ACE_Task_Base
+{
+ // = TITLE
+ // Simple supplier object
+ //
+ // = DESCRIPTION
+ //
+public:
+ /// Constructor
+ RND_Supplier (int verbose);
+
+ void connect (RtecEventChannelAdmin::SupplierAdmin_ptr admin,
+ const RtecEventChannelAdmin::SupplierQOS &qos
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Push a single event...
+ void push_new_event (ACE_ENV_SINGLE_ARG_DECL);
+ void push (RtecEventComm::EventSet &event
+ ACE_ENV_ARG_DECL);
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Active method
+ virtual int svc (void);
+
+private:
+ /// The supplier.
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy_;
+
+ /// Synch
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Be verbose about the progress of the test
+ int verbose_;
+};
+
+inline
+RND_Supplier::RND_Supplier (int verbose)
+ : verbose_ (verbose)
+{
+}
+
+// ****************************************************************
+
+class RND_Driver
+{
+public:
+ RND_Driver (void);
+
+ /// Run the test
+ int run (int argc, char *argv[]);
+
+ /// The main timer has expired
+ void timer (const RtecEventComm::Event &e
+ ACE_ENV_ARG_DECL);
+
+ /// One of the consumers has received an event
+ void event (const RtecEventComm::Event &e
+ ACE_ENV_ARG_DECL);
+
+private:
+ RND_Driver (const RND_Driver &);
+ RND_Driver& operator= (const RND_Driver &);
+
+private:
+ /// The main timer
+ RND_Timer timer_;
+
+ /// The supplier
+ RND_Supplier supplier_;
+
+ /// Number of suppliers
+ int nsuppliers_;
+
+ /// The suppliers
+ RND_Supplier **suppliers_;
+
+ /// Number of consumers
+ int nconsumers_;
+
+ /// The consumers
+ RND_Consumer **consumers_;
+
+ /// Maximum recursion
+ int max_recursion_;
+
+ /// Be verbose about the progress of the test
+ int verbose_;
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin_;
+};
+
+#endif /* EC_RANDOM_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/Reconnect.cpp b/TAO/orbsvcs/tests/Event/Basic/Reconnect.cpp
new file mode 100644
index 00000000000..1fd8c294029
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Reconnect.cpp
@@ -0,0 +1,242 @@
+// $Id$
+
+#include "Reconnect.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+
+ACE_RCSID (EC_Tests_Basic,
+ Reconnect,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_Reconnect driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Reconnect::EC_Reconnect (void)
+ : allow_consumer_reconnect_ (0),
+ allow_supplier_reconnect_ (0),
+ disconnections_ (1000)
+{
+}
+
+int
+EC_Reconnect::parse_args (int& argc, char* argv[])
+{
+ if (this->EC_Driver::parse_args (argc, argv) != 0)
+ return -1;
+
+ ACE_Get_Opt get_opt (argc, argv, "scd:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'c':
+ this->allow_consumer_reconnect_ = 1;
+ break;
+ case 's':
+ this->allow_supplier_reconnect_ = 1;
+ break;
+ case 'd':
+ this->disconnections_ = ACE_OS::atoi (get_opt.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ this->print_usage ();
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+void
+EC_Reconnect::print_args (void) const
+{
+ this->EC_Driver::print_args ();
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Reconnect: \n"
+ " consumer_reconnect = %d\n"
+ " supplier_reconnect = %d\n"
+ " disconnect_count = %d\n",
+ this->allow_consumer_reconnect_,
+ this->allow_supplier_reconnect_,
+ this->disconnections_));
+}
+
+void
+EC_Reconnect::print_usage (void)
+{
+ this->EC_Driver::print_usage ();
+
+ ACE_DEBUG ((LM_DEBUG, "EC_Reconnect usage: [-s] [-c] [-d disc]\n"));
+}
+
+void
+EC_Reconnect::modify_attributes (TAO_EC_Event_Channel_Attributes& attr)
+{
+ attr.consumer_reconnect = this->allow_consumer_reconnect_;
+ attr.supplier_reconnect = this->allow_supplier_reconnect_;
+}
+
+void
+EC_Reconnect::execute_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->execute_consumer_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->execute_supplier_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ this->consumer_reconnect_.dump_results ("Reconnect/consumer", gsf);
+ this->supplier_reconnect_.dump_results ("Reconnect/supplier", gsf);
+
+ // this->EC_Driver::execute_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+EC_Reconnect::dump_results (void)
+{
+}
+
+void
+EC_Reconnect::execute_consumer_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ConsumerQOS qos;
+ int shutdown_event_type;
+ this->build_consumer_qos (0, qos, shutdown_event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->allow_consumer_reconnect_)
+ {
+ ACE_hrtime_t start_time = ACE_OS::gethrtime ();
+ for (int i = 0; i < this->disconnections_; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->consumers_[0]->connect (qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_hrtime_t stop = ACE_OS::gethrtime ();
+ this->consumer_reconnect_.sample (stop - start_time,
+ stop - start);
+ }
+ }
+ else
+ {
+ ACE_TRY
+ {
+ this->consumers_[0]->connect (qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_ERROR, "Expected exception\n"));
+ }
+ ACE_CATCH (RtecEventChannelAdmin::AlreadyConnected, ex)
+ {
+ /* do nothing */
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Expected AlreadyConnected exception");
+ }
+ ACE_ENDTRY;
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t start_time = ACE_OS::gethrtime ();
+ for (int i = 0; i < this->disconnections_; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->consumers_[0]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumers_[0]->connect (consumer_admin.in (),
+ qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_hrtime_t stop = ACE_OS::gethrtime ();
+ this->consumer_reconnect_.sample (stop - start_time,
+ stop - start);
+ }
+ }
+}
+
+void
+EC_Reconnect::execute_supplier_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierQOS qos;
+ int shutdown_event_type;
+ this->build_supplier_qos (0, qos, shutdown_event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->allow_supplier_reconnect_)
+ {
+ ACE_hrtime_t start_time = ACE_OS::gethrtime ();
+ for (int i = 0; i < this->disconnections_; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->suppliers_[0]->connect (qos, shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_hrtime_t stop = ACE_OS::gethrtime ();
+ this->supplier_reconnect_.sample (stop - start_time,
+ stop - start);
+ }
+ }
+ else
+ {
+ ACE_TRY
+ {
+ this->suppliers_[0]->connect (qos, shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_ERROR, "Expected exception\n"));
+ }
+ ACE_CATCH (RtecEventChannelAdmin::AlreadyConnected, ex)
+ {
+ /* do nothing */
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Expected AlreadyConnected exception");
+ }
+ ACE_ENDTRY;
+
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t start_time = ACE_OS::gethrtime ();
+ for (int i = 0; i < this->disconnections_; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->suppliers_[0]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->suppliers_[0]->connect (supplier_admin.in (),
+ qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_hrtime_t stop = ACE_OS::gethrtime ();
+ this->supplier_reconnect_.sample (stop - start_time,
+ stop - start);
+ }
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Reconnect.h b/TAO/orbsvcs/tests/Event/Basic/Reconnect.h
new file mode 100644
index 00000000000..e99cd4b9ffb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Reconnect.h
@@ -0,0 +1,75 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Reconnect.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_RECONNECT_H
+#define EC_RECONNECT_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class EC_Reconnect
+ *
+ * @brief Test the EC reconnection feature
+ *
+ * The EC can be configured to allow re-connection of suppliers
+ * and consumers, this test verifies that:
+ * + The EC does *not* allow reconnections if the feature is
+ * disabled (the default)
+ * + The EC does allow reconnections if the feature is enabled
+ * and:
+ * - There are no memory leaks
+ * - Compares the time required for a reconnection vs a complete
+ * connect/disconnect cycle, specially as the number of
+ * suppliers and consumers increases.
+ */
+class EC_Reconnect : public EC_Driver
+{
+public:
+ /// Constructor
+ EC_Reconnect (void);
+
+ // = The EC_Driver methods
+ /// add some command line args to enable/disable reconnections
+ virtual int parse_args (int& argc, char* argv[]);
+ virtual void print_args (void) const;
+ virtual void print_usage (void);
+
+ /// set the reconnection flags
+ virtual void modify_attributes (TAO_EC_Event_Channel_Attributes& attr);
+
+ /// Don't run the suppliers, just test connect and disconnect calls.
+ void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Don't dump the EC_Driver results, they are meaningless.
+ void dump_results (void);
+
+ /// Separate the suppliers and consumers.
+ void execute_consumer_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void execute_supplier_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+private:
+ /// What aspect of reconnection are we going to test?
+ int allow_consumer_reconnect_;
+ int allow_supplier_reconnect_;
+
+ /// The number of disconnections
+ int disconnections_;
+
+ ACE_Throughput_Stats consumer_reconnect_;
+ ACE_Throughput_Stats supplier_reconnect_;
+};
+
+#endif /* EC_RECONNECT_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/Schedule.cpp b/TAO/orbsvcs/tests/Event/Basic/Schedule.cpp
new file mode 100644
index 00000000000..b06b6e50355
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Schedule.cpp
@@ -0,0 +1,215 @@
+// $Id$
+
+#include "Schedule.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Sched/Config_Scheduler.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "ace/Get_Opt.h"
+#include "ace/Sched_Params.h"
+
+ACE_RCSID(EC_Tests_Basic, Schedule, "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_Schedule driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Schedule::EC_Schedule (void)
+ : scheduler_impl_ (0)
+{
+}
+
+int
+EC_Schedule::parse_args (int& argc, char* argv[])
+{
+ if (this->EC_Driver::parse_args (argc, argv) != 0)
+ return -1;
+
+ return 0;
+}
+
+void
+EC_Schedule::print_args (void) const
+{
+ this->EC_Driver::print_args ();
+}
+
+void
+EC_Schedule::print_usage (void)
+{
+ this->EC_Driver::print_usage ();
+}
+
+void
+EC_Schedule::initialize_ec_impl (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->scheduler_impl_ = new ACE_Config_Scheduler;
+ this->scheduler_ = this->scheduler_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->EC_Driver::initialize_ec_impl (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+EC_Schedule::modify_attributes (TAO_EC_Event_Channel_Attributes& attr)
+{
+ attr.scheduler = this->scheduler_.in (); // no need to dup
+}
+
+void
+EC_Schedule::cleanup_ec (void)
+{
+ this->EC_Driver::cleanup_ec ();
+ delete this->scheduler_impl_;
+}
+
+void
+EC_Schedule::execute_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Long min_priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ CORBA::Long max_priority =
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO);
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Schedule (%P|%t) computing schedule\n"));
+
+ RtecScheduler::RT_Info_Set_var infos;
+ RtecScheduler::Dependency_Set_var deps;
+ RtecScheduler::Config_Info_Set_var configs;
+ RtecScheduler::Scheduling_Anomaly_Set_var anomalies;
+ this->scheduler_->compute_scheduling (min_priority, max_priority,
+ infos.out (),
+ deps.out (),
+ configs.out (),
+ anomalies.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Schedule (%P|%t) schedule prepared\n"));
+
+ ACE_Scheduler_Factory::dump_schedule (infos.in (),
+ deps.in (),
+ configs.in (),
+ anomalies.in ());
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Schedule (%P|%t) schedule dumped\n"));
+
+}
+
+void
+EC_Schedule::build_consumer_qos (
+ int i,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ char name[128];
+ ACE_OS::sprintf (name, "EC_Schedule::Consumer::%04x", i);
+
+ RtecScheduler::handle_t rt_info =
+ this->scheduler_->create (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // The worst case execution time is far less than 2
+ // milliseconds, but that is a safe estimate....
+ ACE_Time_Value tv (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ this->scheduler_->set (rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ 0,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 0,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ int type_start =
+ this->consumer_type_start_
+ + i * this->consumer_type_shift_;
+
+ shutdown_event_type = type_start + this->consumer_type_count_;
+
+ ACE_ConsumerQOS_Factory qos_factory;
+ qos_factory.start_disjunction_group ();
+ qos_factory.insert_type (shutdown_event_type, rt_info);
+
+ for (int j = 0; j != this->consumer_type_count_; ++j)
+ qos_factory.insert_type (type_start + j, rt_info);
+
+ qos = qos_factory.get_ConsumerQOS ();
+}
+
+void
+EC_Schedule::build_supplier_qos (
+ int i,
+ RtecEventChannelAdmin::SupplierQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ char name[128];
+ ACE_OS::sprintf (name, "EC_Schedule::Supplier::%04x", i);
+
+ RtecScheduler::handle_t rt_info =
+ this->scheduler_->create (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_Time_Value tv (0, this->burst_pause_);
+ RtecScheduler::Period_t rate = tv.usec () * 10;
+
+ // The execution times are set to reasonable values, but
+ // actually they are changed on the real execution, i.e. we
+ // lie to the scheduler to obtain right priorities; but we
+ // don't care if the set is schedulable.
+ tv.set (0, 2000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+ this->scheduler_->set (rt_info,
+ RtecScheduler::VERY_HIGH_CRITICALITY,
+ time, time, time,
+ rate,
+ RtecScheduler::VERY_LOW_IMPORTANCE,
+ time,
+ 1,
+ RtecScheduler::OPERATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ int type_start = this->supplier_type_start_ + i*this->supplier_type_shift_;
+ int supplier_id = i + 1;
+ shutdown_event_type = type_start + this->supplier_type_count_;
+
+ ACE_SupplierQOS_Factory qos_factory;
+ for (int j = 0; j != this->supplier_type_count_; ++j)
+ qos_factory.insert (supplier_id,
+ type_start + j,
+ rt_info, 1);
+
+ qos_factory.insert (supplier_id,
+ shutdown_event_type,
+ rt_info, 1);
+
+ qos = qos_factory.get_SupplierQOS ();
+}
+
+void
+EC_Schedule::dump_results (void)
+{
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Schedule.h b/TAO/orbsvcs/tests/Event/Basic/Schedule.h
new file mode 100644
index 00000000000..c139b699227
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Schedule.h
@@ -0,0 +1,85 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Schedule.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_SCHEDULE_H
+#define EC_SCHEDULE_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecSchedulerS.h"
+
+/**
+ * @class EC_Schedule
+ *
+ * @brief Test the EC scheduling test
+ *
+ * The EC can be used in conjunction with the scheduling service
+ * to analyze the schedulabity of a system and compute priority
+ * assignments that guarantee the correct behavior of it.
+ * Most of the work is actually done by the scheduler (as it
+ * should be), the event channel simply plays two roles:
+ * 1) Feed the scheduler with the dependency information between
+ * consumers and suppliers based on their QoS requirements,
+ * subscriptions and publications.
+ * 2) At run-time use the scheduler information to dispatch the
+ * events at the right priority.
+ * The current version only verifies the first role.
+ */
+class EC_Schedule : public EC_Driver
+{
+public:
+ /// Constructor
+ EC_Schedule (void);
+
+ // = The EC_Driver methods
+ /// add some command line args to change the scheduling service to
+ /// use.
+ virtual int parse_args (int& argc, char* argv[]);
+ virtual void print_args (void) const;
+ virtual void print_usage (void);
+
+ /// Set the scheduling service attribute
+ void initialize_ec_impl (ACE_ENV_SINGLE_ARG_DECL);
+ void cleanup_ec (void);
+ virtual void modify_attributes (TAO_EC_Event_Channel_Attributes& attr);
+
+ /// Don't run the suppliers, just compute the schedule.
+ void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Don't dump the EC_Driver results, they are meaningless.
+ void dump_results (void);
+
+ /// This time really connect to the scheduler
+ virtual void build_consumer_qos (
+ int i,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL_NOT_USED);
+ virtual void build_supplier_qos (
+ int i,
+ RtecEventChannelAdmin::SupplierQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+private:
+ /// The scheduler implementation
+ POA_RtecScheduler::Scheduler *scheduler_impl_;
+
+ /// The scheduler object reference
+ RtecScheduler::Scheduler_var scheduler_;
+};
+
+#endif /* EC_SCHEDULE_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/Shutdown.cpp b/TAO/orbsvcs/tests/Event/Basic/Shutdown.cpp
new file mode 100644
index 00000000000..ea2c18a1743
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Shutdown.cpp
@@ -0,0 +1,89 @@
+// $Id$
+
+#include "Shutdown.h"
+#include "Consumer.h"
+#include "Supplier.h"
+
+ACE_RCSID(EC_Tests_Basic, Shutdown, "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_Shutdown driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Shutdown::EC_Shutdown (void)
+ : consumer_disconnects_ (0),
+ supplier_disconnects_ (0)
+{
+}
+
+void
+EC_Shutdown::execute_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Shutdown (%P|%t) destroying EC\n"));
+
+ this->destroy_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Shutdown (%P|%t) ec destroyed\n"));
+
+ this->deactivate_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Shutdown (%P|%t) ec deactivated\n"));
+
+ this->cleanup_ec ();
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Shutdown (%P|%t) ec cleanup\n"));
+
+ this->initialize_ec_impl (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->connect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->connect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Shutdown (%P|%t) status reset\n"));
+
+ // this->EC_Driver::execute_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+EC_Shutdown::dump_results (void)
+{
+ if (this->consumer_disconnects_ != this->n_consumers_)
+ ACE_ERROR ((LM_ERROR,
+ "Unexpected number (%d) of consumers disconnected\n",
+ this->consumer_disconnects_));
+
+ if (this->supplier_disconnects_ != this->n_suppliers_)
+ ACE_ERROR ((LM_ERROR,
+ "Unexpected number (%d) of suppliers disconnected\n",
+ this->supplier_disconnects_));
+}
+
+void
+EC_Shutdown::consumer_disconnect (void* cookie
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ this->consumer_disconnects_++;
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "Consumer %x has been disconnected\n", cookie));
+}
+
+void
+EC_Shutdown::supplier_disconnect (void* cookie
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ this->supplier_disconnects_++;
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "Supplier %x has been disconnected\n", cookie));
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Shutdown.h b/TAO/orbsvcs/tests/Event/Basic/Shutdown.h
new file mode 100644
index 00000000000..81050629f9f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Shutdown.h
@@ -0,0 +1,59 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Shutdown.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_SHUTDOWN_H
+#define EC_SHUTDOWN_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class EC_Shutdown
+ *
+ * @brief Test the EC shutdown features
+ *
+ * The EC must inform its suppliers and consumers on the event of
+ * its destruction.
+ * This test exercises that feature of the EC.
+ */
+class EC_Shutdown : public EC_Driver
+{
+public:
+ /// Constructor
+ EC_Shutdown (void);
+
+ // = The EC_Driver methods
+ /// Don't run the suppliers just create the EC and then destroy it.
+ void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Don't dump the EC_Driver results, they are meaningless.
+ void dump_results (void);
+
+ /// One of the consumers in the test has been disconnected from the EC
+ virtual void consumer_disconnect (void* consumer_cookie
+ ACE_ENV_ARG_DECL);
+
+ /// One of the suppliers in the test has been disconnected from the EC
+ virtual void supplier_disconnect (void* supplier_cookie
+ ACE_ENV_ARG_DECL);
+
+
+private:
+ /// Number of consumer and supplier disconnect messages.
+ int consumer_disconnects_;
+ int supplier_disconnects_;
+};
+
+#endif /* EC_SHUTDOWN_H */
diff --git a/TAO/orbsvcs/tests/Event/Basic/Timeout.cpp b/TAO/orbsvcs/tests/Event/Basic/Timeout.cpp
new file mode 100644
index 00000000000..f00ec8abab4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Timeout.cpp
@@ -0,0 +1,205 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Timeout,
+ "$Id$")
+
+// ****************************************************************
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier supplier;
+
+ supplier.activate (consumer_admin.in (),
+ 50 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier.connect (supplier_admin.in (),
+ 0, 20,
+ 0, 20
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Consumer interval_consumer ("Consumer/interval");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ // Let's say that the execution time for event 2 is 1
+ // milliseconds...
+ ACE_Time_Value tv (0, 100000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ // The types int the range [0,ACE_ES_EVENT_UNDEFINED) are
+ // reserved for the EC...
+ consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ time,
+ 0);
+
+ interval_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer conjunction_consumer ("Consumer/conjunction");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+ {
+ // Let's say that the execution time for event 2 is 1
+ // milliseconds...
+ ACE_Time_Value tv (0, 200000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_conjunction_group ();
+ consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ time,
+ 0);
+ consumer_qos.insert_type (20,
+ 0);
+
+ conjunction_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer deadline_consumer ("Consumer/deadline");
+
+ {
+ ACE_Time_Value tv (0, 80000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert_time (ACE_ES_EVENT_DEADLINE_TIMEOUT,
+ time,
+ 0);
+ consumer_qos.insert_type (20,
+ 0);
+
+ deadline_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (5, 0);
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run (tv);
+
+ // ****************************************************************
+
+ deadline_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ conjunction_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ interval_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ interval_consumer.dump_results (50, 5);
+ conjunction_consumer.dump_results (25, 5);
+ deadline_consumer.dump_results (100, 5);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp b/TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp
new file mode 100644
index 00000000000..af77cc9fcbd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp
@@ -0,0 +1,319 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+#include "Counting_Supplier.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+ACE_RCSID (EC_Tests,
+ Wildcard,
+ "$Id$")
+
+int
+main (int argc, char* argv[])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // ORB initialization boiler plate...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ TAO_EC_Event_Channel_Attributes attributes (poa.in (),
+ poa.in ());
+
+ TAO_EC_Event_Channel ec_impl (attributes);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var event_channel =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // ****************************************************************
+
+ // Obtain the consumer admin..
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the supplier admin..
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ event_channel->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ const int event_type = 20;
+ const int event_source = 10;
+ const int milliseconds = 50;
+
+ EC_Counting_Supplier supplier;
+
+ supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier.connect (supplier_admin.in (),
+ event_source,
+ event_type,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier other_supplier;
+
+ other_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ other_supplier.connect (supplier_admin.in (),
+ event_source + 1,
+ event_type + 1,
+ event_source + 1,
+ event_type + 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier any_source_supplier;
+
+ any_source_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ any_source_supplier.connect (supplier_admin.in (),
+ 0,
+ event_type,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier any_type_supplier;
+
+ any_type_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ any_type_supplier.connect (supplier_admin.in (),
+ event_source,
+ 0,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Supplier wildcard_supplier;
+
+ wildcard_supplier.activate (consumer_admin.in (),
+ milliseconds
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ wildcard_supplier.connect (supplier_admin.in (),
+ 0,
+ 0,
+ event_source,
+ event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ EC_Counting_Consumer regular_consumer ("Consumer/regular");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (event_source, event_type, 0);
+
+ regular_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer any_type_consumer ("Consumer/any_type");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (event_source, 0, 0);
+
+ any_type_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer any_source_consumer ("Consumer/any_source");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (0, event_type, 0);
+
+ any_source_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ EC_Counting_Consumer wildcard_consumer ("Consumer/wildcard");
+ // Create a consumer, intialize its RT_Info structures, and
+ // connnect to the event channel....
+
+
+ {
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group ();
+ consumer_qos.insert (0, 0, 0);
+
+ wildcard_consumer.connect (consumer_admin.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // ****************************************************************
+
+ ACE_Time_Value tv (5, 0);
+ // Wait for events, using work_pending()/perform_work() may help
+ // or using another thread, this example is too simple for that.
+ orb->run (tv);
+
+ // ****************************************************************
+
+ wildcard_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ any_source_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ any_type_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ regular_consumer.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ wildcard_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ wildcard_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ any_type_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ any_source_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ any_source_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ other_supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ other_supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier.deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ supplier.disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ****************************************************************
+
+ event_channel->destroy (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;
+
+ // ****************************************************************
+
+ CORBA::ULong expected =
+ wildcard_supplier.event_count
+ + any_type_supplier.event_count
+ + any_source_supplier.event_count
+ + other_supplier.event_count
+ + supplier.event_count;
+ wildcard_consumer.dump_results (expected, 5);
+
+ expected =
+ wildcard_supplier.event_count
+ + any_type_supplier.event_count
+ + any_source_supplier.event_count
+ // NOT THIS ONE + other_supplier.event_count
+ + supplier.event_count;
+ any_source_consumer.dump_results (expected, 5);
+
+ expected =
+ wildcard_supplier.event_count
+ + any_type_supplier.event_count
+ + any_source_supplier.event_count
+ // NOT THIS ONE + other_supplier.event_count
+ + supplier.event_count;
+ any_type_consumer.dump_results (expected, 5);
+
+ expected =
+ wildcard_supplier.event_count
+ + any_type_supplier.event_count
+ + any_source_supplier.event_count
+ // NOT THIS ONE + other_supplier.event_count
+ + supplier.event_count;
+ regular_consumer.dump_results (expected, 5);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Service");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/control.conf b/TAO/orbsvcs/tests/Event/Basic/control.conf
new file mode 100644
index 00000000000..bfedbdcfa71
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/control.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECConsumerControl reactive -ECSupplierControl reactive -ECConsumerControlPeriod 50000 -ECSupplierControlPeriod 50000"
diff --git a/TAO/orbsvcs/tests/Event/Basic/control.conf.xml b/TAO/orbsvcs/tests/Event/Basic/control.conf.xml
new file mode 100644
index 00000000000..05dd8b01c20
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/control.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Basic/control.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECConsumerControl reactive -ECSupplierControl reactive -ECConsumerControlPeriod 50000 -ECSupplierControlPeriod 50000"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl b/TAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl
new file mode 100755
index 00000000000..74b7987f7d8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl
@@ -0,0 +1,60 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs the client and all the other servers that
+# are needed
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$conf_file = PerlACE::LocalFile ("exhaustive$PerlACE::svcconf_ext");
+
+@dispatching_configs = ("-ECDispatching reactive",
+ "-ECDispatching mt -ECDispatchingThreads 4");
+@collection_strategies = ("copy_on_read",
+ "copy_on_write",
+ "delayed");
+@collection_types = ("list",
+ "rb_tree");
+@filtering_configs = ("-ECFiltering prefix -ECSupplierFilter per-supplier",
+ "-ECFiltering prefix -ECSupplierFilter null");
+
+foreach $d (@dispatching_configs) {
+ foreach $f (@filtering_configs) {
+ foreach $c (@collection_strategies) {
+ foreach $t (@collection_types) {
+ my $collection = "mt:".$c.":".$t;
+
+ my $config = 'static EC_Factory "'
+ .$d
+ ." -ECProxyPushConsumerCollection ".$collection
+ ." -ECProxyPushSupplierCollection ".$collection
+ ." ".$f
+ .'"';
+
+ open (CONFIG,">$conf_file") || die "Cannot open $conf_file\n";
+ print CONFIG $config, "\n";
+ close (CONFIG);
+
+ print STDERR "\n\n", $config, "\n";
+
+ system ("purify.exe "
+ . "/run .\\Release\\Random.exe "
+ . " -ORBSvcConf $conf_file"
+ . " -suppliers 16"
+ . " -consumers 16"
+ . " -max_recursion 0");
+ }
+ }
+ }
+}
+
+unlink "$conf_file";
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Event/Basic/mt.svc.conf b/TAO/orbsvcs/tests/Event/Basic/mt.svc.conf
new file mode 100644
index 00000000000..8ba2c743960
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/mt.svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECObserver null -ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECdispatching reactive -ECscheduling null -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/tests/Event/Basic/mt.svc.conf.xml b/TAO/orbsvcs/tests/Event/Basic/mt.svc.conf.xml
new file mode 100644
index 00000000000..9eb9319264f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/mt.svc.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Basic/mt.svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECObserver null -ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECdispatching reactive -ECscheduling null -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Basic/observer.conf b/TAO/orbsvcs/tests/Event/Basic/observer.conf
new file mode 100644
index 00000000000..c4639fe7f59
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/observer.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECObserver basic -ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECDispatching reactive -ECscheduling null -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/tests/Event/Basic/observer.conf.xml b/TAO/orbsvcs/tests/Event/Basic/observer.conf.xml
new file mode 100644
index 00000000000..3629833dff0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/observer.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Basic/observer.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECObserver basic -ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECDispatching reactive -ECscheduling null -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Basic/rteventtestexe.mpb b/TAO/orbsvcs/tests/Event/Basic/rteventtestexe.mpb
new file mode 100644
index 00000000000..63ef09376f3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/rteventtestexe.mpb
@@ -0,0 +1,13 @@
+// -*- MPC -*-
+// $Id$
+
+project : messaging, rteventexe, rtevent_serv, naming, iortable {
+ after += Event_Test_Lib
+ libs += ECTests
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Basic/run_test.pl b/TAO/orbsvcs/tests/Event/Basic/run_test.pl
new file mode 100755
index 00000000000..daa88c808d1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/run_test.pl
@@ -0,0 +1,101 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs the client and all the other servers that
+# are needed
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$svc_conf = PerlACE::LocalFile ("svc$PerlACE::svcconf_ext");
+$observer_conf = PerlACE::LocalFile ("observer$PerlACE::svcconf_ext");
+$svc_complex_conf = PerlACE::LocalFile ("svc.complex$PerlACE::svcconf_ext");
+$mt_svc_conf = PerlACE::LocalFile ("mt.svc$PerlACE::svcconf_ext");
+$svc_complex_conf = PerlACE::LocalFile ("svc.complex$PerlACE::svcconf_ext");
+$control_conf = PerlACE::LocalFile ("control$PerlACE::svcconf_ext");
+
+sub RunTest ($$$)
+{
+ my $message = shift;
+ my $program = shift;
+ my $arguments = shift;
+
+ my $TEST = new PerlACE::Process ($program, $arguments);
+
+ print STDERR "\n\n$message\n";
+
+ my $test = $TEST->SpawnWaitKill (240);
+
+ if ($test != 0) {
+ print STDERR "ERROR: Test returned $test\n";
+ $status = 1;
+ }
+}
+
+RunTest ("Reconnect suppliers and consumers, using disconnect/connect calls",
+ "Reconnect",
+ "-ORBsvcconf $svc_conf -suppliers 100 -consumers 100 -d 100");
+
+RunTest ("Reconnect suppliers and consumers, using connect calls",
+ "Reconnect",
+ "-ORBsvcconf $svc_conf -suppliers 100 -consumers 100 -d 100 -s -c");
+
+RunTest ("Shutdown EC with clients still attached",
+ "Shutdown",
+ "-ORBsvcconf $svc_conf -suppliers 5 -consumers 5");
+
+RunTest ("Gateway test",
+ "Gateway",
+ "-ORBsvcconf $observer_conf");
+
+RunTest ("Complex event channel test, multiple ECs connected through gateways",
+ "Observer",
+ "-ORBsvcconf $observer_conf -consumer_tshift 0 -consumers 5 -supplier_tshift 0 -suppliers 2 -burstsize 10 -burstcount 10 -burstpause 0");
+
+RunTest ("Timeout tests",
+ "Timeout",
+ "-ORBsvcconf $svc_conf");
+
+RunTest ("Wildcard tests",
+ "Wildcard",
+ "-ORBsvcconf $svc_conf");
+
+RunTest ("Negation tests",
+ "Negation",
+ "-ORBsvcconf $svc_conf");
+
+RunTest ("Bitmask tests",
+ "Bitmask",
+ "-ORBSvcConf $svc_complex_conf");
+
+RunTest ("Disconnect callbacks test",
+ "Disconnect",
+ "-ORBsvcconf $svc_conf");
+
+RunTest ("MT Disconnects test",
+ "MT_Disconnect",
+ "-ORBSvcConf $mt_svc_conf");
+
+RunTest ("Atomic Reconnection test",
+ "Atomic_Reconnect",
+ "-ORBSvcConf $mt_svc_conf");
+
+RunTest ("Complex filter",
+ "Complex",
+ "-ORBSvcConf $svc_complex_conf");
+
+RunTest ("Control test",
+ "Control",
+ "-ORBSvcConf $control_conf");
+
+RunTest ("Random test",
+ "Random",
+ "-ORBSvcConf $svc_conf -suppliers 4 -consumers 4 -max_recursion 1");
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Event/Basic/sched.conf b/TAO/orbsvcs/tests/Event/Basic/sched.conf
new file mode 100644
index 00000000000..bfc09bc8bdf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/sched.conf
@@ -0,0 +1,3 @@
+# $Id$
+
+dynamic EC_Factory Service_Object * TAO_RTSchedEvent:_make_TAO_EC_Sched_Factory() "-ECDispatching priority -ECScheduling priority -ECFiltering priority -ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECSupplierFiltering per-supplier"
diff --git a/TAO/orbsvcs/tests/Event/Basic/sched.conf.xml b/TAO/orbsvcs/tests/Event/Basic/sched.conf.xml
new file mode 100644
index 00000000000..d4961bedca2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/sched.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Basic/sched.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="EC_Factory" type="Service_Object">
+ <initializer path="TAO_RTSchedEvent" init="_make_TAO_EC_Sched_Factory" params="-ECDispatching priority -ECScheduling priority -ECFiltering priority -ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECProxyConsumerLock thread -ECProxySupplierLock thread -ECSupplierFiltering per-supplier"/>
+ </dynamic>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Basic/svc.complex.conf b/TAO/orbsvcs/tests/Event/Basic/svc.complex.conf
new file mode 100644
index 00000000000..0b3e29e08b1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/svc.complex.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECdispatching reactive -ECfiltering prefix -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/tests/Event/Basic/svc.complex.conf.xml b/TAO/orbsvcs/tests/Event/Basic/svc.complex.conf.xml
new file mode 100644
index 00000000000..7a4a28be570
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/svc.complex.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Basic/svc.complex.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:delayed:list -ECProxyPushSupplierCollection mt:delayed:list -ECdispatching reactive -ECfiltering prefix -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Basic/svc.conf b/TAO/orbsvcs/tests/Event/Basic/svc.conf
new file mode 100644
index 00000000000..c4d0cc45fbf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECdispatching reactive -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/tests/Event/Basic/svc.conf.xml b/TAO/orbsvcs/tests/Event/Basic/svc.conf.xml
new file mode 100644
index 00000000000..491ecb5aeb9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Basic/svc.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Basic/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:copy_on_write:list -ECProxyPushSupplierCollection mt:copy_on_write:list -ECdispatching reactive -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Makefile.am b/TAO/orbsvcs/tests/Event/Makefile.am
new file mode 100644
index 00000000000..ad70d16ed4e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Makefile.am
@@ -0,0 +1,16 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ Mcast \
+ lib \
+ Performance \
+ Basic
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_export.h b/TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_export.h
new file mode 100644
index 00000000000..9c398b58046
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef ECMCASTTESTS_EXPORT_H
+#define ECMCASTTESTS_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (ECMCASTTESTS_HAS_DLL)
+# define ECMCASTTESTS_HAS_DLL 0
+# endif /* ! ECMCASTTESTS_HAS_DLL */
+#else
+# if !defined (ECMCASTTESTS_HAS_DLL)
+# define ECMCASTTESTS_HAS_DLL 1
+# endif /* ! ECMCASTTESTS_HAS_DLL */
+#endif
+
+#if defined (ECMCASTTESTS_HAS_DLL) && (ECMCASTTESTS_HAS_DLL == 1)
+# if defined (ECMCASTTESTS_BUILD_DLL)
+# define ECMcastTests_Export ACE_Proper_Export_Flag
+# define ECMCASTTESTS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define ECMCASTTESTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* ECMCASTTESTS_BUILD_DLL */
+# define ECMcastTests_Export ACE_Proper_Import_Flag
+# define ECMCASTTESTS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define ECMCASTTESTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* ECMCASTTESTS_BUILD_DLL */
+#else /* ECMCASTTESTS_HAS_DLL == 1 */
+# define ECMcastTests_Export
+# define ECMCASTTESTS_SINGLETON_DECLARATION(T)
+# define ECMCASTTESTS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* ECMCASTTESTS_HAS_DLL == 1 */
+
+#endif /* ECMCASTTESTS_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_lib.mpc b/TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_lib.mpc
new file mode 100644
index 00000000000..d9c5af671ff
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_lib.mpc
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+// $Id$
+
+project: rtevent_serv {
+ sharedname = ECMcastTests
+ dynamicflags = ECMCASTTESTS_BUILD_DLL
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp
new file mode 100644
index 00000000000..fe118587fac
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp
@@ -0,0 +1,163 @@
+// $Id$
+
+#include "EC_Wrapper.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "ace/Auto_Ptr.h"
+
+EC_Wrapper::EC_Wrapper (void)
+ : ec_impl_ (0),
+ orb_ ()
+{
+}
+
+TAO_EC_Servant_Var<EC_Wrapper>
+EC_Wrapper::create (void)
+{
+ TAO_EC_Servant_Var<EC_Wrapper> w;
+ ACE_NEW_RETURN (w,
+ EC_Wrapper,
+ w);
+ return w;
+}
+
+EC_Wrapper::~EC_Wrapper (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->destroy_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // ignore
+ }
+ ACE_ENDTRY;
+}
+
+int
+EC_Wrapper::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa)
+{
+ if (CORBA::is_nil (orb)
+ || this->ec_impl_)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "EC_Wrapper::init invoked improperly\n"),
+ -1);
+ }
+
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ TAO_EC_Event_Channel_Attributes attr (poa, poa);
+
+ // Allow reconnections - used by some tests.
+ attr.consumer_reconnect = 1;
+
+ TAO_EC_Event_Channel * impl = 0;
+ ACE_NEW_RETURN (impl,
+ TAO_EC_Event_Channel (attr),
+ -1);
+ auto_ptr<TAO_EC_Event_Channel> impl_release (impl);
+
+ ACE_TRY_NEW_ENV
+ {
+ impl->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Suppressed the following exception "
+ "in EC_Wrapper::init:\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ this->ec_impl_ = impl_release.release ();
+ return 0;
+}
+
+RtecEventChannelAdmin::ConsumerAdmin_ptr
+EC_Wrapper::for_consumers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->ec_impl_)
+ return this->ec_impl_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ else
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), RtecEventChannelAdmin::ConsumerAdmin::_nil());
+}
+
+RtecEventChannelAdmin::SupplierAdmin_ptr
+EC_Wrapper::for_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->ec_impl_)
+ return this->ec_impl_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ else
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), RtecEventChannelAdmin::SupplierAdmin::_nil());
+}
+
+void
+EC_Wrapper::destroy_ec (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ auto_ptr<TAO_EC_Event_Channel> ec_impl_aptr (this->ec_impl_);
+ this->ec_impl_ = 0;
+
+ if (ec_impl_aptr.get ())
+ {
+ ec_impl_aptr->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+EC_Wrapper::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Deregister from POA.
+ this->deactivator_.deactivate ();
+
+ ACE_TRY
+ {
+ this->destroy_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ this->orb_->shutdown ();
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ this->orb_->shutdown ();
+}
+
+RtecEventChannelAdmin::Observer_Handle
+EC_Wrapper::append_observer (RtecEventChannelAdmin::Observer_ptr observer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER))
+{
+ if (this->ec_impl_)
+ return this->ec_impl_->append_observer (observer ACE_ENV_ARG_PARAMETER);
+ else
+ ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
+}
+
+void
+EC_Wrapper::remove_observer (RtecEventChannelAdmin::Observer_Handle handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER))
+{
+ if (this->ec_impl_)
+ this->ec_impl_->remove_observer (handle ACE_ENV_ARG_PARAMETER);
+ else
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h
new file mode 100644
index 00000000000..20031f40dc1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h
@@ -0,0 +1,97 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef EC_WRAPPER_H
+#define EC_WRAPPER_H
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "ECMcastTests_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+class TAO_EC_Event_Channel;
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class EC_Wrapper
+ *
+ * @brief This class decorates Rtec Event Channel implementation:
+ * - destroy () also shutdowns the ORB
+ * - automatic cleanup in destructor, if necessary
+ */
+class ECMcastTests_Export EC_Wrapper:
+ public virtual POA_RtecEventChannelAdmin::EventChannel,
+ public TAO_EC_Deactivated_Object
+{
+public:
+
+ /// Create a new EC_Wrapper object.
+ /// (Constructor access is restricted to insure that all
+ /// EC_Wrapper objects are heap-allocated.)
+ static TAO_EC_Servant_Var<EC_Wrapper> create (void);
+
+ /// Destructor. Destroys the Event Channel implementation.
+ virtual ~EC_Wrapper (void);
+
+ /// Create and initialize underlying EC servant.
+ int init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa);
+
+ /// RtecEventChannelAdmin::Event_Channel methods.
+ //@{
+ virtual RtecEventChannelAdmin::ConsumerAdmin_ptr
+ for_consumers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual RtecEventChannelAdmin::SupplierAdmin_ptr
+ for_suppliers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Destroy the Event Channel, deactivate from POA, and shut down
+ /// the ORB.
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual RtecEventChannelAdmin::Observer_Handle
+ append_observer (RtecEventChannelAdmin::Observer_ptr observer
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_APPEND_OBSERVER));
+ virtual void remove_observer (RtecEventChannelAdmin::Observer_Handle
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR,
+ RtecEventChannelAdmin::EventChannel::CANT_REMOVE_OBSERVER));
+ //@}
+
+protected:
+
+ /// Constructor (protected). Clients can create new
+ /// EC_Wrapper objects using the static create() method.
+ EC_Wrapper (void);
+
+private:
+
+ /// Helper - destroys Event Channel and deactivate from POA, if
+ /// necessary.
+ void destroy_ec (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Event Channel implementation.
+ /*
+ * Once Event Channel implementation is made reference-counted, this
+ * pointer should turn into a Servant_Var.
+ */
+ TAO_EC_Event_Channel *ec_impl_;
+
+ /// A reference to the ORB, so we can shut it down.
+ CORBA::ORB_var orb_;
+};
+
+#endif /* EC_WRAPPER_H */
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp
new file mode 100644
index 00000000000..667ac9e8efb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.cpp
@@ -0,0 +1,162 @@
+// $Id$
+
+#include "Gateway_EC.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/ECG_Mcast_Gateway.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "ace/Get_Opt.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/OS_NS_stdio.h"
+
+Gateway_EC::Gateway_EC (void)
+ : ec_ior_file_ ("gateway-ec.ior")
+{
+}
+
+int
+Gateway_EC::check_for_nil (CORBA::Object_ptr obj, const char *message)
+{
+ if (CORBA::is_nil (obj))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Object reference <%s> is nil\n",
+ message),
+ -1);
+ else
+ return 0;
+}
+
+int
+Gateway_EC::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "i:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'i':
+ this->ec_ior_file_ = get_opt.optarg;
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-i ior_file_name"
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+void
+Gateway_EC::write_ior_file (CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ // Write EC ior to a file.
+ CORBA::String_var str;
+ str = orb->object_to_string (ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ FILE *output_file= ACE_OS::fopen (this->ec_ior_file_, "w");
+ if (output_file == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ this->ec_ior_file_));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ ACE_OS::fprintf (output_file, "%s", str.in ());
+ ACE_OS::fclose (output_file);
+}
+
+int
+Gateway_EC::run (int argc, char ** argv)
+{
+ // Event Channel Configuration.
+ TAO_EC_Default_Factory::init_svcs ();
+ // Mcast gateway configuration.
+ TAO_ECG_Mcast_Gateway::init_svcs ();
+
+ TAO_EC_ORB_Holder orb_destroyer;
+
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB and POA, POA Manager, parse args.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ orb_destroyer.init (orb);
+
+ if (parse_args (argc, argv) == -1)
+ return -1;
+
+ 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;
+ if (check_for_nil (poa.in (), "POA") == -1)
+ return -1;
+ PortableServer::POAManager_var manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set up EC.
+ TAO_EC_Servant_Var<EC_Wrapper> ec_wrapper (EC_Wrapper::create ());
+ if (!ec_wrapper.in ())
+ return -1;
+
+ if (ec_wrapper->init (orb.in (),
+ poa.in ()) != 0)
+ return -1;
+
+ RtecEventChannelAdmin::EventChannel_var ec;
+ TAO_EC_Object_Deactivator ec_deactivator;
+ activate (ec,
+ poa.in (),
+ ec_wrapper.in (),
+ ec_deactivator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ec_wrapper->set_deactivator (ec_deactivator);
+
+ this->write_ior_file (orb.in (), ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set up multicast components.
+ // Obtain mcast gateway from service configurator.
+ TAO_ECG_Mcast_Gateway * gateway = 0;
+ gateway =
+ ACE_Dynamic_Service<TAO_ECG_Mcast_Gateway>::instance ("ECG_Mcast_Gateway");
+
+ if (!gateway)
+ {
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ ACE_TRY_CHECK;
+ }
+ gateway->run (orb.in (), ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run server.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected Exception in Gateway EC:");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h
new file mode 100644
index 00000000000..1db97bc26de
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+// $Id$
+
+#ifndef GATEWAY_EC_H
+#define GATEWAY_EC_H
+
+#include "EC_Wrapper.h"
+#include "ECMcastTests_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Gateway_EC
+ *
+ * @brief Runs multicast federated Event Channel server.
+ *
+ * Runs Event Channel and mcast receiver and/or sender (as specified
+ * in service config file).
+ */
+class ECMcastTests_Export Gateway_EC
+{
+public:
+
+ /// Constructor.
+ Gateway_EC (void);
+
+ /// Run the server.
+ /// Valid arguments: [-i ior_filename].
+ int run (int argc, char ** argv);
+
+private:
+
+ /// Helpers.
+ //@{
+ int parse_args (int argc, char *argv[]);
+ int check_for_nil (CORBA::Object_ptr obj, const char *message);
+ void write_ior_file (CORBA::ORB_ptr orb,
+ RtecEventChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL);
+ //@}
+
+ /// Event Channel ior is written to this file.
+ /// Default is "gateway-ec.ior", which can be overridden with the "-i"
+ /// argument option.
+ const char * ec_ior_file_;
+};
+
+#endif /* GATEWAY_EC_H */
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/Makefile.am b/TAO/orbsvcs/tests/Event/Mcast/Common/Makefile.am
new file mode 100644
index 00000000000..27940a1cb2b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Common/Makefile.am
@@ -0,0 +1,51 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.ECMcastTests_lib.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_LTLIBRARIES = libECMcastTests.la
+
+libECMcastTests_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DECMCASTTESTS_BUILD_DLL
+
+libECMcastTests_la_SOURCES = \
+ EC_Wrapper.cpp \
+ Gateway_EC.cpp
+
+noinst_HEADERS = \
+ ECMcastTests_export.h \
+ EC_Wrapper.h \
+ Gateway_EC.h
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/Complex.mpc b/TAO/orbsvcs/tests/Event/Mcast/Complex/Complex.mpc
new file mode 100644
index 00000000000..ee053554cb1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/Complex.mpc
@@ -0,0 +1,53 @@
+// -*- MPC -*-
+// $Id$
+
+project(*supplier): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = supplier
+
+ Source_Files {
+ supplier.cpp
+ }
+}
+
+project(*consumer): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = consumer
+
+ Source_Files {
+ consumer.cpp
+ }
+}
+
+project(*gateway-ec): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = gateway-ec
+
+ Source_Files {
+ gateway-ec.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/Constants.h b/TAO/orbsvcs/tests/Event/Mcast/Complex/Constants.h
new file mode 100644
index 00000000000..bc1faae8c3b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/Constants.h
@@ -0,0 +1,9 @@
+// $Id$
+
+#include "orbsvcs/Event_Service_Constants.h"
+
+#define A_EVENT_TYPE ACE_ES_EVENT_UNDEFINED+1
+#define B_EVENT_TYPE A_EVENT_TYPE+1
+#define C_EVENT_TYPE B_EVENT_TYPE+1
+
+#define SOURCE_ID ACE_ES_EVENT_SOURCE_ANY+1
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/Makefile.am b/TAO/orbsvcs/tests/Event/Mcast/Complex/Makefile.am
new file mode 100644
index 00000000000..1b52b4fb3bd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/Makefile.am
@@ -0,0 +1,141 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Complex_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += consumer
+
+consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+consumer_SOURCES = \
+ consumer.cpp \
+ Constants.h
+
+consumer_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Complex_Gateway_Ec.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += gateway-ec
+
+gateway_ec_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+gateway_ec_SOURCES = \
+ gateway-ec.cpp \
+ Constants.h
+
+gateway_ec_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Complex_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += supplier
+
+supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+supplier_SOURCES = \
+ supplier.cpp \
+ Constants.h
+
+supplier_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/README b/TAO/orbsvcs/tests/Event/Mcast/Complex/README
new file mode 100644
index 00000000000..e0000644dc7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/README
@@ -0,0 +1,55 @@
+// $Id$
+
+Goals:
+------
+This is a step up from the Simple mcast test. There are still two
+Event Channels participating: one sends out its events via multicast,
+while the second one listens for events on multicast.
+
+But this test uses ECG_Mcast_Gateway configured with Complex
+Address Server and Complex Mcast Handler components. In other words,
+different types of events are sent to different multicast addresses,
+requiring an interested Event Channel to subscribe to all groups carrying
+events of interest to its consumers.
+
+Description:
+------------
+There are three executables: event supplier, event consumer,
+and federation-enabled Event Channel, of which we run two instances -
+one for supplier and one for consumer. Federated Channels are
+configured to use a different mcast group for each event type.
+Supplier pushes 100 events of each of the three event types to its
+Event Channel while the consumer waits for events from its EC. Once
+the consumer receives 100 events of each of the three types it
+expects, it destroys its EC and exits.
+
+Command-line Options:
+---------------------
+Consumer: $consumer -ORBInitRef Event_Service=<ior>
+
+Supplier: $supplier -ORBInitRef Event_Service=<ior>
+
+Mcast-equipped EC: $gateway_ec -ORBsvcconf <conf_file> -i <ior_file>
+where
+<ior_file> is the name of the file to which the ior of the Event
+ Channel will be printed
+<conf_file> is a service conf file used to configure the Event Channel
+ and the multicast components. See consumer-ec.conf or
+ supplier-ec.conf for examples, or
+ $TAO_ROOT/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h for
+ all valid multicast configuration options.
+
+To run:
+-------
+Automagically (runs all executables, processes output):
+$ run_test.pl
+
+Manually:
+$gateway-ec -ORBsvcconf consumer-ec.conf -i consumer-ec.ior
+$consumer -ORBInitRef Event_Service=file://consumer-ec.ior
+$gateway-ec -ORBsvcconf supplier-ec.conf -i supplier-ec.ior
+$supplier -ORBInitRef Event_Service=file://supplier-ec.ior
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer-ec.conf b/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer-ec.conf
new file mode 100644
index 00000000000..fefd2eec034
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer-ec.conf
@@ -0,0 +1,3 @@
+# $Id$
+static EC_Factory "-ECObserver basic -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
+static ECG_Mcast_Gateway "-ECGService receiver -ECGHandler complex -ECGAddressServer type -ECGAddressServerArg '17@230.100.0.7:12700 18@230.100.0.8:12700 19@230.100.0.9:12700'"
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp b/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp
new file mode 100644
index 00000000000..390b0a14f09
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/consumer.cpp
@@ -0,0 +1,229 @@
+// $Id$
+
+#include "Constants.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/RtecEventCommS.h"
+
+class EC_Consumer:
+ public POA_RtecEventComm::PushConsumer
+{
+public:
+
+ /// Constructor.
+ EC_Consumer (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec);
+
+ /// PushConsumer methods.
+ //@{
+ /// Logs each event. Initiates shutdown after receiving 100 events
+ /// of each type.
+ virtual void push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// No-op.
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// Helper - destroys EC, shutdowns the ORB and prints number of
+ /// events received.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Number of events of different types pushed to us by EC.
+ //@{
+ size_t a_events_;
+ size_t b_events_;
+ size_t c_events_;
+ //@}
+
+ /// Cache these pointers for cleanup.
+ CORBA::ORB_var orb_;
+ RtecEventChannelAdmin::EventChannel_var ec_;
+};
+
+EC_Consumer::EC_Consumer (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec)
+ : a_events_ (0),
+ b_events_ (0),
+ c_events_ (0),
+ orb_ (orb),
+ ec_ (ec)
+{
+}
+
+void
+EC_Consumer::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ for (CORBA::ULong i = 0; i < events.length (); ++i)
+ {
+ switch (events[i].header.type)
+ {
+ case A_EVENT_TYPE:
+ ++this->a_events_;
+ ACE_DEBUG ((LM_DEBUG, " Received event A\n"));
+ break;
+
+ case B_EVENT_TYPE:
+ ++this->b_events_;
+ ACE_DEBUG ((LM_DEBUG, " Received event B\n"));
+ break;
+
+ case C_EVENT_TYPE:
+ ++this->c_events_;
+ ACE_DEBUG ((LM_DEBUG, " Received event C\n"));
+ break;
+
+ default:
+ ACE_DEBUG ((LM_DEBUG, " Received event of UNKNOWN event type\n"));
+ }
+ }
+
+ if (this->a_events_ >= 100
+ && this->b_events_ >= 100
+ && this->c_events_ >= 100)
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+EC_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+EC_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->a_events_ == 100
+ && this->b_events_ == 100
+ && this->c_events_ == 100)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "SUCCESS:\n"
+ " Received 100 events of each type "
+ "(A, B, and C), as expected\n"));
+ }
+
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+////////////////////////////////////////////////////////////
+int
+check_for_nil (CORBA::Object_ptr obj, const char *message)
+{
+ if (CORBA::is_nil (obj))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Object reference <%s> is nil\n",
+ message),
+ -1);
+ else
+ return 0;
+}
+
+int
+parse_args (int /* argc */, char ** /* argv */)
+{
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB and POA, POA Manager, parse args.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) == -1)
+ return 1;
+
+ 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;
+ if (check_for_nil (poa.in (), "POA") == -1)
+ return 1;
+
+ PortableServer::POAManager_var manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain reference to EC.
+ obj = orb->resolve_initial_references ("Event_Service" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (check_for_nil (ec.in (), "EC") == -1)
+ return 1;
+
+ // Create the consumer and register it with POA.
+ TAO_EC_Servant_Var<EC_Consumer> consumer_impl =
+ new EC_Consumer (orb, ec);
+
+ if (!consumer_impl.in ())
+ return -1;
+
+ RtecEventComm::PushConsumer_var consumer;
+ TAO_EC_Object_Deactivator consumer_deactivator;
+ activate (consumer,
+ poa.in (),
+ consumer_impl.in (),
+ consumer_deactivator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer_deactivator.disallow_deactivation ();
+
+ // Obtain reference to ConsumerAdmin.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain ProxyPushSupplier and connect this consumer.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group (3);
+ qos.insert_type (A_EVENT_TYPE, 0);
+ qos.insert_type (B_EVENT_TYPE, 0);
+ qos.insert_type (C_EVENT_TYPE, 0);
+ supplier->connect_push_consumer (consumer.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Allow processing of CORBA requests.
+ manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Receive events from EC.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Consumer:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/gateway-ec.cpp b/TAO/orbsvcs/tests/Event/Mcast/Complex/gateway-ec.cpp
new file mode 100644
index 00000000000..7ab5ff9b030
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/gateway-ec.cpp
@@ -0,0 +1,13 @@
+// $Id$
+
+#include "Gateway_EC.h"
+
+int
+main (int argc, char ** argv)
+{
+ Gateway_EC test;
+ if (test.run (argc, argv) == -1)
+ return 1;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl b/TAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl
new file mode 100755
index 00000000000..cfd2aece892
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl
@@ -0,0 +1,215 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs Simple EC Mcast example. It starts
+# consumer, supplier and two (federated) Event Channel servers.
+# See README for more details.
+
+use lib '../../../../../../bin';
+use PerlACE::Run_Test;
+use POSIX;
+
+###############################################################
+# Configuration parameters
+###############################################################
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+
+# Variables for command-line arguments to client and server
+# executables.
+$consumer_iorfile = PerlACE::LocalFile ("consumer-ec.ior");
+$supplier_iorfile = PerlACE::LocalFile ("supplier-ec.ior");
+$consumer_conffile = PerlACE::LocalFile ("consumer-ec.conf");
+$supplier_conffile = PerlACE::LocalFile ("supplier-ec.conf");
+
+
+#################################################################
+# Subs
+#################################################################
+
+sub run_test
+{
+ # Supplier EC.
+ if (run_ec (0, $supplier_conffile, $supplier_iorfile) != 0) {
+ kill_processes (); return -1;
+ }
+
+ # Consumer EC.
+ if (run_ec (1, $consumer_conffile, $consumer_iorfile) != 0) {
+ kill_processes (); return -1;
+ }
+
+ # Consumer.
+ $ps[2] =
+ new PerlACE::Process ("consumer",
+ "-ORBInitRef Event_Service=file://$consumer_iorfile");
+ if ($ps[2]->Spawn () == -1) {
+ kill_processes (); return -1;
+ }
+
+ # Give consumer a chance to connect to its EC before firing off the supplier.
+ sleep ($sleeptime);
+
+ # Supplier.
+ $ps[3] =
+ new PerlACE::Process ("supplier",
+ "-ORBInitRef Event_Service=file://$supplier_iorfile");
+ if ($ps[3]->Spawn () == -1) {
+ kill_processes (); return -1;
+ }
+
+ # Shutdown.
+ return kill_processes ();
+}
+
+# Start Event Channel server.
+sub run_ec
+{
+ my $ec_id = $_[0];
+ my $conf_file = $_[1];
+ my $ior_file = $_[2];
+
+ unlink $ior_file;
+
+ $ps[$ec_id] = new PerlACE::Process ("gateway-ec",
+ "-ORBsvcconf $conf_file -i $ior_file");
+ if ($ps[$ec_id]->Spawn () == -1) {
+ return 1;
+ }
+
+ if (PerlACE::waitforfile_timed ($ior_file, $sleeptime) == -1)
+ {
+ print STDERR "ERROR: cannot find IOR file <$ior_file>\n";
+ $ps[$ec_id]->Kill ();
+ return 1;
+ }
+
+ return 0;
+}
+
+# Wait for and kill, if necessary, all started processes.
+sub kill_processes
+{
+ my $result = 0;
+
+ foreach $p (@ps)
+ {
+ if ($p->WaitKill (60) != 0) {
+ $result = -1;
+ }
+ }
+
+ if ($result == -1) {
+ print STDERR "ERROR detected\n";
+ return -1;
+ }
+
+ return 0;
+}
+
+sub restore_output
+{
+ # Restore output facilities.
+ close (STDERR);
+ close (STDOUT);
+ open (STDOUT, ">&OLDOUT");
+ open (STDERR, ">&OLDERR");
+}
+
+sub redirect_output
+{
+ my $rundate = POSIX::strftime("%Y_%m_%d_%H_%M", localtime);
+ $output_file = PerlACE::LocalFile ("run_test_$rundate");
+
+ open (OLDOUT, ">&STDOUT");
+ open (STDOUT, ">$output_file") or die "can't redirect stdout: $!";
+ open (OLDERR, ">&STDERR");
+ open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!";
+}
+
+sub analyze_results
+{
+ if (! open (TEST_OUTPUT, "<$output_file"))
+ {
+ print STDERR "ERROR: Could not open $output_file\n";
+ return -1;
+ }
+
+ my $status = 0;
+ my $a_events = 0;
+ my $b_events = 0;
+ my $c_events = 0;
+ while (<TEST_OUTPUT>)
+ {
+ if (m/Received event A/)
+ {
+ $a_events += 1;
+ }
+ elsif (m/Received event B/)
+ {
+ $b_events += 1;
+ }
+ elsif (m/Received event C/)
+ {
+ $c_events += 1;
+ }
+ elsif (m/Received 100 events/
+ || m/SUCCESS/)
+ {
+ #skip this line - we do our own counting.
+ }
+ else
+ {
+ print STDERR $_;
+ $status = -1;
+ }
+ }
+ close (TEST_OUTPUT);
+
+ my $all_received = 1;
+ if ($a_events != 100
+ || $b_events != 100
+ || $c_events != 100)
+ {
+ $all_received = 0;
+ print STDERR "ERROR: consumer received\n"
+ ."\t$a_events A events, expected 100\n"
+ ."\t$b_events B events, expected 100\n"
+ ."\t$c_events C events, expected 100\n";
+ }
+
+ if ($all_received && $status == 0) {
+ print STDERR "SUCCESS\n";
+ return 0;
+ }
+
+ print STDERR "ERROR - check $output_file for full output.\n";
+ return -1;
+}
+
+##############################################################
+# Run executables.
+##############################################################
+
+$status = 0;
+
+redirect_output ();
+
+if (run_test () == -1) {
+ $status = 1;
+}
+
+restore_output ();
+
+if (analyze_results () == -1) {
+ $status = 1;
+}
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/supplier-ec.conf b/TAO/orbsvcs/tests/Event/Mcast/Complex/supplier-ec.conf
new file mode 100644
index 00000000000..7135b8f4957
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/supplier-ec.conf
@@ -0,0 +1,3 @@
+# $Id$
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
+static ECG_Mcast_Gateway "-ECGService sender -ECGAddressServer type -ECGAddressServerArg '17@230.100.0.7:12700 18@230.100.0.8:12700 19@230.100.0.9:12700'"
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/supplier.cpp b/TAO/orbsvcs/tests/Event/Mcast/Complex/supplier.cpp
new file mode 100644
index 00000000000..ab13f1a28ef
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/supplier.cpp
@@ -0,0 +1,120 @@
+// $Id$
+
+#include "Constants.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/RtecEventCommC.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Log_Msg.h"
+
+void
+send_events (RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL)
+{
+ // Events we'll send.
+ RtecEventComm::EventSet events (1);
+ events.length (1);
+ // Events travelling through gateways must have a ttl count of at
+ // least 1!
+ events[0].header.ttl = 1;
+ events[0].header.source = SOURCE_ID;
+
+ for (int i = 0; i < 100; ++i)
+ {
+ // Send 1 event of each type.
+ events[0].header.type = A_EVENT_TYPE;
+ consumer->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ events[0].header.type = B_EVENT_TYPE;
+ consumer->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ events[0].header.type = C_EVENT_TYPE;
+ consumer->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+int
+check_for_nil (CORBA::Object_ptr obj, const char *message)
+{
+ if (CORBA::is_nil (obj))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Object reference <%s> is nil\n",
+ message),
+ -1);
+ else
+ return 0;
+}
+
+int
+parse_args (int /*argc*/, char ** /*argv*/)
+{
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize ORB and parse args.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) == -1)
+ return 1;
+
+ // Obtain reference to EC.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("Event_Service" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (check_for_nil (ec.in (), "EC") == -1)
+ return 1;
+
+ // Obtain reference to SupplierAdmin.
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain ProxyPushConsumer and connect this supplier.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (SOURCE_ID, A_EVENT_TYPE, 0, 1);
+ qos.insert (SOURCE_ID, B_EVENT_TYPE, 0, 1);
+ qos.insert (SOURCE_ID, C_EVENT_TYPE, 0, 1);
+
+ consumer->connect_push_supplier
+ (RtecEventComm::PushSupplier::_nil (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Send events to EC.
+ send_events (consumer.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell EC to shut down.
+ ec->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Supplier:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Makefile.am b/TAO/orbsvcs/tests/Event/Mcast/Makefile.am
new file mode 100644
index 00000000000..8633ab9fcef
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Makefile.am
@@ -0,0 +1,16 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ Common \
+ Complex \
+ Simple \
+ Two_Way
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumerMain.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumerMain.cpp
new file mode 100644
index 00000000000..077d4505c1a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumerMain.cpp
@@ -0,0 +1,109 @@
+// $Id$
+
+// 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 main (int argc, char* 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(), 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.
+ //supplier->disconnect_push_supplier();
+ //supplier = RtecEventChannelAdmin::ProxyPushSupplier::_nil();
+ //admin = RtecEventChannelAdmin::ConsumerAdmin::_nil();
+
+ orb->destroy();
+
+ return 0;
+
+ }
+ catch (CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp
new file mode 100644
index 00000000000..68515ac1a09
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.cpp
@@ -0,0 +1,54 @@
+// $Id$
+
+// 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, int event_limit)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , 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) {
+ 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/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.h b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.h
new file mode 100644
index 00000000000..f9f0f6168e5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventConsumer_i.h
@@ -0,0 +1,29 @@
+// $Id$
+
+// EchoEventConsumer_i.h
+// Implements a PushConsumer.
+
+#ifndef _EchoEventConsumer_i_h_
+#define _EchoEventConsumer_i_h_
+
+#include <orbsvcs/RtecEventCommS.h> // for POA_CosEventComm::PushConsumer
+
+class EchoEventConsumer_i : public virtual POA_RtecEventComm::PushConsumer
+{
+ public:
+ // Constructor
+ EchoEventConsumer_i(CORBA::ORB_ptr orb, 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_;
+ int event_limit_;
+};
+
+#endif // _EchoEventConsumer_i_h_
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp
new file mode 100644
index 00000000000..316493b3f4c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplierMain.cpp
@@ -0,0 +1,245 @@
+// $Id$
+
+// 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 main (int argc, char* 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 (CORBA::Exception& exc)
+ {
+ std::cerr << "Caught CORBA::Exception" << std::endl << exc << std::endl;
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.cpp
new file mode 100644
index 00000000000..be8c74dbe2e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.cpp
@@ -0,0 +1,26 @@
+// $Id$
+
+// 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/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.h b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.h
new file mode 100644
index 00000000000..53f74aeea45
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/EchoEventSupplier_i.h
@@ -0,0 +1,24 @@
+// $Id$
+
+// 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/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/README b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/README
new file mode 100644
index 00000000000..548f8a03a48
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/README
@@ -0,0 +1,138 @@
+Real-Time Event Service
+
+
+File: TAO/orbsvcs/tests/Event/Mcast/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/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc
new file mode 100644
index 00000000000..6910d790a5d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/RTEC_MCast_Federated.mpc
@@ -0,0 +1,25 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Supplier): namingexe, rteventexe, rtevent_serv {
+ requires += exceptions
+ exename = EchoEventSupplier
+ includes += ../common
+
+ Source_Files {
+ EchoEventSupplierMain.cpp
+ EchoEventSupplier_i.cpp
+ SimpleAddressServer.cpp
+ }
+}
+
+project(*Consumer): namingexe, rteventexe, {
+ requires += exceptions
+ exename = EchoEventConsumer
+ includes += ../common
+
+ Source_Files {
+ EchoEventConsumerMain.cpp
+ EchoEventConsumer_i.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.cpp b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.cpp
new file mode 100644
index 00000000000..9007b31369a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.cpp
@@ -0,0 +1,18 @@
+// $Id$
+
+// SimpleAddressServer.cpp
+
+#include "SimpleAddressServer.h"
+#include <ace/INET_Addr.h>
+
+SimpleAddressServer::SimpleAddressServer (const ACE_INET_Addr& address) {
+ this->address_.ipaddr = address.get_ip_address ();
+ this->address_.port = address.get_port_number ();
+}
+
+void
+SimpleAddressServer::get_addr (const RtecEventComm::EventHeader&,
+ RtecUDPAdmin::UDP_Addr& address)
+ throw (CORBA::SystemException) {
+ address = this->address_;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.h b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.h
new file mode 100644
index 00000000000..5c2c92454c6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/SimpleAddressServer.h
@@ -0,0 +1,25 @@
+// $Id$
+
+// 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);
+
+private:
+ RtecUDPAdmin::UDP_Addr address_;
+};
+
+#endif
diff --git a/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl
new file mode 100755
index 00000000000..1a1135c596b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl
@@ -0,0 +1,142 @@
+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 lib "$ACE_ROOT/bin";
+use PerlACE::Run_Test;
+
+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";
+
+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:2809");
+$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, 10) == -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/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/supplier.conf b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/supplier.conf
new file mode 100644
index 00000000000..d9eeea24f43
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/supplier.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECobserver basic"
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/Constants.h b/TAO/orbsvcs/tests/Event/Mcast/Simple/Constants.h
new file mode 100644
index 00000000000..45bca620bf2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/Constants.h
@@ -0,0 +1,6 @@
+// $Id$
+
+#include "orbsvcs/Event_Service_Constants.h"
+
+#define EVENT_TYPE ACE_ES_EVENT_UNDEFINED+1
+#define SOURCE_ID ACE_ES_EVENT_SOURCE_ANY+1
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/Makefile.am b/TAO/orbsvcs/tests/Event/Mcast/Simple/Makefile.am
new file mode 100644
index 00000000000..617b25f0ec2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/Makefile.am
@@ -0,0 +1,141 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Simple_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += consumer
+
+consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+consumer_SOURCES = \
+ consumer.cpp \
+ Constants.h
+
+consumer_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Simple_Gateway_Ec.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += gateway-ec
+
+gateway_ec_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+gateway_ec_SOURCES = \
+ gateway-ec.cpp \
+ Constants.h
+
+gateway_ec_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Simple_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += supplier
+
+supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+supplier_SOURCES = \
+ supplier.cpp \
+ Constants.h
+
+supplier_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/README b/TAO/orbsvcs/tests/Event/Mcast/Simple/README
new file mode 100644
index 00000000000..14c87028fb3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/README
@@ -0,0 +1,62 @@
+// $Id$
+
+Goals:
+------
+This is the most basic test for federating Event Channels via
+multicast or udp. Two Event Channels participate: one sends out its events
+via multicast (or udp), while the second one listens for events on
+multicast (or udp).
+
+This test can be run with two different configurations: multicast is used
+for federating event channels in one and udp is used in another. The
+test uses ECG_Mcast_Gateway configured with Simple Address Server and
+Simple Mcast Handler or UDP Handler components.
+
+Description:
+------------
+There are three executables: event supplier, event consumer,
+and federation-enabled Event Channel, of which we run two instances -
+one for supplier and one for consumer.
+Supplier pushes 100 events to its Event Channel while the consumer
+waits for events from its EC. Once the consumer receives 100 events
+it expects, it destroys its EC and exits.
+
+Command-line Options:
+---------------------
+Consumer: $consumer -ORBInitRef Event_Service=<ior>
+
+Supplier: $supplier -ORBInitRef Event_Service=<ior>
+
+Mcast-equipped EC: $gateway_ec -ORBsvcconf <conf_file> -i <ior_file>
+where
+<ior_file> is the name of the file to which the ior of the Event
+ Channel will be printed
+<conf_file> is a service conf file used to configure the Event Channel
+ and the multicast components. See consumer-ec.conf or
+ supplier-ec.conf for examples, or
+ $TAO_ROOT/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h for
+ all valid multicast configuration options.
+
+To run:
+-------
+Automagically (runs all executables, processes output):
+$ run_test.pl
+
+Manually:
+
+ Multicast Federation test
+
+$gateway-ec -ORBsvcconf consumer-ec.conf -i consumer-ec.ior
+$consumer -ORBInitRef Event_Service=file://consumer-ec.ior
+$gateway-ec -ORBsvcconf supplier-ec.conf -i supplier-ec.ior
+$supplier -ORBInitRef Event_Service=file://supplier-ec.ior
+
+ UDP Federation test
+
+$gateway-ec -ORBsvcconf udp-consumer-ec.conf -i consumer-ec.ior
+$consumer -ORBInitRef Event_Service=file://consumer-ec.ior
+$gateway-ec -ORBsvcconf udp-supplier-ec.conf -i supplier-ec.ior
+$supplier -ORBInitRef Event_Service=file://supplier-ec.ior
+
+
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/Simple.mpc b/TAO/orbsvcs/tests/Event/Mcast/Simple/Simple.mpc
new file mode 100644
index 00000000000..ee053554cb1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/Simple.mpc
@@ -0,0 +1,53 @@
+// -*- MPC -*-
+// $Id$
+
+project(*supplier): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = supplier
+
+ Source_Files {
+ supplier.cpp
+ }
+}
+
+project(*consumer): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = consumer
+
+ Source_Files {
+ consumer.cpp
+ }
+}
+
+project(*gateway-ec): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = gateway-ec
+
+ Source_Files {
+ gateway-ec.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer-ec.conf b/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer-ec.conf
new file mode 100644
index 00000000000..838d1461384
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer-ec.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
+static ECG_Mcast_Gateway "-ECGService receiver -ECGAddressServerArg 230.100.1.7:26700"
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp b/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp
new file mode 100644
index 00000000000..7b95c67318f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/consumer.cpp
@@ -0,0 +1,195 @@
+// $Id$
+
+#include "Constants.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/RtecEventCommS.h"
+
+class EC_Consumer:
+ public POA_RtecEventComm::PushConsumer
+{
+public:
+
+ /// Constructor.
+ EC_Consumer (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec);
+
+ /// PushConsumer methods.
+ //@{
+ /// Logs each event. Initiates shutdown after receiving 100 events.
+ virtual void push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ /// No-op.
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+
+ /// Helper - destroys EC, shutdowns the ORB and prints number of
+ /// events received.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Number of events pushed to us by EC.
+ size_t n_events_;
+
+ /// Cache these pointers for cleanup.
+ CORBA::ORB_var orb_;
+ RtecEventChannelAdmin::EventChannel_var ec_;
+};
+
+EC_Consumer::EC_Consumer (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec)
+ : n_events_ (0),
+ orb_ (orb),
+ ec_ (ec)
+{
+}
+
+void
+EC_Consumer::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ for (CORBA::ULong i = 0; i < events.length (); ++i)
+ {
+ ++this->n_events_;
+ ACE_DEBUG ((LM_DEBUG, " Received event\n"));
+ }
+
+ if (this->n_events_ >= 100)
+ this->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+EC_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+EC_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->n_events_ == 100)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "SUCCESS: consumer received 100 events, as expected\n"));
+ }
+
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+////////////////////////////////////////////////////////////
+int
+check_for_nil (CORBA::Object_ptr obj, const char *message)
+{
+ if (CORBA::is_nil (obj))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Object reference <%s> is nil\n",
+ message),
+ -1);
+ else
+ return 0;
+}
+
+int
+parse_args (int /* argc */, char ** /* argv */)
+{
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB and POA, POA Manager, parse args.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) == -1)
+ return 1;
+
+ 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;
+ if (check_for_nil (poa.in (), "POA") == -1)
+ return 1;
+
+ PortableServer::POAManager_var manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain reference to EC.
+ obj = orb->resolve_initial_references ("Event_Service" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (check_for_nil (ec.in (), "EC") == -1)
+ return 1;
+
+ // Create the consumer and register it with POA.
+ TAO_EC_Servant_Var<EC_Consumer> consumer_impl =
+ new EC_Consumer (orb, ec);
+
+ if (!consumer_impl.in ())
+ return 1;
+
+ RtecEventComm::PushConsumer_var consumer;
+ TAO_EC_Object_Deactivator consumer_deactivator;
+ activate (consumer,
+ poa.in (),
+ consumer_impl.in (),
+ consumer_deactivator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ consumer_deactivator.disallow_deactivation ();
+
+ // Obtain reference to ConsumerAdmin.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain ProxyPushSupplier and connect this consumer.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group (1);
+ qos.insert_type (ACE_ES_EVENT_ANY, 0);
+ supplier->connect_push_consumer (consumer.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Allow processing of CORBA requests.
+ manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Receive events from EC.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Consumer:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/gateway-ec.cpp b/TAO/orbsvcs/tests/Event/Mcast/Simple/gateway-ec.cpp
new file mode 100644
index 00000000000..462f226b0aa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/gateway-ec.cpp
@@ -0,0 +1,15 @@
+// $Id$
+
+#include "Gateway_EC.h"
+
+int
+main (int argc, char ** argv)
+{
+ Gateway_EC test;
+
+ if (test.run (argc, argv) == -1)
+ return 1;
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/run_test.pl b/TAO/orbsvcs/tests/Event/Mcast/Simple/run_test.pl
new file mode 100755
index 00000000000..0bad2bd3a1f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/run_test.pl
@@ -0,0 +1,235 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs Simple EC Mcast example. It starts
+# consumer, supplier and two (federated) Event Channel servers.
+# See README for more details.
+
+use lib '../../../../../../bin';
+use PerlACE::Run_Test;
+
+###############################################################
+# Configuration parameters
+###############################################################
+
+# String indicating end of test output.
+$test_terminator = "###########################################";
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+
+# Variables for command-line arguments to client and server
+# executables.
+$consumer_iorfile = PerlACE::LocalFile ("consumer-ec.ior");
+$supplier_iorfile = PerlACE::LocalFile ("supplier-ec.ior");
+
+@consumer_conffile = (PerlACE::LocalFile ("consumer-ec.conf")
+ , PerlACE::LocalFile ("udp-consumer-ec.conf"));
+
+@supplier_conffile = (PerlACE::LocalFile ("supplier-ec.conf")
+ , PerlACE::LocalFile ("udp-supplier-ec.conf"));
+
+@test_comments =
+ ("Test 1: Mcast Handler",
+ "Test 2: UDP Handler");
+
+#################################################################
+# Subs
+#################################################################
+
+sub run_test
+{
+ my $index = shift;
+
+ print STDERR " $test_comments[$index]\n\n";
+
+ # Supplier EC.
+ if (run_ec (0, $supplier_conffile[$index], $supplier_iorfile) != 0) {
+ kill_processes (); return -1;
+ }
+
+ # Consumer EC.
+ if (run_ec (1, $consumer_conffile[$index], $consumer_iorfile) != 0) {
+ kill_processes (); return -1;
+ }
+
+ # Consumer.
+ $ps[2] =
+ new PerlACE::Process ("consumer",
+ "-ORBInitRef Event_Service=file://$consumer_iorfile");
+ if ($ps[2]->Spawn () == -1) {
+ kill_processes (); return -1;
+ }
+
+ # Give consumer a chance to connect to its EC before firing off the supplier.
+ sleep ($sleeptime);
+
+ # Supplier.
+ $ps[3] =
+ new PerlACE::Process ("supplier",
+ "-ORBInitRef Event_Service=file://$supplier_iorfile");
+ if ($ps[3]->Spawn () == -1) {
+ kill_processes (); return -1;
+ }
+
+ # Shutdown.
+ return kill_processes ();
+}
+
+# Start Event Channel server.
+sub run_ec
+{
+ my $ec_id = $_[0];
+ my $conf_file = $_[1];
+ my $ior_file = $_[2];
+
+ unlink $ior_file;
+
+ $ps[$ec_id] = new PerlACE::Process ("gateway-ec",
+ "-ORBsvcconf $conf_file -i $ior_file");
+ if ($ps[$ec_id]->Spawn () == -1) {
+ return 1;
+ }
+
+ if (PerlACE::waitforfile_timed ($ior_file, $sleeptime) == -1)
+ {
+ print STDERR "ERROR: cannot find IOR file <$ior_file>\n";
+ $ps[$ec_id]->Kill ();
+ return 1;
+ }
+
+ return 0;
+}
+
+# Wait for and kill, if necessary, all started processes.
+sub kill_processes
+{
+ my $result = 0;
+
+ foreach $p (@ps)
+ {
+ if ($p->WaitKill (60) != 0) {
+ $result = -1;
+ }
+ }
+
+ if ($result == -1) {
+ print STDERR "ERROR detected\n";
+ return -1;
+ }
+
+ return 0;
+}
+
+sub redirect_output
+{
+ my $rundate = POSIX::strftime("%Y_%m_%d_%H_%M", localtime);
+ $output_file = PerlACE::LocalFile ("run_test_$rundate");
+
+ open (OLDOUT, ">&STDOUT");
+ open (STDOUT, ">$output_file") or die "can't redirect stdout: $!";
+ open (OLDERR, ">&STDERR");
+ open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!";
+}
+
+sub restore_output
+{
+ # Restore output facilities.
+ close (STDERR);
+ close (STDOUT);
+ open (STDOUT, ">&OLDOUT");
+ open (STDERR, ">&OLDERR");
+}
+
+sub analyze_results
+{
+ my $test_number = shift;
+ print STDERR " $test_comments[$test_number]\n\n";
+
+ if (! open (TEST_OUTPUT, "<$output_file"))
+ {
+ print STDERR "ERROR: Could not open $output_file\n";
+ return -1;
+ }
+
+ my $output_start = $test_comments[$test_number];
+ while (<TEST_OUTPUT>)
+ {
+ # Skip output not pertinent to this test.
+ last if m/\Q$output_start\E/;
+ }
+
+ my $status = 0;
+ my $events_received = 0;
+ while (<TEST_OUTPUT>)
+ {
+ last if m/$test_terminator/;
+
+ if (m/Received event/)
+ {
+ $events_received += 1;
+ }
+ elsif (m/consumer received 100 events/
+ || m/^\s+$/)
+ {
+ #skip this line - we do our own counting.
+ }
+ else
+ {
+ $status = -1;
+ print STDERR $_;
+ }
+ }
+ close (TEST_OUTPUT);
+
+ if ($events_received != 100)
+ {
+ print STDERR "ERROR: "
+ ."consumer received $events_received events, expected 100\n";
+ }
+
+ if ($events_received == 100 && $status == 0) {
+ print STDERR "SUCCESS\n";
+ return 0;
+ }
+
+ print STDERR "ERROR - check $output_file for full output.\n";
+ return -1;
+}
+
+##############################################################
+# Run executables.
+##############################################################
+
+$status = 0;
+
+redirect_output ();
+
+for ($i = 0; $i < 2; $i++)
+{
+ if (run_test ($i) == -1) {
+ $status = 1;
+ }
+
+ print STDERR "$test_terminator\n\n";
+}
+
+restore_output ();
+
+for ($i = 0; $i < 2; $i++)
+{
+ if (analyze_results ($i) == -1) {
+ $status = 1;
+ }
+
+ print STDERR "\n";
+}
+
+exit $status;
+
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/supplier-ec.conf b/TAO/orbsvcs/tests/Event/Mcast/Simple/supplier-ec.conf
new file mode 100644
index 00000000000..7fe85696513
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/supplier-ec.conf
@@ -0,0 +1,32 @@
+# $Id$
+
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
+static ECG_Mcast_Gateway "-ECGService sender -ECGAddressServerArg 230.100.1.7:26700"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/supplier.cpp b/TAO/orbsvcs/tests/Event/Mcast/Simple/supplier.cpp
new file mode 100644
index 00000000000..d7d0b4f1973
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/supplier.cpp
@@ -0,0 +1,107 @@
+// $Id$
+
+#include "Constants.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/RtecEventCommC.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Log_Msg.h"
+
+void
+send_events (RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::EventSet events (1);
+ events.length (1);
+ // Events travelling through gateways must have a ttl count of at
+ // least 1!
+ events[0].header.ttl = 1;
+ events[0].header.type = EVENT_TYPE;
+ events[0].header.source = SOURCE_ID;
+
+ for (int i = 0; i < 100; ++i)
+ {
+ consumer->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+int
+check_for_nil (CORBA::Object_ptr obj, const char *message)
+{
+ if (CORBA::is_nil (obj))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Object reference <%s> is nil\n",
+ message),
+ -1);
+ else
+ return 0;
+}
+
+int
+parse_args (int /*argc*/, char ** /*argv*/)
+{
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB and parse args.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) == -1)
+ return 1;
+
+ // Obtain reference to EC.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("Event_Service" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (check_for_nil (ec.in (), "EC") == -1)
+ return 1;
+
+ // Obtain reference to SupplierAdmin.
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain ProxyPushConsumer and connect this supplier.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (SOURCE_ID, EVENT_TYPE, 0, 1);
+
+ consumer->connect_push_supplier
+ (RtecEventComm::PushSupplier::_nil (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Send 100 events to EC.
+ send_events (consumer.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell EC to shut down.
+ ec->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Supplier:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/udp-consumer-ec.conf b/TAO/orbsvcs/tests/Event/Mcast/Simple/udp-consumer-ec.conf
new file mode 100644
index 00000000000..334731adc75
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/udp-consumer-ec.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
+static ECG_Mcast_Gateway "-ECGService receiver -ECGHandler udp -ECGAddressServerArg 127.0.0.1:27500"
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Simple/udp-supplier-ec.conf b/TAO/orbsvcs/tests/Event/Mcast/Simple/udp-supplier-ec.conf
new file mode 100644
index 00000000000..084dd36bf67
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Simple/udp-supplier-ec.conf
@@ -0,0 +1,32 @@
+# $Id$
+
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
+static ECG_Mcast_Gateway "-ECGService sender -ECGAddressServerArg 127.0.0.1:27500"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Constants.h b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Constants.h
new file mode 100644
index 00000000000..6a6919f964d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Constants.h
@@ -0,0 +1,7 @@
+// $Id$
+
+#include "orbsvcs/Event_Service_Constants.h"
+
+#define HEARTBEAT ACE_ES_EVENT_UNDEFINED+1
+#define SOURCE_ID ACE_ES_EVENT_SOURCE_ANY+1
+#define HEARTBEATS_TO_SEND 50
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Makefile.am b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Makefile.am
new file mode 100644
index 00000000000..9ad215d370a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Makefile.am
@@ -0,0 +1,102 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Two_Way_Application.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += application
+
+application_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+application_SOURCES = \
+ application.cpp \
+ Constants.h
+
+application_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Two_Way_Gateway_Ec.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += gateway-ec
+
+gateway_ec_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../Common
+
+gateway_ec_SOURCES = \
+ gateway-ec.cpp \
+ Constants.h
+
+gateway_ec_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/Mcast/Common/libECMcastTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/README b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/README
new file mode 100644
index 00000000000..33f62b9c323
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/README
@@ -0,0 +1,57 @@
+// $Id$
+
+Goals:
+------
+The goal of this test is to verify that federation of Event Channels
+using multicast works correctly. Unlike "Simple" and "Complex" tests,
+this test can have any number of Event Channels participating in the
+federation, and each participating Event Channel has a full duplex
+multicast communication, i.e., both sends and receives events via multicast.
+
+Description:
+------------
+There are two executables: federation-enabled Event Channel an
+application, which acts both as EC consumer and supplier. Any number
+of EC/application executable pairs can be started for running the test.
+
+Each application subscribes with its EC for heartbeat events, and,
+while listening, also pushes (at regular intervals) 50 heartbeat
+events to its EC. Each heartbeat event contains info identifying its
+source (hostname + process id). Applications keep track of all the heartbeat
+events they receive, and print out the summary before shutting down.
+
+Command-line Options:
+---------------------
+Application: $application -ORBInitRef Event_Service=<ior> [-d]
+where
+-d indicates that the application will destroy its Event Channel
+ before exiting. If each application has its own private Event
+ Channel, each should use this flag, to have all executables terminate
+ automatically. If more than one application is using the same
+ Event Channel, then only one of those applications should use "-d"
+ option.
+
+Mcast-equipped EC: $gateway_ec -ORBsvcconf <conf_file> -i <ior_file>
+where
+<ior_file> is the name of the file to which the ior of the Event
+ Channel will be printed
+<conf_file> is a service conf file used to configure the Event Channel
+ and the multicast components. See consumer-ec.conf or
+ supplier-ec.conf for examples, or
+ $TAO_ROOT/orbsvcs/orbsvcs/Event/ECG_Mcast_Gateway.h for
+ all valid multicast configuration options.
+
+To run:
+-------
+Automagically (runs three EC/application pairs):
+$ run_test.pl
+
+Manually:
+As many times as desired (using a different ior file name each time) do
+$gateway-ec -ORBsvcconf gateway.conf -i ec.ior
+$application -ORBInitRef Event_Service=file://ec.ior -d
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Two_Way.mpc b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Two_Way.mpc
new file mode 100644
index 00000000000..48da30505d0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/Two_Way.mpc
@@ -0,0 +1,36 @@
+// -*- MPC -*-
+// $Id$
+
+project(*application): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = application
+
+ Source_Files {
+ application.cpp
+ }
+}
+
+project(*gateway-ec): messaging, rteventexe, rtevent_serv, naming {
+ after += ECMcastTests_lib
+ libs += ECMcastTests
+
+ specific (automake) {
+ includes += $(srcdir)/../Common
+ } else {
+ includes += ../Common
+ }
+
+ exename = gateway-ec
+
+ Source_Files {
+ gateway-ec.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp
new file mode 100644
index 00000000000..ce7c85cdd95
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/application.cpp
@@ -0,0 +1,666 @@
+// $Id$
+
+#include "Constants.h"
+
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Lifetime_Utils_T.h"
+#include "orbsvcs/Event/ECG_UDP_Sender.h"
+#include "orbsvcs/Event/ECG_UDP_Receiver.h"
+
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "orbsvcs/RtecEventCommS.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Array_Base.h"
+#include "ace/Get_Opt.h"
+#include "ace/Reactor.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/os_include/os_netdb.h"
+
+// Indicates whether this application is responsible for destroying
+// the Event Channel it's using upon exit.
+int destroy_ec_flag = 0;
+
+/**
+ * @class Heartbeat_Application
+ *
+ * @brief A simple application for testing federation of Event
+ * Channels via multicast.
+ *
+ * NOTE: Contains platform-specific code (event data), i.e.,
+ * might not work cross-platform.
+ *
+ * This class acts both as a receiver and a supplier of HEARTBEAT events
+ * to a multicast-federated Event Channel. After sending a prespecified
+ * number of heartbeat events, it prints out a summary about received
+ * heartbeats and shuts down.
+ */
+class Heartbeat_Application :
+ public POA_RtecEventComm::PushConsumer,
+ public TAO_EC_Deactivated_Object
+{
+public:
+
+ /// Constructor.
+ Heartbeat_Application (void);
+
+ /// Destructor.
+ ~Heartbeat_Application (void);
+
+ // Initializes the object: connects with EC as a supplier and a
+ // consumer and registers with reactor for timeouts. If init ()
+ // completes successfully, shutdown () must be called when this
+ // object is no longer needed, for proper resource cleanup. (This
+ // is normally done by handle_timeout() method, but if handle_timeout()
+ // will not have a chance to execute, it is the responsibility of
+ // the user.)
+ void init (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec
+ ACE_ENV_ARG_DECL);
+
+ // No-op if the object hasn't been fully initialized. Otherwise,
+ // deregister from reactor and poa, destroy ec or just disconnect from it
+ // (based on <destroy_ec> flag), and shut down the orb.
+ void shutdown (void);
+
+ /// Send another heartbeat or, if we already sent/attempted the required
+ /// number of heartbeats, perform shutdown().
+ int handle_timeout (const ACE_Time_Value& tv,
+ const void* act);
+
+ /// PushConsumer methods.
+ //@{
+ /// Update our <heartbeats_> database to reflect newly received heartbeats.
+ virtual void push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException));
+
+ /// Initiate shutdown().
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC((CORBA::SystemException));
+ //@}
+
+private:
+
+ /**
+ * @class Timeout_Handler
+ *
+ * @brief Helper class for receiving timeouts from Reactor.
+ */
+ class Timeout_Handler : public ACE_Event_Handler
+ {
+ public:
+ /// Constructor.
+ Timeout_Handler (Heartbeat_Application *recv);
+ /// Reactor callback.
+ virtual int handle_timeout (const ACE_Time_Value& tv,
+ const void* act);
+ private:
+ /// We callback to this object when a message arrives.
+ Heartbeat_Application* receiver_;
+ };
+
+ /// Helpers.
+ //@{
+ /// Verify that arguments are not nil and store their values.
+ int check_args (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec);
+ /// Connects to EC as a supplier.
+ void connect_as_supplier (ACE_ENV_SINGLE_ARG_DECL);
+ /// Connects to EC as a consumer. Activate with default POA.
+ void connect_as_consumer (ACE_ENV_SINGLE_ARG_DECL);
+ /// Call destroy() on the EC. Does not propagate exceptions.
+ void destroy_ec (void);
+ /// Registers with orb's reactor for timeouts ocurring every 0.5
+ /// seconds. Returns 0 on success, -1 on error.
+ int register_for_timeouts (void);
+ /// Deregister from reactor.
+ void stop_timeouts (void);
+ //@}
+
+ /// Flag indicating whether this object has been fully initialized.
+ int initialized_;
+
+ /// Helper object for receiving timeouts from Reactor.
+ Timeout_Handler timeout_handler_;
+
+ /// Number of heartbeats we sent so far.
+ size_t n_timeouts_;
+
+ /// Info we keep on each HEARTBEAT source.
+ typedef struct {
+ pid_t pid;
+ char hostname [MAXHOSTNAMELEN];
+ int total;
+ } HEARTBEAT_SOURCE_ENTRY;
+
+ /// Stores info on all heartbeats we received so far.
+ ACE_Array_Base<HEARTBEAT_SOURCE_ENTRY> heartbeats_;
+
+ /// Our identity: pid followed by hostname. We include this info into each
+ /// heartbeat we send.
+ char hostname_and_pid_ [MAXHOSTNAMELEN+11];
+
+ /// ORB and EC pointers - to allow cleanup down the road.
+ CORBA::ORB_var orb_;
+ RtecEventChannelAdmin::EventChannel_var ec_;
+
+ /// Consumer proxy which represents us in EC as a supplier.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_;
+
+ typedef TAO_EC_Auto_Command<TAO_ECG_UDP_Sender_Disconnect_Command>
+ Supplier_Proxy_Disconnect;
+ typedef TAO_EC_Auto_Command<TAO_ECG_UDP_Receiver_Disconnect_Command>
+ Consumer_Proxy_Disconnect;
+
+ /// Manages our connection to Supplier Proxy.
+ Supplier_Proxy_Disconnect supplier_proxy_disconnect_;
+ /// Manages our connection to Consumer Proxy.
+ Consumer_Proxy_Disconnect consumer_proxy_disconnect_;
+};
+// **************************************************************************
+
+Heartbeat_Application::Timeout_Handler::
+Timeout_Handler (Heartbeat_Application* r)
+ : receiver_ (r)
+{
+}
+
+int
+Heartbeat_Application::Timeout_Handler::
+handle_timeout (const ACE_Time_Value& tv,
+ const void* act)
+{
+ return this->receiver_->handle_timeout (tv, act);
+}
+
+// **************************************************************************
+
+Heartbeat_Application::Heartbeat_Application (void)
+ : initialized_ (0)
+ , timeout_handler_ (this)
+ , n_timeouts_ (0)
+ , orb_ ()
+ , ec_ ()
+ , consumer_ ()
+ , supplier_proxy_disconnect_ ()
+ , consumer_proxy_disconnect_ ()
+{
+}
+
+Heartbeat_Application::~Heartbeat_Application (void)
+{
+}
+
+int
+Heartbeat_Application::check_args (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec)
+{
+ if (CORBA::is_nil (ec.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%N (%l): Nil ec argument to "
+ "Heartbeat_Application::init\n"),
+ -1);
+ }
+
+ if (CORBA::is_nil (orb.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%N (%l): Nil orb argument to "
+ "Heartbeat_Application::init\n"),
+ -1);
+ }
+
+ this->ec_ = ec;
+ this->orb_ = orb;
+
+ return 0;
+}
+
+void
+Heartbeat_Application::init (CORBA::ORB_var orb,
+ RtecEventChannelAdmin::EventChannel_var ec
+ ACE_ENV_ARG_DECL)
+{
+ // Verify arguments.
+ if (this->check_args (orb, ec) == -1)
+ {
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Get hostname & process id, i.e., identity of this application.
+ pid_t pid = ACE_OS::getpid ();
+ ACE_OS::memcpy (this->hostname_and_pid_,
+ &pid,
+ sizeof (pid));
+
+ if (gethostname (this->hostname_and_pid_ + sizeof (pid),
+ MAXHOSTNAMELEN)
+ != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Heartbeat_Application::init - "
+ "cannot get hostname\n"));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // Connect to EC as a supplier.
+ this->connect_as_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Connect to EC as a consumer.
+ ACE_TRY
+ {
+ this->connect_as_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ this->consumer_proxy_disconnect_.execute ();
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ // Register for reactor timeouts.
+ if (this->register_for_timeouts () == -1)
+ {
+ this->consumer_proxy_disconnect_.execute ();
+ this->supplier_proxy_disconnect_.execute ();
+ this->deactivator_.deactivate ();
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ this->initialized_ = 1;
+}
+
+int
+Heartbeat_Application::register_for_timeouts (void)
+{
+ // Schedule timeout every 0.5 seconds, for sending heartbeat events.
+ ACE_Time_Value timeout_interval (0, 500000);
+ ACE_Reactor *reactor = this->orb_->orb_core ()->reactor ();
+ if (!reactor
+ || reactor->schedule_timer (&this->timeout_handler_, 0,
+ timeout_interval,
+ timeout_interval) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Heartbeat_Application::register_for_timeouts - "
+ "cannot schedule timer\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+void
+Heartbeat_Application::stop_timeouts (void)
+{
+ ACE_Reactor *reactor = this->orb_->orb_core ()->reactor ();
+ if (!reactor
+ || reactor->cancel_timer (&this->timeout_handler_) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Heartbeat_Application::stop_timeouts - "
+ "cannot deregister from reactor.\n"));
+ }
+}
+
+void
+Heartbeat_Application::connect_as_supplier (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Obtain reference to SupplierAdmin.
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->ec_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain ProxyPushConsumer and connect this supplier.
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ Consumer_Proxy_Disconnect new_proxy_disconnect (proxy.in ());
+
+ ACE_SupplierQOS_Factory qos;
+ qos.insert (SOURCE_ID, HEARTBEAT, 0, 1);
+
+ proxy->connect_push_supplier (RtecEventComm::PushSupplier::_nil (),
+ qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update resource managers.
+ this->consumer_ = proxy._retn ();
+ this->consumer_proxy_disconnect_.set_command (new_proxy_disconnect);
+}
+
+void
+Heartbeat_Application::connect_as_consumer (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Activate with poa.
+ RtecEventComm::PushConsumer_var consumer_ref;
+ PortableServer::POA_var poa = this->_default_POA ();
+
+ TAO_EC_Object_Deactivator deactivator;
+ activate (consumer_ref,
+ poa.in (),
+ this,
+ deactivator
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain reference to ConsumerAdmin.
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->ec_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain ProxyPushSupplier..
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ Supplier_Proxy_Disconnect new_proxy_disconnect (proxy.in ());
+
+ // Connect this consumer.
+ ACE_ConsumerQOS_Factory qos;
+ qos.start_disjunction_group (1);
+ qos.insert_type (ACE_ES_EVENT_ANY, 0);
+ proxy->connect_push_consumer (consumer_ref.in (),
+ qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Update resource managers.
+ this->supplier_proxy_disconnect_.set_command (new_proxy_disconnect);
+ this->set_deactivator (deactivator);
+}
+
+int
+Heartbeat_Application::handle_timeout (const ACE_Time_Value&,
+ const void*)
+{
+ ACE_TRY_NEW_ENV
+ {
+ if (this->n_timeouts_++ < HEARTBEATS_TO_SEND)
+ {
+ RtecEventComm::EventSet events (1);
+ events.length (1);
+ // Events travelling through gateways must have a ttl count of at
+ // least 1!
+ events[0].header.ttl = 1;
+ events[0].header.type = HEARTBEAT;
+ events[0].header.source = SOURCE_ID;
+
+ // Store our hostname and process id in the data portion of
+ // the event.
+ events[0].data.payload.replace (MAXHOSTNAMELEN+11,
+ MAXHOSTNAMELEN+11,
+ (u_char *)this->hostname_and_pid_,
+ 0);
+
+ this->consumer_->push (events ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ // We already sent the required number of heartbeats. Time to
+ // shutdown this app.
+ {
+ this->shutdown ();
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Suppressed the following exception in "
+ "Heartbeat_Application::handle_timeout:\n");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+Heartbeat_Application::push (const RtecEventComm::EventSet &events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ for (CORBA::ULong i = 0; i < events.length (); ++i)
+ {
+ // Figure out heartbeat source.
+ const u_char * buffer = events[i].data.payload.get_buffer ();
+ pid_t pid = *((pid_t*) buffer);
+ char * host = (char*) buffer + sizeof (pid);
+
+ // Update heartbeat database.
+ int found = 0;
+ size_t size = this->heartbeats_.size ();
+ for (size_t j = 0; j < size; ++j)
+ {
+ if (this->heartbeats_[j].pid == pid
+ && ACE_OS::strcmp (this->heartbeats_[j].hostname, host)
+ == 0)
+ {
+ this->heartbeats_[j].total++;
+ found = 1;
+ break;
+ }
+ }
+ // Make new entry in the database.
+ if (!found)
+ {
+ if (this->heartbeats_.size (size + 1)
+ == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Unable to add new entry "
+ "to heartbeat database \n"));
+ break;
+ }
+
+ this->heartbeats_[size].pid = pid;
+ this->heartbeats_[size].total = 1;
+ ACE_OS::memcpy (this->heartbeats_[size].hostname,
+ host,
+ ACE_OS::strlen (host) + 1);
+ }
+ }
+}
+
+void
+Heartbeat_Application::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC((CORBA::SystemException))
+{
+ this->shutdown ();
+}
+
+void
+Heartbeat_Application::destroy_ec (void)
+{
+ if (!CORBA::is_nil (this->ec_.in ()))
+ {
+ ACE_TRY_NEW_ENV
+ {
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Suppressed the following exception in "
+ "Application_Heartbeat::destroy_ec\n");
+ }
+ ACE_ENDTRY;
+
+ this->ec_ = RtecEventChannelAdmin::EventChannel::_nil ();
+ }
+}
+void
+Heartbeat_Application::shutdown (void)
+{
+ if (!this->initialized_)
+ return;
+
+ this->initialized_ = 0;
+
+ // Deregister from Reactor.
+ this->stop_timeouts ();
+
+ // Disconnect from ECs as a consumer.
+ this->supplier_proxy_disconnect_.execute ();
+ // Disconnect from EC as a supplier.
+ this->consumer_proxy_disconnect_.execute ();
+
+ if (destroy_ec_flag)
+ {
+ this->destroy_ec ();
+ }
+
+ // Deregister from POA.
+ this->deactivator_.deactivate ();
+
+ // Print out heartbeats report.
+ pid_t pid = ACE_OS::getpid ();
+ char hostname[MAXHOSTNAMELEN + 1];
+ if (gethostname (hostname, MAXHOSTNAMELEN) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Heartbeat_Application::shutdown - "
+ "cannot get hostname\n"));
+ hostname[0] = '\0';
+ }
+ ACE_DEBUG ((LM_DEBUG,
+ "%d@%s Received following heartbeats:\n",
+ pid, hostname));
+ for (size_t i = 0; i < this->heartbeats_.size (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Host %s, pid %d - total of %u\n",
+ this->heartbeats_[i].hostname,
+ this->heartbeats_[i].pid,
+ this->heartbeats_[i].total));
+ }
+
+ // Shutdown the ORB.
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "The following exception occured in "
+ "Heartbeat_Application::shutdown:\n");
+ }
+ ACE_ENDTRY;
+}
+
+////////////////////////////////////////////////////////////
+int
+check_for_nil (CORBA::Object_ptr obj, const char *message)
+{
+ if (CORBA::is_nil (obj))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Object reference <%s> is nil\n",
+ message),
+ -1);
+ else
+ return 0;
+}
+
+int
+parse_args (int argc, char ** argv)
+{
+ ACE_Get_Opt get_opt (argc, argv, "d");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'd':
+ destroy_ec_flag = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-d"
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ // We may want this to be alive beyond the next block.
+ TAO_EC_Servant_Var<Heartbeat_Application> app;
+
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB and POA, POA Manager, parse args.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) == -1)
+ return 1;
+
+ 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;
+ if (check_for_nil (poa.in (), "POA") == -1)
+ return 1;
+
+ PortableServer::POAManager_var manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain reference to EC.
+ obj = orb->resolve_initial_references ("Event_Service" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (check_for_nil (ec.in (), "EC") == -1)
+ return 1;
+
+ // Init our application.
+ app = new Heartbeat_Application;
+ if (!app.in ())
+ return 1;
+
+ app->init (orb, ec ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Allow processing of CORBA requests.
+ manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Receive events from EC.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in Heartbeat Application:");
+ // Since there was an exception, application might not have had
+ // a chance to shutdown.
+ app->shutdown ();
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway-ec.cpp b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway-ec.cpp
new file mode 100644
index 00000000000..c048843d90b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway-ec.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+#include "Gateway_EC.h"
+
+int
+main (int argc, char ** argv)
+{
+ Gateway_EC test;
+
+ if (test.run (argc, argv) == -1)
+ return 1;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway.conf b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway.conf
new file mode 100644
index 00000000000..e87f9196f76
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/gateway.conf
@@ -0,0 +1,3 @@
+# $Id$
+static EC_Factory "-ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
+static ECG_Mcast_Gateway "-ECGService two_way -ECGAddressServerArg 230.100.1.7:26700"
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Two_Way/run_test.pl b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/run_test.pl
new file mode 100755
index 00000000000..ffbeb68a9d6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Mcast/Two_Way/run_test.pl
@@ -0,0 +1,205 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs Simple EC Mcast example. It starts
+# consumer, supplier and two (federated) Event Channel servers.
+# See README for more details.
+
+use lib '../../../../../../bin';
+use PerlACE::Run_Test;
+use POSIX;
+
+###############################################################
+# Configuration parameters
+###############################################################
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+# Number of Event Channel/Application pairs that will be started up.
+$number_of_applications = 3;
+
+# Variables for command-line arguments to client and server
+# executables.
+$iorfile_base = "ec.ior";
+$conffile = PerlACE::LocalFile ("gateway.conf");
+
+#################################################################
+# Subs
+#################################################################
+
+sub run_test
+{
+ # Start federated Event Channels.
+ for ($i = 0; $i < $number_of_applications; $i++)
+ {
+ if (run_ec ($i, $conffile, $iorfile_base.$i) != 0) {
+ kill_processes (); return -1;
+ }
+ }
+
+ # Start EC clients.
+ for ($i = 0; $i < $number_of_applications; $i++)
+ {
+ my $ps_index = $number_of_applications + $i;
+ my $args = "-d -ORBInitRef Event_Service=file://$iorfile_base$i";
+ $ps[$ps_index] =
+ new PerlACE::Process ("application", $args);
+ if ($ps[$ps_index]->Spawn () == -1) {
+ kill_processes (); return -1;
+ }
+ }
+
+ # Shutdown.
+ return kill_processes ();
+}
+
+# Start Event Channel server.
+sub run_ec
+{
+ my $ec_id = $_[0];
+ my $conf_file = $_[1];
+ my $ior_file = $_[2];
+
+ unlink $ior_file;
+
+ $ps[$ec_id] = new PerlACE::Process ("gateway-ec",
+ "-ORBsvcconf $conf_file -i $ior_file");
+ if ($ps[$ec_id]->Spawn () == -1) {
+ return 1;
+ }
+
+ if (PerlACE::waitforfile_timed ($ior_file, $sleeptime) == -1)
+ {
+ print STDERR "ERROR: cannot find IOR file <$ior_file>\n";
+ $ps[$ec_id]->Kill ();
+ return 1;
+ }
+
+ return 0;
+}
+
+# Wait for and kill, if necessary, all started processes.
+sub kill_processes
+{
+ my $result = 0;
+
+ foreach $p (@ps)
+ {
+ if ($p->WaitKill (60) != 0) {
+ $result = -1;
+ }
+ }
+
+ if ($result == -1) {
+ print STDERR "ERROR detected\n";
+ return -1;
+ }
+
+ return 0;
+}
+
+sub restore_output
+{
+ # Restore output facilities.
+ close (STDERR);
+ close (STDOUT);
+ open (STDOUT, ">&OLDOUT");
+ open (STDERR, ">&OLDERR");
+}
+
+sub redirect_output
+{
+ my $rundate = POSIX::strftime("%Y_%m_%d_%H_%M", localtime);
+ $output_file = PerlACE::LocalFile ("run_test_$rundate");
+
+ open (OLDOUT, ">&STDOUT");
+ open (STDOUT, ">$output_file") or die "can't redirect stdout: $!";
+ open (OLDERR, ">&STDERR");
+ open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!";
+}
+
+sub analyze_results
+{
+ if (! open (TEST_OUTPUT, "<$output_file"))
+ {
+ print STDERR "ERROR: Could not open $output_file\n";
+ return -1;
+ }
+
+ my $status = 0;
+ while (<TEST_OUTPUT>)
+ {
+ if (m/total of/)
+ {
+ chomp $_;
+ my @words = split (/ /, $_);
+ my $pid = $words[3];
+ my $h = $words[7];
+ $heartbeats{$pid} += $h;
+ }
+ elsif (m/Received following heartbeats/)
+ {
+ #skip this line - we do our own counting.
+ }
+ else
+ {
+ $status = -1;
+ print STDERR $_;
+ }
+ }
+ close (TEST_OUTPUT);
+
+ foreach $pid (keys %heartbeats)
+ {
+ my $ideal_heartbeats = $number_of_applications * 50;
+ my $received_heartbeats = $heartbeats{$pid};
+ my $in_range = (($ideal_heartbeats - $received_heartbeats)
+ <= $number_of_applications);
+ my $range_note = " (";
+ if (! $in_range) {
+ $range_note .= "NOT ";
+ $status = -1;
+ }
+ $range_note.=
+ "within range of $number_of_applications from $ideal_heartbeats)";
+ print STDERR
+ "Received $received_heartbeats "
+ ."heartbeats from pid $pid";
+ print STDERR "$range_note\n";
+ }
+
+ if ($status == 0) {
+ print STDERR "SUCCESS\n";
+ return 0;
+ }
+
+ print STDERR "ERROR - check $output_file for full output.\n";
+ return -1;
+}
+
+##############################################################
+# Run executables.
+##############################################################
+
+
+$status = 0;
+
+redirect_output ();
+
+if (run_test () == -1) {
+ $status = 1;
+}
+
+restore_output ();
+
+if (analyze_results () == -1) {
+ $status = 1;
+}
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/Event/Performance/Connect.cpp b/TAO/orbsvcs/tests/Event/Performance/Connect.cpp
new file mode 100644
index 00000000000..874f96cc737
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Connect.cpp
@@ -0,0 +1,400 @@
+// $Id$
+
+#include "Connect.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (EC_Tests_Performance,
+ Connect,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_Connect driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Connect::EC_Connect (void)
+ : order_ (0)
+{
+}
+
+void
+EC_Connect::execute_test (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // this->EC_Driver::execute_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+int
+EC_Connect::parse_args (int& argc, char* argv[])
+{
+ if (this->EC_Driver::parse_args (argc, argv) != 0)
+ return -1;
+
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (arg, "-connection_order") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* opt = arg_shifter.get_current ();
+ if (ACE_OS::strcasecmp (opt, "consumers") == 0)
+ this->order_ = 0;
+ else if (ACE_OS::strcasecmp (opt, "suppliers") == 0)
+ this->order_ = 1;
+ else if (ACE_OS::strcasecmp (opt, "interleaved") == 0)
+ this->order_ = 2;
+ else
+ ACE_ERROR ((LM_ERROR,
+ "EC_Connect - invalid choice <%s> for"
+ " connection order\n",
+ opt));
+
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+ return 0;
+}
+
+void
+EC_Connect::print_usage (void)
+{
+ this->EC_Driver::print_usage ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Connect Usage:\n"
+ " -connection_order [consumers|suppliers|interleaved]\n"
+ ));
+}
+
+void
+EC_Connect::print_args (void) const
+{
+ this->EC_Driver::print_args ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Connect parameters:\n"
+ " order = <%d>\n",
+ this->order_));
+}
+
+void
+EC_Connect::dump_results (void)
+{
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_DEBUG ((LM_DEBUG, "\nConnect time:\n"));
+ this->consumer_connect_.dump_results ("Consumer/connect", gsf);
+ this->supplier_connect_.dump_results ("Supplier/connect", gsf);
+
+ ACE_DEBUG ((LM_DEBUG, "\nDisconnect time:\n"));
+}
+
+void
+EC_Connect::connect_consumer (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int i
+ ACE_ENV_ARG_DECL)
+{
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->EC_Driver::connect_consumer (consumer_admin,
+ i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->consumer_connect_.sample (now - this->start_time_,
+ now - start);
+}
+
+void
+EC_Connect::connect_supplier (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ int i
+ ACE_ENV_ARG_DECL)
+{
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->EC_Driver::connect_supplier (supplier_admin,
+ i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->supplier_connect_.sample (now - this->start_time_,
+ now - start);
+}
+
+EC_Consumer*
+EC_Connect::allocate_consumer (int i)
+{
+ return new ECC_Consumer (this, this->consumers_ + i);
+}
+
+EC_Supplier*
+EC_Connect::allocate_supplier (int i)
+{
+ return new ECC_Supplier (this, this->consumers_ + i);
+}
+
+void
+EC_Connect::connect_clients (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->start_time_ = ACE_OS::gethrtime ();
+ switch (this->order_)
+ {
+ default:
+ case 0:
+ this->connect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->connect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+
+ case 1:
+ this->connect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->connect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+
+ case 2:
+ break;
+ }
+
+ int max = this->n_consumers_;
+ if (max < this->n_suppliers_)
+ max = this->n_suppliers_;
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (int i = 0; i != max; ++i)
+ {
+ if (i < this->n_consumers_)
+ {
+ this->connect_consumer (consumer_admin.in (), i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (i < this->n_suppliers_)
+ {
+ this->connect_supplier (supplier_admin.in (), i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+}
+
+void
+EC_Connect::disconnect_clients (ACE_ENV_SINGLE_ARG_DECL)
+{
+ switch (this->order_)
+ {
+ default:
+ case 0:
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+
+ case 1:
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+
+ case 2:
+ break;
+ }
+
+ int max = this->n_consumers_;
+ if (max < this->n_suppliers_)
+ max = this->n_suppliers_;
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t start_time = ACE_OS::gethrtime ();
+ for (int i = 0; i != max; ++i)
+ {
+ if (i < this->n_suppliers_)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ this->suppliers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->supplier_disconnect_.sample (now - start_time,
+ now - start);
+ }
+ if (i < this->n_consumers_)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ this->consumers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->consumer_disconnect_.sample (now - start_time,
+ now - start);
+ }
+ }
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ this->consumer_disconnect_.dump_results ("Consumer/disconnect", gsf);
+ this->supplier_disconnect_.dump_results ("Supplier/disconnect", gsf);
+}
+
+void
+EC_Connect::disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_hrtime_t start_time = ACE_OS::gethrtime ();
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ this->consumers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->consumer_disconnect_.sample (now - start_time,
+ now - start);
+ }
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ this->consumer_disconnect_.dump_results ("Consumer/disconnect",
+ gsf);
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Connect (%P|%t) consumers disconnected\n"));
+}
+
+void
+EC_Connect::disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_hrtime_t start_time = ACE_OS::gethrtime ();
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ this->suppliers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->supplier_disconnect_.sample (now - start_time,
+ now - start);
+ }
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ this->supplier_disconnect_.dump_results ("Supplier/disconnect",
+ gsf);
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Connect (%P|%t) suppliers disconnected\n"));
+}
+
+
+// ****************************************************************
+
+ECC_Consumer::ECC_Consumer (EC_Driver* driver, void* cookie)
+ : EC_Consumer (driver, cookie)
+{
+}
+
+void
+ECC_Consumer::connect (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ this->EC_Consumer::connect (consumer_admin,
+ qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ECC_Consumer::connect (
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->EC_Consumer::connect (qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->connect_time_.sample (now, now - start);
+}
+
+void
+ECC_Consumer::dump_results (const char* name,
+ ACE_UINT32 gsf)
+{
+ this->connect_time_.dump_results (name, gsf);
+ this->EC_Consumer::dump_results (name, gsf);
+}
+
+// ****************************************************************
+
+ECC_Supplier::ECC_Supplier (EC_Driver* driver, void* cookie)
+ : EC_Supplier (driver, cookie)
+{
+}
+
+void
+ECC_Supplier::connect (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ this->EC_Supplier::connect (supplier_admin,
+ qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+ECC_Supplier::connect (
+ const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ this->EC_Supplier::connect (qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->connect_time_.sample (now, now - start);
+}
+
+void
+ECC_Supplier::dump_results (const char* name,
+ ACE_UINT32 gsf)
+{
+ this->connect_time_.dump_results (name, gsf);
+ this->EC_Supplier::dump_results (name, gsf);
+}
diff --git a/TAO/orbsvcs/tests/Event/Performance/Connect.h b/TAO/orbsvcs/tests/Event/Performance/Connect.h
new file mode 100644
index 00000000000..caaf08b425a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Connect.h
@@ -0,0 +1,133 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel testsuite
+//
+// = FILENAME
+// Connect
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef EC_CONNECT_H
+#define EC_CONNECT_H
+
+#include "Consumer.h"
+#include "Supplier.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class EC_Connect : public EC_Driver
+{
+ //
+ // = TITLE
+ // Test the EC connection feature
+ //
+ // = DESCRIPTION
+ // The EC can be configured to allow re-connection of suppliers
+ // and consumers, this test verifies that:
+ // + The EC does *not* allow connections if the feature is
+ // disabled (the default)
+ // + The EC does allow connections if the feature is enabled
+ // and:
+ // - There are no memory leaks
+ // - Compares the time required for a connection vs a complete
+ // connect/disconnect cycle, specially as the number of
+ // suppliers and consumers increases.
+ //
+public:
+ EC_Connect (void);
+ // Constructor
+
+ // = The EC_Driver methods
+ virtual int parse_args (int& argc, char* argv[]);
+ virtual void print_usage (void);
+ virtual void print_args (void) const;
+
+ void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Don't run the suppliers, just test connect and disconnect calls.
+
+ virtual void dump_results (void);
+
+ virtual void connect_consumer (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int i
+ ACE_ENV_ARG_DECL);
+ virtual void connect_supplier (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ int i
+ ACE_ENV_ARG_DECL);
+ virtual void disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL);
+ virtual void disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual EC_Consumer* allocate_consumer (int i);
+ virtual EC_Supplier* allocate_supplier (int i);
+
+ virtual void connect_clients (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ virtual void disconnect_clients (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ ACE_hrtime_t start_time_;
+ ACE_Throughput_Stats consumer_connect_;
+ ACE_Throughput_Stats supplier_connect_;
+ ACE_Throughput_Stats consumer_disconnect_;
+ ACE_Throughput_Stats supplier_disconnect_;
+
+ int order_;
+ // What is connected first?
+};
+
+// ****************************************************************
+
+class ECC_Consumer : public EC_Consumer
+{
+public:
+ ECC_Consumer (EC_Driver *driver, void* cookie);
+
+ virtual void connect (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+ virtual void connect (
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+ virtual void dump_results (const char* name,
+ ACE_UINT32 global_scale_factor);
+
+private:
+ ACE_Throughput_Stats connect_time_;
+};
+
+// ****************************************************************
+
+class ECC_Supplier : public EC_Supplier
+{
+public:
+ ECC_Supplier (EC_Driver *driver, void* cookie);
+
+ virtual void connect (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+ virtual void connect (
+ const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+ virtual void dump_results (const char* name,
+ ACE_UINT32 global_scale_factor);
+
+private:
+ ACE_Throughput_Stats connect_time_;
+};
+
+#endif /* EC_CONNECT_H */
diff --git a/TAO/orbsvcs/tests/Event/Performance/Event_Performance.mpc b/TAO/orbsvcs/tests/Event/Performance/Event_Performance.mpc
new file mode 100644
index 00000000000..b0df7a26f09
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Event_Performance.mpc
@@ -0,0 +1,38 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Throughput): eventperftestexe {
+ exename = Throughput
+ Source_Files {
+ Throughput.cpp
+ }
+}
+
+project(*Connect): eventperftestexe {
+ exename = Connect
+ Source_Files {
+ Connect.cpp
+ }
+}
+
+project(*Inversion): eventperftestexe {
+ exename = Inversion
+ Source_Files {
+ Inversion.cpp
+ }
+}
+
+project(*Latency): eventperftestexe, strategies {
+ exename = Latency
+ Source_Files {
+ Latency.cpp
+ }
+}
+
+project(*Latency_Server): eventperftestexe, rtevent_serv, strategies {
+ exename = Latency_Server
+ Source_Files {
+ Latency_Server.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Event/Performance/Inversion.cpp b/TAO/orbsvcs/tests/Event/Performance/Inversion.cpp
new file mode 100644
index 00000000000..c3c4661d8c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Inversion.cpp
@@ -0,0 +1,176 @@
+// $Id$
+
+#include "Inversion.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "ace/Sched_Params.h"
+#include "ace/Arg_Shifter.h"
+
+ACE_RCSID (EC_Tests_Performance,
+ Inversion,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_Inversion driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Inversion::EC_Inversion (void)
+ : same_events_ (0)
+{
+}
+
+int
+EC_Inversion::parse_args (int &argc, char *argv [])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (arg, "-same_events") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->same_events_ = 1;
+ }
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ int r = this->EC_Driver::parse_args (argc, argv);
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Inversion (%P|%t) "
+ "adjusting number of consumers (2)\n"));
+ return r;
+}
+
+void
+EC_Inversion::connect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ConsumerQOS_Factory qos0;
+ qos0.start_disjunction_group (2);
+ qos0.insert_type (ACE_ES_EVENT_UNDEFINED, 0);
+ qos0.insert_type (ACE_ES_EVENT_UNDEFINED + 1, 0);
+
+ this->consumers_[0]->connect (consumer_admin.in (),
+ qos0.get_ConsumerQOS (),
+ ACE_ES_EVENT_UNDEFINED + 1
+ ACE_ENV_ARG_PARAMETER);
+
+ for (int i = 1; i < this->n_consumers_; ++i)
+ {
+ int base_event = ACE_ES_EVENT_UNDEFINED + 2;
+ if (this->same_events_)
+ base_event = ACE_ES_EVENT_UNDEFINED;
+
+ ACE_ConsumerQOS_Factory qos1;
+ qos1.start_disjunction_group (2);
+ qos1.insert_type (base_event , 0);
+ qos1.insert_type (base_event + 1, 0);
+
+ this->consumers_[i]->connect (consumer_admin.in (),
+ qos1.get_ConsumerQOS (),
+ base_event + 1
+ ACE_ENV_ARG_PARAMETER);
+ }
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Inversion (%P|%t) connected consumer(s)\n"));
+}
+
+void
+EC_Inversion::connect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_SupplierQOS_Factory qos0;
+ qos0.insert (1, ACE_ES_EVENT_UNDEFINED, 0, 1);
+ qos0.insert (1, ACE_ES_EVENT_UNDEFINED + 1, 0, 1);
+
+ this->suppliers_[0]->connect (supplier_admin.in (),
+ qos0.get_SupplierQOS (),
+ ACE_ES_EVENT_UNDEFINED + 1
+ ACE_ENV_ARG_PARAMETER);
+
+ for (int j = 1; j != this->n_suppliers_; ++j)
+ {
+ int base_event = ACE_ES_EVENT_UNDEFINED + 2;
+ if (this->same_events_)
+ base_event = ACE_ES_EVENT_UNDEFINED;
+
+ ACE_SupplierQOS_Factory qos1;
+ qos1.insert (1, base_event , 0, 1);
+ qos1.insert (1, base_event + 1, 0, 1);
+
+ this->suppliers_[j]->connect (supplier_admin.in (),
+ qos1.get_SupplierQOS (),
+ base_event + 1
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Inversion (%P|%t) connected supplier(s)\n"));
+}
+
+void
+EC_Inversion::activate_tasks (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ int priority;
+
+ if (ACE_BIT_ENABLED (this->thr_create_flags_, THR_SCHED_FIFO))
+ {
+ priority =
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO);
+ }
+ else
+ {
+ priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_OTHER);
+ }
+ if (this->tasks_[0]->activate (this->thr_create_flags_,
+ 1, 0, priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Inversion (%P|%t) cannot activate high prio task\n"));
+ }
+
+ if (ACE_BIT_ENABLED (this->thr_create_flags_, THR_SCHED_FIFO))
+ {
+ priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ }
+ else
+ {
+ priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_OTHER);
+ }
+
+ for (int i = 1; i < this->n_suppliers_; ++i)
+ {
+ if (this->tasks_[i]->activate (this->thr_create_flags_,
+ 1, 0, priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Inversion (%P|%t) Cannot activate thread "
+ "for supplier %d\n%p\n",
+ i, "EC_Inversion - OS error is:"));
+ }
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Performance/Inversion.h b/TAO/orbsvcs/tests/Event/Performance/Inversion.h
new file mode 100644
index 00000000000..6811eb6c794
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Inversion.h
@@ -0,0 +1,60 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel testsuite
+//
+// = FILENAME
+// Inversion
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef EC_INVERSION_H
+#define EC_INVERSION_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class EC_Inversion : public EC_Driver
+{
+ //
+ // = TITLE
+ // Measure priority inversions in the EC.
+ //
+ // = DESCRIPTION
+ //
+public:
+ EC_Inversion (void);
+ // Constructor
+
+ // = The EC_Driver methods
+ int parse_args (int &argc, char *argv[]);
+ // Parse the arguments, but override the number of consumers.
+ // The options controlling the event types are ignored, and only two
+ // consumers are created.
+
+ virtual void connect_consumers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ virtual void connect_suppliers (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // In this test there are two consumers, the high priority consumer
+ // receives only events from a single high priority supplier. The
+ // other consumer receives events from a set of low priority
+ // suppliers.
+
+ virtual void activate_tasks (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Activate the suppliers at different priorities
+
+private:
+ int same_events_;
+ // If set then both low priority and high priority suppliers
+ // generate the same events.
+};
+
+#endif /* EC_INVERSION_H */
diff --git a/TAO/orbsvcs/tests/Event/Performance/Latency.cpp b/TAO/orbsvcs/tests/Event/Performance/Latency.cpp
new file mode 100644
index 00000000000..2d0cd3903aa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Latency.cpp
@@ -0,0 +1,421 @@
+// $Id$
+
+#include "Latency.h"
+#include "orbsvcs/Event_Service_Constants.h"
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Get_Opt.h"
+#include "ace/Sample_History.h"
+#include "ace/Basic_Stats.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID(EC_Tests_Performance, Latency, "$Id$")
+
+int iterations = 1000;
+int do_dump_history = 0;
+const char *ec_ior = "file://ec.ior";
+
+/// Parse the arguments.
+static int parse_args (int argc, char *argv[]);
+
+int
+main (int argc, char *argv [])
+{
+ int priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
+ priority);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "server (%P|%t): user is not superuser, "
+ "test runs in time-shared class\n"));
+ }
+ else
+ ACE_ERROR ((LM_ERROR,
+ "server (%P|%t): sched_params failed\n"));
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if (TAO_HAS_CORBA_MESSAGING == 1)
+ CORBA::Object_var manager_object =
+ orb->resolve_initial_references ("ORBPolicyManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyManager_var policy_manager =
+ CORBA::PolicyManager::_narrow (manager_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any sync_scope;
+ sync_scope <<= Messaging::SYNC_WITH_TARGET;
+
+ CORBA::PolicyList policy_list (1);
+ policy_list.length (1);
+ policy_list[0] =
+ orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE,
+ sync_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policy_manager->set_policy_overrides (policy_list,
+ CORBA::SET_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "CORBA Messaging disabled in this configuration,"
+ " test may not be optimally configured\n"));
+#endif /* TAO_HAS_MESSAGING */
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // Get the event channel object reference
+ CORBA::Object_var object =
+ orb->string_to_object (ec_ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var ec =
+ RtecEventChannelAdmin::EventChannel::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (ec.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Invalid or nil event channel\n"));
+ return 1;
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "Resolved event service\n"));
+
+ // Now create the history
+ ACE_Sample_History history (iterations);
+ TAO_SYNCH_MUTEX history_mutex;
+
+ // The consumer
+ EC_Latency_Consumer consumer (&history,
+ &history_mutex,
+ iterations);
+ // Connect the consumer
+
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy_supplier =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushConsumer_var consumer_reference =
+ consumer._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Simple subscription, but usually the helper classes in
+ // $TAO_ROOT/orbsvcs/Event_Utils.h are a better way to do this.
+ RtecEventChannelAdmin::ConsumerQOS consumer_qos;
+ consumer_qos.dependencies.length (2);
+ RtecEventComm::EventHeader& h0 =
+ consumer_qos.dependencies[0].event.header;
+ h0.type = ACE_ES_DISJUNCTION_DESIGNATOR;
+ h0.source = 1;
+
+ RtecEventComm::EventHeader& h1 =
+ consumer_qos.dependencies[1].event.header;
+ h1.type = ACE_ES_EVENT_UNDEFINED; // first free event type
+ h1.source = ACE_ES_EVENT_SOURCE_ANY;
+
+ proxy_supplier->connect_push_consumer (consumer_reference.in (),
+ consumer_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Connected consumer\n"));
+
+ // The supplier
+ EC_Latency_Supplier supplier;
+
+ // The canonical protocol to connect to the EC
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushConsumer_var proxy_consumer =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventComm::PushSupplier_var supplier_reference =
+ supplier._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Simple publication, but usually the helper classes in
+ // $TAO_ROOT/orbsvcs/Event_Utils.h are a better way to do this.
+ RtecEventChannelAdmin::SupplierQOS supplier_qos;
+ supplier_qos.publications.length (1);
+ RtecEventComm::EventHeader& sh0 =
+ supplier_qos.publications[0].event.header;
+ sh0.type = ACE_ES_EVENT_UNDEFINED; // first free event type
+ sh0.source = 1; // first free event source
+
+ proxy_consumer->connect_push_supplier (supplier_reference.in (),
+ supplier_qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Connected supplier\n"));
+
+ Task task (proxy_consumer.in (), iterations);
+
+ task.activate ();
+
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ while (!task.done () || !consumer.done ())
+ {
+ ACE_Time_Value tv (1, 0);
+ orb->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_hrtime_t end = ACE_OS::gethrtime ();
+
+ ACE_Thread_Manager::instance ()->wait ();
+
+ // Calibrate the high resolution timer *before* starting the
+ // test.
+ ACE_DEBUG ((LM_DEBUG, "Calibrating high res timer ...."));
+ ACE_High_Res_Timer::calibrate ();
+
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_DEBUG ((LM_DEBUG, "Done (%d)\n", gsf));
+ if (do_dump_history)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats stats;
+ history.collect_basic_stats (stats);
+ stats.dump_results ("Latency", gsf);
+
+ ACE_hrtime_t elapsed_microseconds = (end - start) / gsf;
+ double elapsed_seconds =
+ ACE_CU64_TO_CU32(elapsed_microseconds) / 1000000.0;
+ double throughput =
+ double(iterations) / elapsed_seconds;
+
+ ACE_DEBUG ((LM_DEBUG, "Throughtput: %f\n", throughput));
+
+ proxy_supplier->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ proxy_consumer->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id;
+
+ id = root_poa->servant_to_id (&consumer ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ id = root_poa->servant_to_id (&supplier ACE_ENV_ARG_PARAMETER);
+ root_poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, argv[0]);
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "hi:k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'h':
+ do_dump_history = 1;
+ break;
+
+ case 'i':
+ iterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'k':
+ ec_ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-i <iterations>"
+ "-k <IOR>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+// ****************************************************************
+
+EC_Latency_Consumer::EC_Latency_Consumer (ACE_Sample_History *history,
+ TAO_SYNCH_MUTEX *mutex,
+ int message_count)
+ : history_ (history)
+ , mutex_ (mutex)
+ , remaining_messages_ (message_count)
+{
+}
+
+int
+EC_Latency_Consumer::done (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, *this->mutex_, -1);
+ return this->remaining_messages_ <= 0;
+}
+
+void
+EC_Latency_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t creation;
+ ORBSVCS_Time::TimeT_to_hrtime (creation,
+ events[0].header.creation_time);
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->mutex_);
+ this->history_->sample (now - creation);
+ if (this->remaining_messages_ % 1000 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Only %d messages to go\n",
+ this->remaining_messages_));
+ }
+
+ this->remaining_messages_--;
+}
+
+void
+EC_Latency_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+// ****************************************************************
+
+EC_Latency_Supplier::EC_Latency_Supplier (void)
+{
+}
+
+void
+EC_Latency_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+// ****************************************************************
+
+Task::Task (RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer,
+ int iterations)
+ : consumer_ (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate (consumer))
+ , remaining_messages_ (iterations)
+{
+}
+
+int
+Task::done (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 1);
+ return this->remaining_messages_ == 0;
+}
+
+int
+Task::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.type = ACE_ES_EVENT_UNDEFINED;
+ event[0].header.source = 1;
+ event[0].header.ttl = 1;
+ event[0].data.payload.length(1024);
+
+ for (;;)
+ {
+ ACE_hrtime_t creation = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
+ creation);
+ this->consumer_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // ACE_Time_Value tv (0, 5000);
+ // ACE_OS::sleep (tv);
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, -1);
+ if (this->remaining_messages_ % 1000 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Only %d messages to go\n",
+ this->remaining_messages_));
+ }
+
+ this->remaining_messages_--;
+ if (this->remaining_messages_ == 0)
+ return 0;
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "Task::svc");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Performance/Latency.h b/TAO/orbsvcs/tests/Event/Performance/Latency.h
new file mode 100644
index 00000000000..96a182baa25
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Latency.h
@@ -0,0 +1,100 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel testsuite
+//
+// = FILENAME
+// Latency
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef EC_LATENCY_H
+#define EC_LATENCY_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Task.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Sample_History;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+/// Simple consumer, receives events and record roundtrip delays.
+class EC_Latency_Consumer : public POA_RtecEventComm::PushConsumer
+{
+public:
+ /// Constructor
+ EC_Latency_Consumer (ACE_Sample_History *history,
+ TAO_SYNCH_MUTEX *mutex,
+ int message_count);
+
+ /// Return 1 when all the messages have been received
+ int done (void);
+
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Roundtrip delays are recorded here
+ ACE_Sample_History *history_;
+
+ /// Use this mutex to synchronize access to history_
+ TAO_SYNCH_MUTEX *mutex_;
+
+ /// Number of messages yet to be received
+ int remaining_messages_;
+};
+
+// ****************************************************************
+
+class EC_Latency_Supplier : public POA_RtecEventComm::PushSupplier
+{
+public:
+ /// Constructor
+ EC_Latency_Supplier (void);
+
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+// ****************************************************************
+
+/// Send events in another thread
+class Task : public ACE_Task_Base
+{
+public:
+ /// Constructor
+ Task (RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer,
+ int iterations);
+
+ /// Return 1 when all the messages have been sent
+ int done (void);
+
+ /// Run the experiment
+ int svc (void);
+
+private:
+ /// The consumer
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_;
+
+ /// Number of messages that have to be sent
+ int remaining_messages_;
+
+ /// Synchronize access to remaining_messages_
+ TAO_SYNCH_MUTEX mutex_;
+};
+
+#endif /* EC_LATENCY_H */
diff --git a/TAO/orbsvcs/tests/Event/Performance/Latency_Server.cpp b/TAO/orbsvcs/tests/Event/Performance/Latency_Server.cpp
new file mode 100644
index 00000000000..524d4301164
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Latency_Server.cpp
@@ -0,0 +1,180 @@
+// $Id$
+
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+
+#include "tao/Messaging/Messaging.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Get_Opt.h"
+#include "ace/Sample_History.h"
+#include "ace/Sched_Params.h"
+#include "ace/OS_NS_errno.h"
+
+ACE_RCSID(EC_Tests_Performance, Latency_Server, "$Id$")
+
+const char *ior_file_name = "ec.ior";
+
+/// Parse the arguments.
+static int parse_args (int argc, char *argv[]);
+
+int
+main (int argc, char *argv [])
+{
+ TAO_EC_Default_Factory::init_svcs ();
+
+ int priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
+ priority);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "server (%P|%t): user is not superuser, "
+ "test runs in time-shared class\n"));
+ }
+ else
+ ACE_ERROR ((LM_ERROR,
+ "server (%P|%t): sched_params failed\n"));
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if (TAO_HAS_CORBA_MESSAGING == 1)
+ CORBA::Object_var manager_object =
+ orb->resolve_initial_references ("ORBPolicyManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyManager_var policy_manager =
+ CORBA::PolicyManager::_narrow (manager_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any sync_scope;
+ sync_scope <<= Messaging::SYNC_WITH_TARGET;
+
+ CORBA::PolicyList policy_list (1);
+ policy_list.length (1);
+ policy_list[0] =
+ orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE,
+ sync_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policy_manager->set_policy_overrides (policy_list,
+ CORBA::SET_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "CORBA Messaging disabled in this configuration,"
+ " test may not be optimally configured\n"));
+#endif /* TAO_HAS_MESSAGING */
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ TAO_EC_Event_Channel_Attributes attr (root_poa.in (),
+ root_poa.in ());
+ TAO_EC_Event_Channel ec_impl (attr);
+ ec_impl.activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var ec =
+ ec_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var str =
+ orb->object_to_string (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ior_file_name != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_file_name, "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);
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id =
+ root_poa->servant_to_id (&ec_impl ACE_ENV_ARG_PARAMETER);
+ root_poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, argv[0]);
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+// ****************************************************************
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_file_name = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <ior_file_name>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/Performance/Makefile.am b/TAO/orbsvcs/tests/Event/Performance/Makefile.am
new file mode 100644
index 00000000000..b37e6f11b58
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Makefile.am
@@ -0,0 +1,229 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Event_Performance_Connect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Connect
+
+Connect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Connect_SOURCES = \
+ Connect.cpp \
+ Connect.h
+
+Connect_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Performance_Inversion.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Inversion
+
+Inversion_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Inversion_SOURCES = \
+ Inversion.cpp \
+ Inversion.h
+
+Inversion_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Performance_Latency.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Latency
+
+Latency_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Latency_SOURCES = \
+ Latency.cpp \
+ Latency.h
+
+Latency_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Performance_Latency_Server.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Latency_Server
+
+Latency_Server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Latency_Server_SOURCES = \
+ Latency_Server.cpp \
+ Connect.h \
+ Inversion.h \
+ Latency.h \
+ Throughput.h
+
+Latency_Server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Event_Performance_Throughput.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += Throughput
+
+Throughput_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(srcdir)/../lib
+
+Throughput_SOURCES = \
+ Throughput.cpp \
+ Throughput.h
+
+Throughput_LDADD = \
+ $(top_builddir)/orbsvcs/tests/Event/lib/libECTests.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Event/Performance/README b/TAO/orbsvcs/tests/Event/Performance/README
new file mode 100644
index 00000000000..2a62f56080a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/README
@@ -0,0 +1,50 @@
+# $Id$
+
+ Performance tests for the real-time event channel.
+
+This directory contains several tests to measure the performance of
+the real-time event channel. Remember to compile ACE and TAO with
+optimizations enabled when running this tests.
+
+ Here are some canonical test configurations:
+
+# Measure throughput and latency, in a configuration suitable for
+# single threaded systems. This is probably the best case scenario,
+# one supplier, one consumer and no locking.
+
+$ Throughput -burstsize 100000 -burstcount 1
+
+# Same test as above, but with a configuration that is MT-safe
+
+$ Throughput -ORBsvcconf ec.st.conf -burstsize 100000 -burstcount 1
+
+# Increase the number of consumers, but only the first one receives
+# events.
+
+$ Throughput -ORBsvcconf ec.st.conf -burstsize 100000 -burstcount 1 \
+ -consumers 4
+
+# Now increase the number of suppliers, only one consumer receives
+# events from each supplier.
+
+$ Throughput -ORBsvcconf ec.st.conf -burstsize 100000 -burstcount 1 \
+ -consumers 4 -suppliers 4
+
+# Now a test where all consumers receive events from all suppliers
+
+$ Throughput -ORBsvcconf ec.st.conf -burstsize 100000 -burstcount 1 \
+ -consumers 4 -suppliers 4 -consumers_tshift 0 -suppliers_tshift 0
+
+
+# Measure the time required to connect the 100 consumers and 100
+# suppliers, inserting one supplier first and then one supplier.
+# Try -connection_order "consumers" or "suppliers"
+
+$ Connect -ORBsvcconf ec.st.conf -consumers 100 -suppliers 100 \
+ -connection_order interleaved
+
+
+NOTES
+
+ Don't worry about the "incomplete data" warning, it is a
+deffect in the test.
diff --git a/TAO/orbsvcs/tests/Event/Performance/Throughput.cpp b/TAO/orbsvcs/tests/Event/Performance/Throughput.cpp
new file mode 100644
index 00000000000..513434e07f9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Throughput.cpp
@@ -0,0 +1,61 @@
+// $Id$
+
+#include "Throughput.h"
+#include "Consumer.h"
+#include "Supplier.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (EC_Tests_Performance,
+ Throughput,
+ "$Id$")
+
+int
+main (int argc, char *argv [])
+{
+ EC_Throughput driver;
+ return driver.run (argc, argv);
+}
+
+// ****************************************************************
+
+EC_Throughput::EC_Throughput (void)
+{
+}
+
+int
+EC_Throughput::parse_args (int& argc, char* argv[])
+{
+ if (this->EC_Driver::parse_args (argc, argv) != 0)
+ return -1;
+ return 0;
+}
+
+void
+EC_Throughput::print_args (void) const
+{
+ this->EC_Driver::print_args ();
+}
+
+void
+EC_Throughput::print_usage (void)
+{
+ this->EC_Driver::print_usage ();
+}
+
+void
+EC_Throughput::modify_attributes (TAO_EC_Event_Channel_Attributes&)
+{
+}
+
+void
+EC_Throughput::execute_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->EC_Driver::execute_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+EC_Throughput::dump_results (void)
+{
+ this->EC_Driver::dump_results ();
+}
diff --git a/TAO/orbsvcs/tests/Event/Performance/Throughput.h b/TAO/orbsvcs/tests/Event/Performance/Throughput.h
new file mode 100644
index 00000000000..f3d5ee6cc04
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/Throughput.h
@@ -0,0 +1,56 @@
+/* -*- C++ -*- */
+// $Id$
+//
+// ============================================================================
+//
+// = LIBRARY
+// ORBSVCS Real-time Event Channel testsuite
+//
+// = FILENAME
+// Throughput
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef EC_THROUGHPUT_H
+#define EC_THROUGHPUT_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class EC_Throughput : public EC_Driver
+{
+ //
+ // = TITLE
+ // Test the EC throughput
+ //
+ // = DESCRIPTION
+ //
+public:
+ EC_Throughput (void);
+ // Constructor
+
+ // = The EC_Driver methods
+ virtual int parse_args (int& argc, char* argv[]);
+ virtual void print_args (void) const;
+ virtual void print_usage (void);
+ // add some command line args to enable/disable throughputions
+
+ virtual void modify_attributes (TAO_EC_Event_Channel_Attributes& attr);
+ // set the throughpution flags
+
+ void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Don't run the suppliers, just test connect and disconnect calls.
+
+ void dump_results (void);
+ // Don't dump the EC_Driver results, they are meaningless.
+
+private:
+};
+
+#endif /* EC_THROUGHPUT_H */
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.list.conf b/TAO/orbsvcs/tests/Event/Performance/ec.list.conf
new file mode 100644
index 00000000000..5c28ef28fec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.list.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection st:delayed:list -ECProxyPushSupplierCollection st:delayed:list -ECdispatching reactive -ECfiltering null -ECproxyconsumerlock null -ECproxysupplierlock null -ECsupplierfiltering null"
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.list.conf.xml b/TAO/orbsvcs/tests/Event/Performance/ec.list.conf.xml
new file mode 100644
index 00000000000..0ca6716f58b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.list.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Performance/ec.list.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection st:delayed:list -ECProxyPushSupplierCollection st:delayed:list -ECdispatching reactive -ECfiltering null -ECproxyconsumerlock null -ECproxysupplierlock null -ECsupplierfiltering null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.mt.conf b/TAO/orbsvcs/tests/Event/Performance/ec.mt.conf
new file mode 100644
index 00000000000..c9583c1847d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.mt.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECDispatching mt -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.mt.conf.xml b/TAO/orbsvcs/tests/Event/Performance/ec.mt.conf.xml
new file mode 100644
index 00000000000..cd1467b5bed
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.mt.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Performance/ec.mt.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection mt:immediate:list -ECProxyPushSupplierCollection mt:immediate:list -ECDispatching mt -ECfiltering basic -ECproxyconsumerlock thread -ECproxysupplierlock thread -ECsupplierfiltering per-supplier"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf b/TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf
new file mode 100644
index 00000000000..1032eb4807c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection st:delayed:rb_tree -ECProxyPushSupplierCollection st:delayed:rb_tree -ECdispatching reactive -ECfiltering null -ECproxyconsumerlock null -ECproxysupplierlock null -ECsupplierfiltering null"
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf.xml b/TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf.xml
new file mode 100644
index 00000000000..25f61beac48
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.rb_tree.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Performance/ec.rb_tree.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection st:delayed:rb_tree -ECProxyPushSupplierCollection st:delayed:rb_tree -ECdispatching reactive -ECfiltering null -ECproxyconsumerlock null -ECproxysupplierlock null -ECsupplierfiltering null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.st.conf b/TAO/orbsvcs/tests/Event/Performance/ec.st.conf
new file mode 100644
index 00000000000..6e185e74acb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.st.conf
@@ -0,0 +1,2 @@
+# $Id$
+static EC_Factory "-ECProxyPushConsumerCollection st:immediate:list -ECProxyPushSupplierCollection st:immediate:list -ECdispatching reactive -ECfiltering null -ECproxyconsumerlock null -ECproxysupplierlock null -ECsupplierfiltering null"
diff --git a/TAO/orbsvcs/tests/Event/Performance/ec.st.conf.xml b/TAO/orbsvcs/tests/Event/Performance/ec.st.conf.xml
new file mode 100644
index 00000000000..16f28063d63
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/ec.st.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Performance/ec.st.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <static id="EC_Factory" params="-ECProxyPushConsumerCollection st:immediate:list -ECProxyPushSupplierCollection st:immediate:list -ECdispatching reactive -ECfiltering null -ECproxyconsumerlock null -ECproxysupplierlock null -ECsupplierfiltering null"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Performance/eventperftestexe.mpb b/TAO/orbsvcs/tests/Event/Performance/eventperftestexe.mpb
new file mode 100644
index 00000000000..67e95079156
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/eventperftestexe.mpb
@@ -0,0 +1,13 @@
+// -*- MPC -*-
+// $Id$
+
+project: messaging, rteventexe, rtevent_serv, naming, iortable {
+ after += Event_Test_Lib
+ libs += ECTests
+
+ specific (automake) {
+ includes += $(srcdir)/../lib
+ } else {
+ includes += ../lib
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/Performance/latency.conf b/TAO/orbsvcs/tests/Event/Performance/latency.conf
new file mode 100644
index 00000000000..35359a852cb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/latency.conf
@@ -0,0 +1,4 @@
+# $Id$
+# tp is now the default reactor type
+# static Resource_Factory "-ORBReactorType tp"
+static Client_Strategy_Factory "-ORBClientConnectionHandler RW"
diff --git a/TAO/orbsvcs/tests/Event/Performance/latency.conf.xml b/TAO/orbsvcs/tests/Event/Performance/latency.conf.xml
new file mode 100644
index 00000000000..068e45df3d0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/latency.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Event/Performance/latency.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <!-- tp is now the default reactor type -->
+ <!-- static Resource_Factory "-ORBReactorType tp" -->
+ <static id="Client_Strategy_Factory" params="-ORBClientConnectionHandler RW"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Event/Performance/run_test.pl b/TAO/orbsvcs/tests/Event/Performance/run_test.pl
new file mode 100755
index 00000000000..bde6790200e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/Performance/run_test.pl
@@ -0,0 +1,65 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs the client and all the other servers that
+# are needed
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$ec_st_conf = PerlACE::LocalFile ("ec.st$PerlACE::svcconf_ext");
+
+sub RunTest ($$$)
+{
+ my $message = shift;
+ my $program = shift;
+ my $arguments = shift;
+
+ my $TEST = new PerlACE::Process ($program, $arguments);
+
+ print STDERR "\n\n$message\n";
+
+ my $test = $TEST->SpawnWaitKill (60);
+
+ if ($test != 0) {
+ print STDERR "ERROR: Test returned $test\n";
+ $status = 1;
+ }
+}
+
+RunTest ("\n\nThroughput/Latency single threaded configuration\n",
+ "Throughput",
+ "-ORBsvcconf $ec_st_conf -burstsize 2000 -burstcount 1");
+
+RunTest ("\n\nThroughput/Latency MT-safe configuration\n",
+ "Throughput",
+ "-burstsize 2000 -burstcount 1");
+
+RunTest ("\n\nThroughput/Latency MT-safe configuration, 4 consumers\n",
+ "Throughput",
+ "-burstsize 2000 -burstcount 1 -consumers 4");
+
+RunTest ("\n\nThroughput/Latency MT-safe configuration, 4 consumers 4 suppliers\n",
+ "Throughput",
+ "-burstsize 2000 -burstcount 1 -consumers 4 -suppliers 4");
+
+RunTest ("\n\nThroughput/Latency MT-safe configuration, 4 consumers 4 suppliers\n",
+ "Throughput",
+ "-burstsize 2000 -burstcount 1 -consumers 4 -suppliers 4"
+ . " -consumers_tshift 0 -suppliers_tshift 0");
+
+RunTest ("\n\nConnection and disconnection time, 100 consumers 100 suppliers\n",
+ "Connect",
+ "-consumers 100 -suppliers 100 -connection_order interleaved");
+
+RunTest ("\n\nConnection and disconnection time, 500 consumers 500 suppliers\n",
+ "Connect",
+ "-consumers 500 -suppliers 500 -connection_order interleaved");
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Event/lib/Consumer.cpp b/TAO/orbsvcs/tests/Event/lib/Consumer.cpp
new file mode 100644
index 00000000000..1b04ac6a4c5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Consumer.cpp
@@ -0,0 +1,167 @@
+// $Id$
+
+#include "Consumer.h"
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Time_Utilities.h"
+
+#include "tao/debug.h"
+
+ACE_RCSID (EC_Tests,
+ EC_Consumer,
+ "$Id$")
+
+EC_Consumer::EC_Consumer (EC_Driver *driver,
+ void *cookie)
+ : driver_ (driver),
+ cookie_ (cookie),
+ push_count_ (0),
+ shutdown_event_type_ (ACE_ES_EVENT_SHUTDOWN),
+ is_active_ (0)
+{
+}
+
+void
+EC_Consumer::connect (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (qos, shutdown_event_type ACE_ENV_ARG_PARAMETER);
+}
+
+void
+EC_Consumer::connect (
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ return; // @@ Throw?
+
+ this->shutdown_event_type_ = shutdown_event_type;
+
+ if (CORBA::is_nil (this->myself_.in ()))
+ {
+ this->myself_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ this->is_active_ = 1;
+
+ this->supplier_proxy_->connect_push_consumer (this->myself_.in (),
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+EC_Consumer::connected (void) const
+{
+ return !CORBA::is_nil (this->supplier_proxy_.in ());
+}
+
+void
+EC_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ return;
+
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
+
+void
+EC_Consumer::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!this->is_active_)
+ return;
+
+ // Deactivate the servant
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->myself_ = RtecEventComm::PushConsumer::_nil ();
+ this->is_active_ = 0;
+}
+
+void
+EC_Consumer::dump_results (const char* name,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (name, gsf);
+}
+
+void
+EC_Consumer::accumulate (ACE_Throughput_Stats& throughput) const
+{
+ throughput.accumulate (this->throughput_);
+}
+
+void
+EC_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->driver_->consumer_push (this->cookie_, events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (events.length () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Consumer (%P|%t) no events\n"));
+ return;
+ }
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ if (this->push_count_ == 0)
+ this->throughput_start_ = ACE_OS::gethrtime ();
+
+ this->push_count_ += events.length ();
+
+ if (TAO_debug_level > 0
+ && this->push_count_ % 100 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Consumer (%P|%t): %d events received\n",
+ this->push_count_));
+ }
+
+ for (u_int i = 0; i < events.length (); ++i)
+ {
+ const RtecEventComm::Event& e = events[i];
+
+ ACE_hrtime_t creation;
+ ORBSVCS_Time::TimeT_to_hrtime (creation,
+ e.header.creation_time);
+
+ const ACE_hrtime_t now = ACE_OS::gethrtime ();
+ this->throughput_.sample (now - this->throughput_start_,
+ now - creation);
+
+ if (e.header.type == this->shutdown_event_type_)
+ this->driver_->consumer_shutdown (this->cookie_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+EC_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->driver_->consumer_disconnect (this->cookie_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->supplier_proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
diff --git a/TAO/orbsvcs/tests/Event/lib/Consumer.h b/TAO/orbsvcs/tests/Event/lib/Consumer.h
new file mode 100644
index 00000000000..439b95f9747
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Consumer.h
@@ -0,0 +1,121 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Consumer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_CONSUMER_H
+#define EC_CONSUMER_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/OS_NS_time.h"
+
+/**
+ * @class EC_Consumer
+ *
+ * @brief Simple consumer object to implement EC tests.
+ *
+ * This class is a consumer of events.
+ * The class is just a helper to simplify common tasks in EC
+ * tests, such as subscribing for a range of events, disconnecting
+ * from the EC, informing the driver of shutdown messages, etc.
+ * There are several ways to connect and disconnect this class,
+ * and it is up to the driver program to use the right one.
+ */
+class EC_Test_Export EC_Consumer : public POA_RtecEventComm::PushConsumer
+{
+public:
+ /// Constructor
+ EC_Consumer (EC_Driver* driver, void* cookie);
+
+ /// The driver program can build the QoS attributes and obtain the
+ /// ConsumerAdmin, we do the rest.
+ virtual void connect (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * The driver program can build the QoS attributes and we use
+ * whatevet supplier_proxy we already have (useful for reconnection
+ * tests).
+ */
+ virtual void connect (
+ const RtecEventChannelAdmin::ConsumerQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+
+ /// returns 0 if it is not connected
+ virtual int connected (void) const;
+
+ /// The application can invoke this method to disconnect from the EC
+ /// and deactivate this class.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// The application is shutting down, deactivate the consumer.
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Accumulate our statistics to the totals.
+ void accumulate (ACE_Throughput_Stats& throughput) const;
+
+ /// Printout the statistics
+ virtual void dump_results (const char* name,
+ ACE_UINT32 global_scale_factor);
+
+ // = The RtecEventComm::PushConsumer methods
+
+ /// The skeleton methods.
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// The main driver for the test.
+ EC_Driver* driver_;
+
+ /// A magic cookie passed by the driver that we pass back in our
+ /// callbacks.
+ void* cookie_;
+
+ /// We talk to the EC using this proxy.
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+
+ /// Protect internal state
+ TAO_SYNCH_MUTEX lock_;
+
+ /// The timestamp for the first message received
+ ACE_hrtime_t throughput_start_;
+
+ /// Used for reporting stats
+ ACE_Throughput_Stats throughput_;
+
+ /// The number of push() calls
+ int push_count_;
+
+ /// The type used to indicate shutdown
+ int shutdown_event_type_;
+
+ /// Is the consumer active in the POA?
+ int is_active_;
+
+ /// Cache the object reference to speed up connect/disconnect calls.
+ RtecEventComm::PushConsumer_var myself_;
+};
+
+#endif /* ECT_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Event/lib/Counting_Consumer.cpp b/TAO/orbsvcs/tests/Event/lib/Counting_Consumer.cpp
new file mode 100644
index 00000000000..22e3480f3ce
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Counting_Consumer.cpp
@@ -0,0 +1,116 @@
+// $Id$
+
+#include "Counting_Consumer.h"
+
+ACE_RCSID(EC_Tests, EC_Count_Consumer, "$Id$")
+
+EC_Counting_Consumer::EC_Counting_Consumer (const char* name)
+ : event_count (0),
+ disconnect_count (0),
+ name_ (name)
+{
+}
+
+void
+EC_Counting_Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL)
+{
+ // The canonical protocol to connect to the EC
+
+ RtecEventComm::PushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ this->supplier_proxy_->connect_push_consumer (consumer.in (),
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Counting_Consumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->supplier_proxy_.in ()))
+ {
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->supplier_proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+ }
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+EC_Counting_Consumer::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POA_var consumer_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var consumer_id =
+ consumer_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_poa->deactivate_object (consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
+
+void
+EC_Counting_Consumer::dump_results (int expected_count, int tolerance)
+{
+ int diff = this->event_count - expected_count;
+ if (diff > tolerance || diff < -tolerance)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "ERROR - %s unexpected number of events <%d>\n",
+ this->name_,
+ this->event_count));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s - number of events <%d> within margins\n",
+ this->name_,
+ this->event_count));
+ }
+}
+
+void
+EC_Counting_Consumer::push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (events.length () == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%P|%t) no events\n", this->name_));
+ return;
+ }
+
+ this->event_count ++;
+#if 0
+ if (this->event_count % 10 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%s (%P|%t): %d events received\n",
+ this->name_,
+ this->event_count));
+ }
+#endif /* 0 */
+}
+
+void
+EC_Counting_Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->disconnect_count++;
+ this->supplier_proxy_ =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+}
diff --git a/TAO/orbsvcs/tests/Event/lib/Counting_Consumer.h b/TAO/orbsvcs/tests/Event/lib/Counting_Consumer.h
new file mode 100644
index 00000000000..06878cb4b9f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Counting_Consumer.h
@@ -0,0 +1,72 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Counting_Consumer.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_COUNTING_CONSUMER_H
+#define EC_COUNTING_CONSUMER_H
+
+#include "ectest_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+
+/**
+ * @class EC_Counting_Consumer
+ *
+ * @brief Simple consumer object to implement EC tests.
+ *
+ * This is a simple consumer that counts the events it receives.
+ */
+class EC_Test_Export EC_Counting_Consumer : public POA_RtecEventComm::PushConsumer
+{
+public:
+ /// Constructor
+ EC_Counting_Consumer (const char* name);
+
+ /// Simple connect/disconnect methods..
+ void connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ const RtecEventChannelAdmin::ConsumerQOS &qos
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Print out an error message if the event count is too far from the
+ /// expected count.
+ void dump_results (int expected_count, int tolerance);
+
+ // = The RtecEventComm::PushConsumer methods
+
+ /// The skeleton methods.
+ virtual void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Keep track of the number of events received.
+ CORBA::ULong event_count;
+
+ /// Keep track of the number of disconnect calls received.
+ CORBA::ULong disconnect_count;
+
+protected:
+ /// The proxy
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+
+ /// The name
+ const char* name_;
+};
+
+#endif /* ECT_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Event/lib/Counting_Supplier.cpp b/TAO/orbsvcs/tests/Event/lib/Counting_Supplier.cpp
new file mode 100644
index 00000000000..59bfbe0b6ac
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Counting_Supplier.cpp
@@ -0,0 +1,225 @@
+// $Id$
+
+#include "Counting_Supplier.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Tests,
+ EC_Count_Supplier,
+ "$Id$")
+
+EC_Counting_Supplier::EC_Counting_Supplier (void)
+ : event_count (0),
+ disconnect_count (0),
+ consumer_adapter_ (this),
+ event_source_ (-1),
+ event_type_ (ACE_ES_EVENT_UNDEFINED)
+{
+}
+
+void
+EC_Counting_Supplier::activate (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int milliseconds
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::PushConsumer_var consumer =
+ this->consumer_adapter_._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_proxy_ =
+ consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Let's say that the execution time for event 2 is 1
+ // milliseconds...
+ ACE_Time_Value tv (0, milliseconds * 1000);
+ TimeBase::TimeT time;
+ ORBSVCS_Time::Time_Value_to_TimeT (time, tv);
+
+ ACE_ConsumerQOS_Factory consumer_qos;
+ consumer_qos.start_disjunction_group (1);
+ consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT,
+ time,
+ 0);
+
+ this->supplier_proxy_->connect_push_consumer (consumer.in (),
+ consumer_qos.get_ConsumerQOS ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Counting_Supplier::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->supplier_proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POA_var consumer_poa =
+ this->consumer_adapter_._default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var consumer_id =
+ consumer_poa->servant_to_id (&this->consumer_adapter_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer_poa->deactivate_object (consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Counting_Supplier::connect (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ int published_source,
+ int published_type,
+ int event_source,
+ int event_type
+ ACE_ENV_ARG_DECL)
+{
+ this->event_source_ = event_source;
+ this->event_type_ = event_type;
+
+ ACE_SupplierQOS_Factory supplier_qos;
+ supplier_qos.insert (published_source,
+ published_type,
+ 0, 1);
+ this->connect (supplier_admin,
+ supplier_qos.get_SupplierQOS ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+EC_Counting_Supplier::connect (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ const RtecEventChannelAdmin::SupplierQOS &qos
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventComm::PushSupplier_var supplier =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ this->consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ this->consumer_proxy_->connect_push_supplier (supplier.in (),
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Counting_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!CORBA::is_nil (this->consumer_proxy_.in ()))
+ {
+ this->consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ PortableServer::POA_var supplier_poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var supplier_id =
+ supplier_poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier_poa->deactivate_object (supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+EC_Counting_Supplier::push (const RtecEventComm::EventSet&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.source = this->event_source_;
+ event[0].header.type = this->event_type_;
+ event[0].header.ttl = 1;
+
+ this->consumer_proxy_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->event_count++;
+}
+
+void
+EC_Counting_Supplier::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+EC_Counting_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->disconnect_count++;
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+// ****************************************************************
+
+EC_Counting_Supplier_Task::
+ EC_Counting_Supplier_Task (EC_Counting_Supplier *s)
+ : supplier_ (s),
+ stop_flag_ (0),
+ push_count_ (0)
+{
+}
+
+int
+EC_Counting_Supplier_Task::svc ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+EC_Counting_Supplier_Task::stop (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+ this->stop_flag_ = 1;
+}
+
+CORBA::ULong
+EC_Counting_Supplier_Task::push_count (void)
+{
+ return this->push_count_;
+}
+
+void
+EC_Counting_Supplier_Task::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->event_.length (1);
+
+ int stop = 0;
+ do {
+ this->supplier_->push (this->event_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Sleep for a short time to avoid spinning...
+ ACE_OS::sleep (0);
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ this->push_count_++;
+
+ stop = this->stop_flag_;
+ } while (stop == 0);
+}
diff --git a/TAO/orbsvcs/tests/Event/lib/Counting_Supplier.h b/TAO/orbsvcs/tests/Event/lib/Counting_Supplier.h
new file mode 100644
index 00000000000..8e6f940daa6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Counting_Supplier.h
@@ -0,0 +1,129 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Counting_Supplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_COUNTING_SUPPLIER_H
+#define EC_COUNTING_SUPPLIER_H
+
+#include "ectest_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Channel_Clients_T.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Task.h"
+
+/**
+ * @class EC_Counting_Supplier
+ *
+ * @brief Simple supplier object
+ *
+ * This class is a supplier of events.
+ */
+class EC_Test_Export EC_Counting_Supplier : public POA_RtecEventComm::PushSupplier
+{
+public:
+ /// Constructor
+ EC_Counting_Supplier (void);
+
+ // = The RtecEventComm::PushSupplier methods
+
+ /**
+ * Connect as a consumer to receive a TIMEOUT every <period>
+ * milliseconds.
+ * The class pushes an event (in its supplier role) every time it
+ * receives the timeout.
+ */
+ void activate (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int period
+ ACE_ENV_ARG_DECL);
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Simple connect/disconnect methods..
+ void connect (RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ int published_source,
+ int published_type,
+ int event_source,
+ int event_type
+ ACE_ENV_ARG_DECL);
+ void connect (RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ const RtecEventChannelAdmin::SupplierQOS &qos
+ ACE_ENV_ARG_DECL);
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// The Consumer side methods.
+ void push (const RtecEventComm::EventSet& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// The skeleton methods.
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Count the number of events sent
+ CORBA::ULong event_count;
+
+ /// Count the number of disconnect_push_supplier calls
+ CORBA::ULong disconnect_count;
+
+private:
+ /// Adapter...
+ ACE_PushConsumer_Adapter<EC_Counting_Supplier> consumer_adapter_;
+
+ /// The adapter proxy...
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_;
+
+ /// Our proxy
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+
+ /// The event source
+ int event_source_;
+
+ /// The event type
+ int event_type_;
+};
+
+class EC_Test_Export EC_Counting_Supplier_Task : public ACE_Task_Base
+{
+public:
+ /// Create the task...
+ EC_Counting_Supplier_Task (EC_Counting_Supplier *supplier);
+
+ // = Check the ACE_Task_Base documentation.
+ int svc (void);
+
+ void stop (void);
+ CORBA::ULong push_count (void);
+
+ /// Run a single iteration of the test
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// The supplier we are turning into an active object
+ EC_Counting_Supplier *supplier_;
+
+ /// The event we push through the supplier
+ RtecEventComm::EventSet event_;
+
+ /// Set to 1 when the test must stop
+ int stop_flag_;
+
+ /// Count the number of push() calls
+ CORBA::ULong push_count_;
+
+ TAO_SYNCH_MUTEX lock_;
+};
+
+#endif /* ECT_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Event/lib/Driver.cpp b/TAO/orbsvcs/tests/Event/lib/Driver.cpp
new file mode 100644
index 00000000000..d74d6f76b84
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Driver.cpp
@@ -0,0 +1,1027 @@
+// $Id$
+
+#include "Driver.h"
+#include "Consumer.h"
+#include "Supplier.h"
+
+#include "orbsvcs/Event_Service_Constants.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "orbsvcs/Event/EC_Default_Factory.h"
+#include "orbsvcs/Event/EC_Event_Channel.h"
+
+#include "tao/ORB_Constants.h"
+
+#include "ace/Sched_Params.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Stats.h"
+#include "ace/OS_NS_errno.h"
+#include "ace/OS_NS_unistd.h"
+
+#if !defined(EC_DISABLE_OLD_EC)
+#include "EC_Scheduler_Info.h"
+#endif
+
+#if !defined (__ACE_INLINE__)
+#include "Driver.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(EC_Tests, EC_Driver, "$Id$")
+
+EC_Driver::EC_Driver (void)
+ : n_consumers_ (1),
+ consumers_ (0),
+ n_suppliers_ (1),
+ suppliers_ (0),
+ tasks_ (0),
+ burst_count_ (100),
+ burst_size_ (100),
+ payload_size_ (0),
+ burst_pause_ (10000),
+ consumer_type_start_ (ACE_ES_EVENT_UNDEFINED),
+ consumer_type_count_ (1),
+ consumer_type_shift_ (2),
+ supplier_type_start_ (ACE_ES_EVENT_UNDEFINED),
+ supplier_type_count_ (1),
+ supplier_type_shift_ (2),
+ pid_file_name_ (0),
+ verbose_ (0),
+ thr_create_flags_ (THR_NEW_LWP|THR_BOUND|THR_SCHED_FIFO),
+ use_remote_ec_ (0),
+ event_service_name_ ("EventService"),
+ ec_impl_ (0)
+{
+ TAO_EC_Default_Factory::init_svcs ();
+}
+
+EC_Driver::~EC_Driver (void)
+{
+}
+
+int
+EC_Driver::run (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Calibrate the high resolution timer *before* starting the
+ // test.
+ ACE_High_Res_Timer::calibrate ();
+
+ this->run_init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->execute_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->dump_results ();
+
+ this->run_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "EC_Driver::run");
+ }
+ ACE_CATCHALL
+ {
+ ACE_ERROR ((LM_ERROR, "EC_Driver (%P|%t) non-corba exception raised\n"));
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+EC_Driver::run_init (int &argc, char* argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->initialize_orb_and_poa (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->parse_args (argc, argv))
+ ACE_THROW (CORBA::INTERNAL (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ if (this->verbose ())
+ this->print_args ();
+
+ if (this->pid_file_name_ != 0)
+ {
+ FILE* pid = ACE_OS::fopen (this->pid_file_name_, "w");
+ if (pid != 0)
+ {
+ ACE_OS::fprintf (pid, "%ld\n",
+ static_cast<long> (ACE_OS::getpid ()));
+ ACE_OS::fclose (pid);
+ }
+ }
+
+ if (this->move_to_rt_class () == -1)
+ ACE_THROW (CORBA::INTERNAL (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ this->initialize_ec_impl (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->allocate_consumers () == -1)
+ ACE_THROW (CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ if (this->allocate_suppliers () == -1)
+ ACE_THROW (CORBA::NO_MEMORY (TAO::VMCID,
+ CORBA::COMPLETED_NO));
+
+ this->connect_clients (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Driver::run_cleanup (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->disconnect_clients (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->shutdown_clients (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) channel destroyed\n"));
+
+ this->deactivate_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) channel deactivated\n"));
+
+ this->cleanup_tasks ();
+ this->cleanup_suppliers ();
+ this->cleanup_consumers ();
+ this->cleanup_ec ();
+
+ this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->root_poa_ = PortableServer::POA::_nil ();
+
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->orb_ = CORBA::ORB::_nil ();
+}
+
+void
+EC_Driver::initialize_orb_and_poa (int &argc, char* argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Driver (%P|%t) Unable to initialize the POA.\n"));
+ return;
+ }
+
+ this->root_poa_ =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Driver::print_args (void) const
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Execution parameters:\n"
+ " consumers = <%d>\n"
+ " suppliers = <%d>\n"
+ " burst count = <%d>\n"
+ " burst size = <%d>\n"
+ " event size = <%d>\n"
+ " burst pause = <%d>\n"
+ " consumer type start = <%d>\n"
+ " consumer type count = <%d>\n"
+ " consumer type shift = <%d>\n"
+ " supplier type start = <%d>\n"
+ " supplier type count = <%d>\n"
+ " supplier type shift = <%d>\n"
+ " pid file name = <%s>\n",
+
+ this->n_consumers_,
+ this->n_suppliers_,
+ this->burst_count_,
+ this->burst_size_,
+ this->payload_size_,
+ this->burst_pause_,
+
+ this->consumer_type_start_,
+ this->consumer_type_count_,
+ this->consumer_type_shift_,
+ this->supplier_type_start_,
+ this->supplier_type_count_,
+ this->supplier_type_shift_,
+
+ this->pid_file_name_?this->pid_file_name_:"nil"
+ ) );
+}
+
+int
+EC_Driver::move_to_rt_class (void)
+{
+ int priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+ priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO,
+ priority);
+ // Enable FIFO scheduling, e.g., RT scheduling class on Solaris.
+
+ if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO,
+ priority,
+ ACE_SCOPE_PROCESS)) != 0)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Driver (%P|%t): user is not superuser, "
+ "so remain in time-sharing class\n"));
+ this->thr_create_flags_ = THR_NEW_LWP;
+ }
+ else
+ ACE_ERROR ((LM_ERROR,
+ "EC_Driver (%P|%t): sched_params failed\n"));
+ }
+
+ if (ACE_OS::thr_setprio (priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "EC_Driver (%P|%t) main thr_setprio failed,"
+ "no real-time features\n"));
+ }
+ return 0;
+}
+
+void
+EC_Driver::initialize_ec_impl (ACE_ENV_SINGLE_ARG_DECL)
+{
+#if !defined(EC_DISABLE_REMOTE_EC)
+ if (this->use_remote_ec_ == 1)
+ {
+ this->obtain_remote_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ return;
+ }
+#endif
+
+ this->initialize_new_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+#if !defined(EC_DISABLE_REMOTE_EC)
+void
+EC_Driver::obtain_remote_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::NamingContext_var naming_context =
+ this->get_naming_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name channel_name (1);
+ channel_name.length (1);
+ channel_name[0].id = CORBA::string_dup (this->event_service_name_);
+
+ CORBA::Object_var tmp =
+ naming_context->resolve (channel_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_channel_ =
+ RtecEventChannelAdmin::EventChannel::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosNaming::NamingContext_ptr
+EC_Driver::get_naming_context (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNaming::NamingContext::_nil ());
+
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_ERROR ((LM_ERROR,
+ "EC_Driver (%P|%t) Unable to obtain the "
+ "Naming Service.\n"));
+
+ return CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+}
+#endif
+
+void
+EC_Driver::initialize_new_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_EC_Event_Channel_Attributes attr (this->root_poa_.in (),
+ this->root_poa_.in ());
+
+ this->modify_attributes (attr);
+
+ TAO_EC_Event_Channel *ec =
+ new TAO_EC_Event_Channel (attr);
+ this->ec_impl_ = ec;
+
+ ec->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->event_channel_ =
+ this->ec_impl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Driver::deactivate_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+#if !defined(EC_DISABLE_REMOTE_EC)
+ if (this->use_remote_ec_ == 1)
+ return;
+#endif
+
+ {
+ // Deactivate the EC
+ PortableServer::POA_var poa =
+ this->ec_impl_->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this->ec_impl_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) EC deactivated\n"));
+
+}
+
+void
+EC_Driver::destroy_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->event_channel_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+EC_Driver::allocate_consumers (void)
+{
+ ACE_NEW_RETURN (this->consumers_,
+ EC_Consumer*[this->n_consumers_],
+ -1);
+ for (int i = 0; i < this->n_consumers_; ++i)
+ this->consumers_[i] =
+ this->allocate_consumer (i);
+ return 0;
+}
+
+int
+EC_Driver::allocate_suppliers (void)
+{
+ ACE_NEW_RETURN (this->suppliers_,
+ EC_Supplier*[this->n_suppliers_],
+ -1);
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ this->suppliers_[i] =
+ this->allocate_supplier (i);
+ return 0;
+}
+
+EC_Consumer*
+EC_Driver::allocate_consumer (int i)
+{
+ return new EC_Consumer (this,
+ this->consumers_ + i);
+}
+
+EC_Supplier*
+EC_Driver::allocate_supplier (int i)
+{
+ return new EC_Supplier (this,
+ this->suppliers_ + i);
+}
+
+void
+EC_Driver::connect_clients (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->connect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Driver::disconnect_clients (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->disconnect_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->disconnect_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Driver::shutdown_clients (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->shutdown_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->shutdown_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Driver::connect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ this->event_channel_->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ this->connect_consumer (consumer_admin.in (), i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) connected consumer(s)\n"));
+}
+
+void
+EC_Driver::connect_consumer (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int i
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::ConsumerQOS qos;
+ int shutdown_event_type;
+ this->build_consumer_qos (i, qos, shutdown_event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumers_[i]->connect (consumer_admin,
+ qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+EC_Driver::build_consumer_qos (
+ int i,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ RtecBase::handle_t rt_info = 0;
+
+ int type_start =
+ this->consumer_type_start_
+ + i * this->consumer_type_shift_;
+
+ shutdown_event_type = type_start + this->consumer_type_count_;
+
+ ACE_ConsumerQOS_Factory qos_factory;
+ qos_factory.start_disjunction_group (1 + this->consumer_type_count_);
+ qos_factory.insert_type (shutdown_event_type, rt_info);
+
+ for (int j = 0; j != this->consumer_type_count_; ++j)
+ qos_factory.insert_type (type_start + j, rt_info);
+
+ qos = qos_factory.get_ConsumerQOS ();
+}
+
+void
+EC_Driver::connect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ this->event_channel_->for_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->connect_supplier (supplier_admin.in (), i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) connected supplier(s)\n"));
+}
+
+void
+EC_Driver::connect_supplier (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ int i
+ ACE_ENV_ARG_DECL)
+{
+ RtecEventChannelAdmin::SupplierQOS qos;
+ int shutdown_event_type;
+ this->build_supplier_qos (i, qos, shutdown_event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->suppliers_[i]->connect (supplier_admin,
+ qos,
+ shutdown_event_type
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+EC_Driver::build_supplier_qos (
+ int i,
+ RtecEventChannelAdmin::SupplierQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int type_start = this->supplier_type_start_ + i*this->supplier_type_shift_;
+ int supplier_id = i + 1;
+ shutdown_event_type = type_start + this->supplier_type_count_;
+
+ RtecBase::handle_t rt_info = 0;
+
+ ACE_SupplierQOS_Factory qos_factory;
+ for (int j = 0; j != this->supplier_type_count_; ++j)
+ qos_factory.insert (supplier_id,
+ type_start + j,
+ rt_info, 1);
+
+ qos_factory.insert (supplier_id,
+ shutdown_event_type,
+ rt_info, 1);
+
+ qos = qos_factory.get_SupplierQOS ();
+}
+
+void
+EC_Driver::execute_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->allocate_tasks () == -1)
+ return;
+
+ this->activate_tasks (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) suppliers are active\n"));
+
+ // Wait for the supplier threads...
+ if (ACE_Thread_Manager::instance ()->wait () == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "EC_Driver (%P|%t) Thread_Manager wait failed\n"));
+ }
+
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) suppliers finished\n"));
+}
+
+int
+EC_Driver::allocate_tasks (void)
+{
+ if (this->tasks_ != 0)
+ return 0;
+
+ ACE_NEW_RETURN (this->tasks_,
+ ACE_Task_Base*[this->n_suppliers_],
+ -1);
+
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ this->tasks_[i] =
+ this->allocate_task (i);
+ return 0;
+}
+
+ACE_Task_Base*
+EC_Driver::allocate_task (int i)
+{
+ int start = this->supplier_type_start_ + i*this->supplier_type_shift_;
+ return new EC_Supplier_Task (this->suppliers_[i],
+ this,
+ this->suppliers_ + i,
+ this->burst_count_,
+ this->burst_size_,
+ this->burst_pause_,
+ this->payload_size_,
+ start + this->supplier_type_count_);
+}
+
+void
+EC_Driver::activate_tasks (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ int priority =
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO)
+ + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2;
+
+ if (ACE_BIT_DISABLED (this->thr_create_flags_, THR_SCHED_FIFO))
+ {
+ priority =
+ ACE_Sched_Params::priority_min (ACE_SCHED_OTHER);
+ }
+
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ if (this->tasks_[i]->activate (this->thr_create_flags_,
+ 1, 0, priority) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "EC_Driver (%P|%t) Cannot activate thread "
+ "for supplier %d\n%p\n",
+ i, "EC_Driver - OS error is:"));
+ }
+ }
+}
+
+void
+EC_Driver::disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->suppliers_ == 0)
+ return;
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) suppliers disconnected\n"));
+}
+
+void
+EC_Driver::disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->consumers_ == 0)
+ return;
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ this->consumers_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) consumers disconnected\n"));
+}
+
+void
+EC_Driver::shutdown_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->suppliers_ == 0)
+ return;
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ this->suppliers_[i]->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) suppliers deactivated\n"));
+}
+
+void
+EC_Driver::shutdown_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->consumers_ == 0)
+ return;
+ for (int i = 0; i < this->n_consumers_; ++i)
+ {
+ this->consumers_[i]->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (this->verbose ())
+ ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) consumers deactivated\n"));
+}
+
+void
+EC_Driver::dump_results (void)
+{
+ ACE_Throughput_Stats throughput;
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ char buf[BUFSIZ];
+ for (int j = 0; j < this->n_consumers_; ++j)
+ {
+ ACE_OS::sprintf (buf, "Consumer [%02d]", j);
+
+ this->consumers_[j]->dump_results (buf, gsf);
+ this->consumers_[j]->accumulate (throughput);
+ }
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+
+ ACE_Throughput_Stats suppliers;
+ for (int i = 0; i < this->n_suppliers_; ++i)
+ {
+ ACE_OS::sprintf (buf, "Supplier [%02d]", i);
+
+ this->suppliers_[i]->dump_results (buf, gsf);
+ this->suppliers_[i]->accumulate (suppliers);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\nTotals:\n"));
+ throughput.dump_results ("EC_Consumer/totals", gsf);
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ suppliers.dump_results ("EC_Supplier/totals", gsf);
+}
+
+int
+EC_Driver::parse_args (int &argc, char *argv [])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (arg, "-verbose") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->verbose_ = 1;
+ }
+
+ else if (ACE_OS::strcmp (arg, "-remote") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->use_remote_ec_ = 1;
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->event_service_name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-suppliers") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->n_suppliers_ = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-consumers") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->n_consumers_ = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-burstcount") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->burst_count_ = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-burstsize") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->burst_size_ = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-payloadsize") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->payload_size_ = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-burstpause") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->burst_pause_ = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-consumer_tstart") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->consumer_type_start_ =
+ ACE_ES_EVENT_UNDEFINED
+ + ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-consumer_tcount") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->consumer_type_count_ =
+ ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-consumer_tshift") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->consumer_type_shift_ =
+ ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-supplier_tstart") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->supplier_type_start_ =
+ ACE_ES_EVENT_UNDEFINED
+ + ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-supplier_tcount") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->supplier_type_count_ =
+ ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else if (ACE_OS::strcmp (arg, "-supplier_tshift") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ this->supplier_type_shift_ =
+ ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
+
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+
+ }
+ return 0;
+}
+
+void
+EC_Driver::print_usage (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Driver Usage:\n"
+ " -verbose\n"
+ " -remote <ec_name>\n"
+ " -old_reactive\n"
+ " -old_threaded\n"
+ " -suppliers <nsuppliers>\n"
+ " -consumers <nsuppliers>\n"
+ " -burstcount <bursts>\n"
+ " -burstsize <size>\n"
+ " -payloadsize <size>\n"
+ " -burstpause <usecs>\n"
+ " -consumer_tstart <type>\n"
+ " -consumer_tcount <count>\n"
+ " -consumer_tshift <shift>\n"
+ " -supplier_tstart <type>\n"
+ " -supplier_tcount <count>\n"
+ " -supplier_tshift <shift>\n"
+ ));
+}
+
+void
+EC_Driver::modify_attributes (TAO_EC_Event_Channel_Attributes& attr)
+{
+ ACE_UNUSED_ARG(attr);
+
+ // This method can be overruled by derived tests to set the event channel
+ // attributes
+}
+
+void
+EC_Driver::cleanup_tasks (void)
+{
+ if (this->tasks_ != 0)
+ {
+ for (int i = 0; i != this->n_suppliers_; ++i)
+ {
+ delete this->tasks_[i];
+ this->tasks_[i] = 0;
+ }
+ delete[] this->tasks_;
+ this->tasks_ = 0;
+ }
+}
+
+void
+EC_Driver::cleanup_suppliers (void)
+{
+ if (this->suppliers_ != 0)
+ {
+ for (int i = 0; i != this->n_suppliers_; ++i)
+ {
+ delete this->suppliers_[i];
+ this->suppliers_[i] = 0;
+ }
+ delete[] this->suppliers_;
+ this->suppliers_ = 0;
+ }
+}
+
+void
+EC_Driver::cleanup_consumers (void)
+{
+ if (this->consumers_ != 0)
+ {
+ for (int i = 0; i != this->n_consumers_; ++i)
+ {
+ delete this->consumers_[i];
+ this->consumers_[i] = 0;
+ }
+ delete[] this->consumers_;
+ this->consumers_ = 0;
+ }
+}
+
+void
+EC_Driver::cleanup_ec (void)
+{
+ delete this->ec_impl_;
+#if !defined(EC_DISABLE_OLD_EC)
+ delete this->module_factory_;
+#endif
+}
+
+int
+EC_Driver::decode_consumer_cookie (void* cookie) const
+{
+ return static_cast<EC_Consumer**> (cookie) - this->consumers_;
+}
+
+int
+EC_Driver::decode_supplier_cookie (void* cookie) const
+{
+ return static_cast<EC_Supplier**> (cookie) - this->suppliers_;
+}
+
+void
+EC_Driver::consumer_push (void*,
+ const RtecEventComm::EventSet&
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+EC_Driver::consumer_shutdown (void*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+EC_Driver::consumer_disconnect (void*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
+
+void
+EC_Driver::supplier_disconnect (void*
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+}
diff --git a/TAO/orbsvcs/tests/Event/lib/Driver.h b/TAO/orbsvcs/tests/Event/lib/Driver.h
new file mode 100644
index 00000000000..31ac5df863e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Driver.h
@@ -0,0 +1,329 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Driver.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_DRIVER_H
+#define EC_DRIVER_H
+
+#include "ectest_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecEventChannelAdminS.h"
+
+#include "ace/Stats.h"
+#include "ace/Task.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+class TAO_EC_Event_Channel_Attributes;
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+class TAO_Module_Factory;
+class EC_Consumer;
+class EC_Supplier;
+
+#define EC_DISABLE_REMOTE_EC
+#define EC_DISABLE_OLD_EC
+
+#if !defined(EC_DISABLE_REMOTE_EC)
+#include "orbsvcs/CosNamingC.h"
+#endif
+
+/**
+ * @class EC_Driver
+ *
+ * @brief Defines the interface of a test driver
+ *
+ * Abstract base class for the test driver, this let us implement a
+ * collocated and a non-collocated test, and to write generic
+ * consumers and suppliers that can call back the driver.
+ */
+class EC_Test_Export EC_Driver
+{
+public:
+ /// Constructor
+ EC_Driver (void);
+
+ /// Destructor
+ virtual ~EC_Driver (void);
+
+ /// Flag to indicate in the test should be verbose.
+ int verbose (void) const;
+
+ /// Execute the test.
+ virtual int run (int argc, char* argv[]);
+
+ /// The initialization section
+ virtual void run_init (int& argc, char* argv[]
+ ACE_ENV_ARG_DECL);
+
+ /// The cleanup section
+ virtual void run_cleanup (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Initialize the ORB and obtain the RootPOA object
+ virtual void initialize_orb_and_poa (int& argc, char* argv[]
+ ACE_ENV_ARG_DECL);
+
+ /// Parse the common command-line arguments for all tests
+ virtual int parse_args (int& argc, char* argv[]);
+
+ /// Print the usage method
+ virtual void print_usage (void);
+
+ /// Print out the arguments
+ virtual void print_args (void) const;
+
+ /// Run the test in the real-time class, return -1 on error.
+ virtual int move_to_rt_class (void);
+
+ /// Construct the EC and its helper objects, also activates the EC in
+ /// the RootPOA.
+ virtual void initialize_ec_impl (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// By default connect the consumers and then the suppliers, other
+ /// orders should work too.
+ virtual void connect_clients (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// By default disconnect the suppliers and then the consumers, other
+ /// orders should work too.
+ virtual void disconnect_clients (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// By default deactivate the suppliers and then the consumers, other
+ /// orders should work too.
+ virtual void shutdown_clients (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Connect all the consumers, by default it lets each consumer
+ /// connect itself.
+ virtual void connect_consumers (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Connect consumer number <i> using the consumer_admin provided.
+ virtual void connect_consumer (
+ RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ int i
+ ACE_ENV_ARG_DECL);
+
+ /// Build the QoS requirements for consumer <i>
+ virtual void build_consumer_qos (
+ int i,
+ RtecEventChannelAdmin::ConsumerQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Connect all the suppliers, by default it lets each supplier
+ /// connect itself.
+ virtual void connect_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Connect supplier number <i> using the supplier_admin provided.
+ virtual void connect_supplier (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ int i
+ ACE_ENV_ARG_DECL);
+
+ /// Build the QoS requirements for supplier <i>
+ virtual void build_supplier_qos (
+ int i,
+ RtecEventChannelAdmin::SupplierQOS& qos,
+ int& shutdown_event_type
+ ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Execute the test, by default simply call activate_suppliers()
+ virtual void execute_test (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Dump the results, i.e. invoke dump_results on all the suppliers
+ * and consumers, collect the latency and throughput results for
+ * each and print the totals too.
+ */
+ virtual void dump_results (void);
+
+ /// Disconnect all the consumers.
+ virtual void disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect all the suppliers.
+ virtual void disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Deactivate all the consumers.
+ virtual void shutdown_consumers (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Deactivate all the suppliers.
+ virtual void shutdown_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Call EC->destroy
+ virtual void destroy_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// De-activate the EC (and its helper classes).
+ virtual void deactivate_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Cleanup the resources
+ virtual void cleanup_ec (void);
+ virtual void cleanup_tasks (void);
+ virtual void cleanup_consumers (void);
+ virtual void cleanup_suppliers (void);
+
+ /// Allow modifications of the default EC attributes
+ virtual void modify_attributes (TAO_EC_Event_Channel_Attributes& attr);
+
+ /// Returns the index of the consumer for @a cookie
+ virtual int decode_consumer_cookie (void* cookie) const;
+
+ /// Returns the index of the supplier for @a cookie
+ virtual int decode_supplier_cookie (void* cookie) const;
+
+ /// One of the consumers in the test has received an event
+ virtual void consumer_push (void* consumer_cookie,
+ const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL);
+
+ /// One of the consumers has received a shutdown event
+ virtual void consumer_shutdown (void* consumer_cookie
+ ACE_ENV_ARG_DECL);
+
+ /// One of the consumers in the test has been disconnected from the EC
+ virtual void consumer_disconnect (void* consumer_cookie
+ ACE_ENV_ARG_DECL);
+
+ /// One of the suppliers in the test has been disconnected from the EC
+ virtual void supplier_disconnect (void* supplier_cookie
+ ACE_ENV_ARG_DECL);
+
+#if !defined(EC_DISABLE_REMOTE_EC)
+ /// Obtain the EC from the Naming service
+ virtual void obtain_remote_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual CosNaming::NamingContext_ptr
+ get_naming_context (ACE_ENV_SINGLE_ARG_DECL);
+#endif
+
+ /// Initialize the EC using the new implementation
+ virtual void initialize_new_ec (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Allocate the suppliers and the consumers
+ virtual int allocate_consumers (void);
+ virtual int allocate_suppliers (void);
+
+ /// Allocate one consumer or supplier
+ virtual EC_Consumer* allocate_consumer (int i);
+ virtual EC_Supplier* allocate_supplier (int i);
+
+ /// Allocate one task for supplier number <i>
+ virtual int allocate_tasks (void);
+ virtual ACE_Task_Base* allocate_task (int i);
+
+ /// Activate all the tasks, by default runs each supplier on its
+ /// own thread.
+ virtual void activate_tasks (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// The Root POA
+ PortableServer::POA_var root_poa_;
+
+ /// The number of consumers
+ int n_consumers_;
+
+ /// The consumers
+ EC_Consumer** consumers_;
+
+ /// The number of suppliers
+ int n_suppliers_;
+
+ /// The suppliers
+ EC_Supplier** suppliers_;
+
+ /// The tasks for each supplier
+ ACE_Task_Base** tasks_;
+
+ /// How many bursts we will send from each supplier.
+ int burst_count_;
+
+ /// The number of events
+ int burst_size_;
+
+ /// The size of the payload on each event.
+ int payload_size_;
+
+ /// The time between each event burst, in microseconds.
+ int burst_pause_;
+
+ /**
+ * The consumers subscribe to different sets of events, as follows:
+ *
+ * Consumer0: [start , start + count)
+ * Consumer1: [start + 1*shift, start + 1*shift + count)
+ * Consumer2: [start + 2*shift, start + 2*shift + count)
+ * .....
+ * ....
+ * .
+ * Some sub-tests may choose other configurations, but this is good
+ * for many cases.
+ */
+ int consumer_type_start_;
+ int consumer_type_count_;
+ int consumer_type_shift_;
+
+ /**
+ * The suppliers generate different sets of events, as follows:
+ *
+ * Supplier0: [start , start + count)
+ * Supplier1: [start + 1*shift, start + 1*shift + count)
+ * Supplier2: [start + 2*shift, start + 2*shift + count)
+ * .....
+ * ....
+ * .
+ * Some sub-tests may choose other configurations, but this is good
+ * for many cases.
+ */
+ int supplier_type_start_;
+ int supplier_type_count_;
+ int supplier_type_shift_;
+
+ /// The name of a file where the process stores its pid
+ const char* pid_file_name_;
+
+ /// Verbosity flag
+ int verbose_;
+
+ /**
+ * The flags used to create threads, by default we attempt:
+ *
+ * THR_SCHED_FIFO|THR_BOUND|THR_NEW_LWP
+ *
+ * but if we don't have enough privileges we fall back to
+ *
+ * THR_NEW_LWP
+ *
+ */
+ int thr_create_flags_;
+
+ /// Use a remote event channel. If this flag is enabled it
+ /// superseedes any options for the event channel implementation.
+ int use_remote_ec_;
+
+ /// The name of the remote event service
+ const char* event_service_name_;
+
+ /// The event channel implementation
+ POA_RtecEventChannelAdmin::EventChannel *ec_impl_;
+
+ /// The event channel object reference
+ RtecEventChannelAdmin::EventChannel_var event_channel_;
+
+};
+
+#if defined (__ACE_INLINE__)
+#include "Driver.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* ECT_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Event/lib/Driver.i b/TAO/orbsvcs/tests/Event/lib/Driver.i
new file mode 100644
index 00000000000..f346e7757c1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Driver.i
@@ -0,0 +1,7 @@
+// $Id$
+
+ACE_INLINE int
+EC_Driver::verbose (void) const
+{
+ return this->verbose_;
+}
diff --git a/TAO/orbsvcs/tests/Event/lib/Event_lib.mpc b/TAO/orbsvcs/tests/Event/lib/Event_lib.mpc
new file mode 100644
index 00000000000..1e3ca37f7fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Event_lib.mpc
@@ -0,0 +1,10 @@
+// -*- MPC -*-
+// $Id$
+
+project(Event_Test_Lib): rtevent_serv, naming {
+ sharedname = ECTests
+ dynamicflags = EC_TEST_BUILD_DLL
+ Header_Files {
+ ectest_export.h
+ }
+}
diff --git a/TAO/orbsvcs/tests/Event/lib/Makefile.am b/TAO/orbsvcs/tests/Event/lib/Makefile.am
new file mode 100644
index 00000000000..af04cdea2c4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Makefile.am
@@ -0,0 +1,58 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Event_Test_Lib.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+
+noinst_LTLIBRARIES = libECTests.la
+
+libECTests_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DEC_TEST_BUILD_DLL
+
+libECTests_la_SOURCES = \
+ Consumer.cpp \
+ Counting_Consumer.cpp \
+ Counting_Supplier.cpp \
+ Driver.cpp \
+ Supplier.cpp
+
+noinst_HEADERS = \
+ Consumer.h \
+ Counting_Consumer.h \
+ Counting_Supplier.h \
+ Driver.h \
+ Driver.i \
+ Supplier.h \
+ ectest_export.h
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Event/lib/README b/TAO/orbsvcs/tests/Event/lib/README
new file mode 100644
index 00000000000..ead5bcaaacc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/README
@@ -0,0 +1,5 @@
+# $Id$
+
+This directory contains a small framework to write tests for the
+real-time event service. Check the Basic or Performance directories
+for examples of its use.
diff --git a/TAO/orbsvcs/tests/Event/lib/Supplier.cpp b/TAO/orbsvcs/tests/Event/lib/Supplier.cpp
new file mode 100644
index 00000000000..566a09d3c97
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Supplier.cpp
@@ -0,0 +1,298 @@
+// $Id$
+
+#include "Supplier.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "orbsvcs/Event_Utilities.h"
+
+#include "tao/debug.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (EC_Tests,
+ EC_Supplier,
+ "$Id$")
+
+EC_Supplier::EC_Supplier (EC_Driver *driver,
+ void* cookie)
+ : driver_ (driver),
+ cookie_ (cookie),
+ push_count_ (0),
+ burst_count_ (0),
+ burst_size_ (0),
+ payload_size_ (0),
+ burst_pause_ (0),
+ shutdown_event_type_ (0),
+ is_active_ (0)
+{
+}
+
+void
+EC_Supplier::send_event (int event_number
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ // Create the event...
+
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+
+ event[0].header.ttl = 1;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time, t);
+
+ // We use replace to minimize the copies, this should result
+ // in just one memory allocation:
+ event[0].data.payload.length (this->payload_size_);
+
+ this->event_type (event_number, event[0]);
+
+ this->send_event (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+EC_Supplier::send_event (const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->push_count_ == 0)
+ this->throughput_start_ = ACE_OS::gethrtime ();
+
+ this->push_count_ += event.length ();
+
+ if (TAO_debug_level > 0
+ && this->push_count_ % 100 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "EC_Consumer (%P|%t): %d events received\n",
+ this->push_count_));
+ }
+
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ this->consumer_proxy_->push (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t end = ACE_OS::gethrtime ();
+ this->throughput_.sample (end - this->throughput_start_,
+ end - start);
+}
+
+void
+EC_Supplier::event_type (int event_number,
+ RtecEventComm::Event &event)
+{
+ CORBA::ULong l = this->qos_.publications.length ();
+
+ if (l == 0)
+ {
+ event.header.source = 0;
+ event.header.type = this->shutdown_event_type_;
+ }
+ else
+ {
+ int i = event_number % l;
+ int type = this->qos_.publications[i].event.header.type;
+ if (type == this->shutdown_event_type_)
+ i = 0;
+
+ RtecEventComm::EventHeader& header =
+ this->qos_.publications[i].event.header;
+
+ event.header.source = header.source;
+ event.header.type = header.type;
+ }
+}
+
+void
+EC_Supplier::connect (RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ this->consumer_proxy_ =
+ supplier_admin->obtain_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect (qos, shutdown_event_type ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Supplier::connect (const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return; // @@ Throw?
+
+ this->qos_ = qos;
+ this->shutdown_event_type_ = shutdown_event_type;
+
+ if (CORBA::is_nil (this->myself_.in ()))
+ {
+ this->myself_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ this->is_active_ = 1;
+
+ this->consumer_proxy_->connect_push_supplier (this->myself_.in (),
+ qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+EC_Supplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (CORBA::is_nil (this->consumer_proxy_.in ()))
+ return;
+
+ this->consumer_proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+EC_Supplier::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (!this->is_active_)
+ return;
+
+ // Deactivate the servant
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ poa->deactivate_object (id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->is_active_ = 0;
+ this->myself_ = RtecEventComm::PushSupplier::_nil ();
+}
+
+void
+EC_Supplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->driver_->supplier_disconnect (this->cookie_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->consumer_proxy_ =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+}
+
+void
+EC_Supplier::dump_results (const char* name,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (name, gsf);
+}
+
+void
+EC_Supplier::accumulate (ACE_Throughput_Stats& stats) const
+{
+ stats.accumulate (this->throughput_);
+}
+
+// ****************************************************************
+
+EC_Supplier_Task::EC_Supplier_Task (EC_Supplier* supplier,
+ EC_Driver* driver,
+ void* cookie,
+ int burst_count,
+ int burst_size,
+ int burst_pause,
+ int payload_size,
+ int shutdown_event_type,
+ ACE_Thread_Manager* thr_mgr)
+ : ACE_Task_Base (thr_mgr),
+ supplier_ (supplier),
+ driver_ (driver),
+ cookie_ (cookie),
+ burst_count_ (burst_count),
+ burst_size_ (burst_size),
+ burst_pause_ (burst_pause),
+ payload_size_ (payload_size),
+ shutdown_event_type_ (shutdown_event_type)
+{
+}
+
+int
+EC_Supplier_Task::svc (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ // Initialize a time value to pace the test
+ ACE_Time_Value tv (0, this->burst_pause_);
+
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+
+ event[0].header.ttl = 1;
+
+ ACE_hrtime_t t = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time, t);
+
+ // We use replace to minimize the copies, this should result
+ // in just one memory allocation;
+ event[0].data.payload.length (this->payload_size_);
+
+ for (int i = 0; i < this->burst_count_; ++i)
+ {
+ for (int j = 0; j < this->burst_size_; ++j)
+ {
+ ACE_TRY
+ {
+ this->supplier_->event_type (j, event[0]);
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
+ now);
+ // ACE_DEBUG ((LM_DEBUG, "(%t) supplier push event\n"));
+
+ this->supplier_->send_event (event ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "SYS_EX");
+ }
+ ACE_ENDTRY;
+ }
+ ACE_OS::sleep (tv);
+ }
+
+ ACE_TRY_EX(SHUTDOWN)
+ {
+ // Send one event shutdown from each supplier
+ event[0].header.type = this->shutdown_event_type_;
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ ORBSVCS_Time::hrtime_to_TimeT (event[0].header.creation_time,
+ now);
+ this->supplier_->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SHUTDOWN);
+ }
+ ACE_CATCH (CORBA::SystemException, sys_ex)
+ {
+ ACE_PRINT_EXCEPTION (sys_ex, "SYS_EX");
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "SYS_EX");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Supplier task finished\n"));
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Event/lib/Supplier.h b/TAO/orbsvcs/tests/Event/lib/Supplier.h
new file mode 100644
index 00000000000..065a20a15aa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/Supplier.h
@@ -0,0 +1,193 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Supplier.h
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan (coryan@cs.wustl.edu)
+ */
+//=============================================================================
+
+
+#ifndef EC_SUPPLIER_H
+#define EC_SUPPLIER_H
+
+#include "Driver.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Task.h"
+#include "ace/OS_NS_time.h"
+
+/**
+ * @class EC_Supplier
+ *
+ * @brief Simple supplier object to implement EC tests.
+ *
+ * This class is a supplier of events.
+ * The class is just a helper to simplify common tasks in EC
+ * tests, such as subscribing for a range of events, disconnecting
+ * from the EC, informing the driver of shutdown messages, etc.
+ * There are several ways to connect and disconnect this class,
+ * and it is up to the driver program to use the right one.
+ * The driver can request that to this class to send a new event,
+ * a new shutdown event or to become "active" and send a number of
+ * events at a certain rate.
+ */
+class EC_Test_Export EC_Supplier : public POA_RtecEventComm::PushSupplier
+{
+public:
+ /**
+ * Constructor, specifies the types of events to send.
+ * Notice that the user can connect to the EC using other
+ * publications, this is useful for filtering tests.
+ */
+ EC_Supplier (EC_Driver *driver,
+ void* supplier_cookie);
+
+ /// The types of the event is chosen by the driver, based on the
+ /// cookie and the <event_number>
+ void send_event (int event_number
+ ACE_ENV_ARG_DECL);
+
+ /// Send <event> to the EC.
+ void send_event (const RtecEventComm::EventSet& event
+ ACE_ENV_ARG_DECL);
+
+ /// Set the event type and source in <event>
+ void send_event (int event_number,
+ const RtecEventComm::Event& event);
+
+ /// Send a shutdown event.
+ void send_shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Connect using a <supplier_admin> and publications (<qos>)
+ /// computed by the user
+ virtual void connect (
+ RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+
+ /// Connect using the current consumer_proxy (useful for reconnect test)
+ virtual void connect (
+ const RtecEventChannelAdmin::SupplierQOS& qos,
+ int shutdown_event_type
+ ACE_ENV_ARG_DECL);
+
+ /// Disconnect from the EC, also deactivates the object
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Disconnect from the EC, also deactivates the object
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Dump the results...
+ virtual void dump_results (const char* name,
+ ACE_UINT32 global_scale_factor);
+
+ /// Add our statistics to <stats>
+ void accumulate (ACE_Throughput_Stats& stats) const;
+
+ /// Return an event type to push....
+ void event_type (int event_number,
+ RtecEventComm::Event& event);
+
+ // = The PushSupplier methods
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Class we forward to.
+ EC_Driver *driver_;
+
+ /// Magic cookie provided by the supplier to identify ourselves
+ void* cookie_;
+
+ /// Protect the internal state
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Count the number of push() calls
+ int push_count_;
+
+ /// We talk to the EC (as a supplier) using this proxy.
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
+
+ /// The time for the first event sent
+ ACE_hrtime_t throughput_start_;
+
+ /// Measure the elapsed time spent while sending the events.
+ ACE_Throughput_Stats throughput_;
+
+ int burst_count_;
+ int burst_size_;
+ int payload_size_;
+ int burst_pause_;
+
+ /// The test data.
+ int shutdown_event_type_;
+
+ /// The publications, used to select the events.
+ RtecEventChannelAdmin::SupplierQOS qos_;
+
+ /// Is the supplier active in the POA?
+ int is_active_;
+
+ /// Cache the object reference to speed up connect/disconnect calls
+ RtecEventComm::PushSupplier_var myself_;
+};
+
+// ****************************************************************
+
+/**
+ * @class EC_Supplier_Task
+ */
+class EC_Supplier_Task : public ACE_Task_Base
+{
+public:
+ /// Constructor
+ EC_Supplier_Task (EC_Supplier* supplier,
+ EC_Driver* driver,
+ void* cookie,
+ int burst_count,
+ int burst_size,
+ int burst_pause,
+ int payload_size,
+ int shutdown_event_type,
+ ACE_Thread_Manager* thr_mgr = 0);
+
+ /// The svc call
+ virtual int svc (void);
+
+private:
+ /// The supplier
+ EC_Supplier* supplier_;
+
+ /// The driver program
+ EC_Driver* driver_;
+
+ /// The magic cookie assigned to the supplier
+ void* cookie_;
+
+ /// Number of events "bursts"
+ int burst_count_;
+
+ /// The number of events in a "burst", i.e. between two calls to
+ /// sleep.
+ int burst_size_;
+
+ /// The sleep time (in usecs) between each burst
+ int burst_pause_;
+
+ /// The size of the payload in each event.
+ int payload_size_;
+
+ /// Define the shutdown event, invoked at the end of the loop.
+ int shutdown_event_type_;
+};
+
+#endif /* EC_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Event/lib/ectest_export.h b/TAO/orbsvcs/tests/Event/lib/ectest_export.h
new file mode 100644
index 00000000000..a6e9712d496
--- /dev/null
+++ b/TAO/orbsvcs/tests/Event/lib/ectest_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef EC_TEST_EXPORT_H
+#define EC_TEST_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (EC_TEST_HAS_DLL)
+# define EC_TEST_HAS_DLL 0
+# endif /* ! EC_TEST_HAS_DLL */
+#else
+# if !defined (EC_TEST_HAS_DLL)
+# define EC_TEST_HAS_DLL 1
+# endif /* ! EC_TEST_HAS_DLL */
+#endif
+
+#if defined (EC_TEST_HAS_DLL) && (EC_TEST_HAS_DLL == 1)
+# if defined (EC_TEST_BUILD_DLL)
+# define EC_Test_Export ACE_Proper_Export_Flag
+# define EC_TEST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define EC_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* EC_TEST_BUILD_DLL */
+# define EC_Test_Export ACE_Proper_Import_Flag
+# define EC_TEST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define EC_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* EC_TEST_BUILD_DLL */
+#else /* EC_TEST_HAS_DLL == 1 */
+# define EC_Test_Export
+# define EC_TEST_SINGLETON_DECLARATION(T)
+# define EC_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* EC_TEST_HAS_DLL == 1 */
+
+#endif /* EC_TEST_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/FT_App/FTAPP_Analyzer_Main.cpp b/TAO/orbsvcs/tests/FT_App/FTAPP_Analyzer_Main.cpp
new file mode 100644
index 00000000000..253e373e20b
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FTAPP_Analyzer_Main.cpp
@@ -0,0 +1,22 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FTAPP_Analyzer_Main.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file provides the main routine for a stub FaultAnalyzer
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "tao/Utils/Server_Main.h"
+#include "StubFaultAnalyzer.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<StubFaultAnalyzer> server_run("FaultAnalyzer");
+ return server_run.run(argc, argv);
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FTAPP_FactoryRegistry_Main.cpp b/TAO/orbsvcs/tests/FT_App/FTAPP_FactoryRegistry_Main.cpp
new file mode 100644
index 00000000000..131b6daa877
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FTAPP_FactoryRegistry_Main.cpp
@@ -0,0 +1,22 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FTAPP_FactoryRegistry_Main.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file provides the main routine for a stub FactoryRegistry
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "tao/Utils/Server_Main.h"
+#include "orbsvcs/PortableGroup/PG_FactoryRegistry.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<TAO::PG_FactoryRegistry> server_main("FactoryRegistry");
+ return server_main.run(argc, argv);
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FTAPP_FaultConsumer_Main.cpp b/TAO/orbsvcs/tests/FT_App/FTAPP_FaultConsumer_Main.cpp
new file mode 100644
index 00000000000..f5e732d47ab
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FTAPP_FaultConsumer_Main.cpp
@@ -0,0 +1,23 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FTAPP_FaultConsumer_Main.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file provides the main routine for a stub FaultConsumer.
+ *
+ * @author Steve Totten <totten_s@ociweb.com>
+ */
+//=============================================================================
+
+#include "tao/Utils/Server_Main.h"
+#include "ReplicationManagerFaultConsumerAdapter.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<ReplicationManagerFaultConsumerAdapter>
+ server_main("FaultConsumer");
+ return server_main.run(argc, argv);
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FTAPP_Notifier_Main.cpp b/TAO/orbsvcs/tests/FT_App/FTAPP_Notifier_Main.cpp
new file mode 100644
index 00000000000..2ae607f7f0f
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FTAPP_Notifier_Main.cpp
@@ -0,0 +1,23 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FTAPP_Notifier_Main.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * This file provides the main routine for a stub implementation
+ * of the FaultNotifier interface.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "StubFaultNotifier.h"
+#include "tao/Utils/Server_Main.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<StubFaultNotifier> server_main("FaultNotifier");
+ return server_main.run(argc, argv);
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FT_App.mpc b/TAO/orbsvcs/tests/FT_App/FT_App.mpc
new file mode 100644
index 00000000000..4864a0acb3c
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_App.mpc
@@ -0,0 +1,153 @@
+// $Id$
+
+project(*idl): taoidldefaults, orbsvcslib {
+ IDL_Files {
+ FT_TestReplica.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): taoserver, fault_tolerance, orbsvcsexe, minimum_corba {
+ exename = ft_replica
+ after += *idl
+ Source_Files {
+ FT_Replica.cpp
+ FT_ReplicaFactory_i.cpp
+ FT_TestReplica_i.cpp
+ FT_TestReplicaS.cpp
+ FT_TestReplicaC.cpp
+ }
+// Custom folder: test scripts
+// too bad this doesn't work!
+// If you omit the generic_outputext, it creates an empty folder
+// if you include the generic_outputext, it tries to "build" the .pl
+// file which runs the test even when you don't want to.
+// Define_Custom(Script) {
+// inputext = .pl, .py, .rb
+// generic_outputext = .txt
+// }
+// Script_Files {
+// run_test_detector.pl
+// }
+
+ Documentation_Files {
+ README
+ FT_App.mpc
+ run_test_basic.pl // can the client talk to the server
+ run_test_detector.pl // does a detector notice a server fault
+ run_test_notifier.pl // does the notification get to an analyzer
+ run_test_fault_consumer.pl // Is the notification analyzed correctly
+ run_test_registry.pl // does the stand-along factory registry work
+ run_test_rmregistry.pl // does the factory registry in the RM work
+ run_test_replication_mgr.pl //
+ run_test_demo.pl // test it all together
+ }
+
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, fault_tolerance, orbsvcsexe, minimum_corba {
+ exename = ft_client
+ after += *idl
+ Source_Files {
+ FT_Client.cpp
+ FT_TestReplicaC.cpp
+ }
+ Documentation_Files {
+ }
+ IDL_Files {
+ }
+}
+
+project(*Notifier): taoserver, fault_tolerance, iormanip, orbsvcsexe, minimum_corba {
+ exename = ft_notifier
+ Source_Files {
+ FTAPP_Notifier_Main.cpp
+ StubFaultNotifier.cpp
+ }
+
+ // explicitly omit IDL and doc files
+ IDL_Files {
+ }
+ Documentation_Files {
+ }
+}
+
+project(*Analyzer): taoclient, fault_tolerance, notification_skel, orbsvcsexe {
+ exename = ft_analyzer
+
+ Source_Files {
+ FTAPP_Analyzer_Main.cpp
+ StubFaultAnalyzer.cpp
+ StubFaultConsumer.cpp
+ StubBatchConsumer.cpp
+ }
+
+ // explicitly omit IDL files
+ IDL_Files {
+ }
+ Documentation_Files {
+ }
+}
+
+project(*FaultConsumer): taoserver, fault_tolerance, notification_skel, orbsvcsexe, minimum_corba {
+ exename = ft_fault_consumer
+ libs += TAO_ReplicationManagerLib
+ after += FT_ReplicationManager_Lib
+ Source_Files {
+ FTAPP_FaultConsumer_Main.cpp
+ ReplicationManagerFaultConsumerAdapter.cpp
+ }
+
+ // explicitly omit IDL files
+ IDL_Files {
+ }
+ Documentation_Files {
+ }
+}
+
+project(*FactoryRegistry): taoclient, fault_tolerance, orbsvcsexe, minimum_corba {
+ exename = ft_registry
+
+ Source_Files {
+ FTAPP_FactoryRegistry_Main.cpp
+ }
+
+ Header_Files {
+
+ }
+ // explicitly omit IDL files
+ IDL_Files {
+ }
+ Documentation_Files {
+ }
+}
+
+project(*Creator): taoclient, fault_tolerance, orbsvcsexe, minimum_corba {
+ exename = ft_create
+
+ Source_Files {
+ FT_Creator.cpp
+ TAO_Object_Group_Creator.cpp
+ }
+
+ // explicitly omit IDL files
+ IDL_Files {
+ }
+
+ Documentation_Files {
+ }
+}
+
+project(*RMController): taoclient, fault_tolerance, orbsvcsexe, minimum_corba {
+ exename = replmgr_controller
+ Source_Files {
+ FT_ReplicationManagerController.cpp
+ }
+ // explicitly omit IDL files
+ IDL_Files {
+ }
+ Documentation_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FT_Client.cpp b/TAO/orbsvcs/tests/FT_App/FT_Client.cpp
new file mode 100644
index 00000000000..2c77a1e7750
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_Client.cpp
@@ -0,0 +1,647 @@
+// $Id$
+
+#include "FT_TestReplicaC.h"
+#include <ace/Vector_T.h>
+#include <ace/SString.h>
+#include <ace/Get_Opt.h>
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_stdio.h"
+
+class FTClientMain
+{
+ typedef ACE_Vector<ACE_CString> StringVec;
+ public:
+ ///////////////////////////
+ // construction/destruction
+ FTClientMain ();
+
+ ~FTClientMain ();
+
+ /////////////////
+ // initialization
+ int parse_args (int argc, char *argv[]);
+
+ ////////////
+ // execution
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /////////////////
+ // implementation
+private:
+ void usage (FILE* out)const;
+ void commandUsage (FILE* out);
+ int pass (
+ long & counter, // inout
+ int & more, // out
+ ACE_CString & command, // inout
+ int retry // in
+ ACE_ENV_ARG_DECL);
+
+
+ int next_replica (ACE_ENV_SINGLE_ARG_DECL);
+
+ ////////////////////
+ // forbidden methods
+ private:
+ FTClientMain (const FTClientMain & rhs);
+ FTClientMain & operator = (const FTClientMain & rhs);
+
+ ////////////////
+ // Data members
+ private:
+
+ CORBA::ORB_var orb_;
+
+ int argc_;
+ char ** argv_;
+ const char * inFileName_;
+ FILE *inFile_;
+ FILE *commandIn_;
+
+ enum Verbosity{
+ SILENT,
+ QUIET,
+ NORMAL,
+ NOISY,
+ LOUD}
+ verbose_;
+
+
+ StringVec replica_iors_;
+ size_t replica_pos_;
+ const char * replica_name_;
+ FT_TEST::TestReplica_var replica_;
+};
+
+
+FTClientMain::FTClientMain ()
+ : inFile_(0)
+ , commandIn_(stdin)
+ , verbose_(NORMAL)
+ , replica_pos_(0)
+ , replica_name_("none")
+{
+}
+
+FTClientMain::~FTClientMain ()
+{
+ if (this->inFile_)
+ {
+ ACE_OS::fclose (this->inFile_);
+ this->inFile_ = 0;
+ }
+}
+
+void FTClientMain::commandUsage(FILE* out)
+{
+ ACE_OS::fprintf (out,
+ "Each command must be at the beginning of a separate line.\n"
+ "Everything after the command (and operand if any) is ignored.\n"
+ "Valid commands are:\n"
+ " Access via method call:\n"
+ " =N set counter to N\n"
+ " cN get counter and compare to N (c stands for \"check\"\n"
+ " +N increment counter by N\n"
+ " -N decrement counter by N\n"
+ " Access as attribute:\n"
+ " >N set attribute to N\n"
+ " < get attribite\n"
+ " Try methods to be used by fault tolerant infrastructure: \n"
+ " ! is_alive\n"
+ " s get_state\n"
+ " S set_state\n"
+ " u get_update\n"
+ " U set_update\n"
+ " Simulate failure:\n"
+ " dN die on condition:\n"
+ " d%d don't die\n"
+ " d%d immediately\n"
+ " d%d while idle\n"
+ " (FT_TestReplica interface)\n"
+ " d%d before state change\n"
+ " d%d after state change, before replication\n"
+ " d%d after replication, before reply \n"
+ " (Monitorable interface)\n"
+ " d%d during is alive\n"
+ " d%d is_alive returns false\n"
+ " (Updatable interface)\n"
+ " d%d during get update\n"
+ " d%d before set update\n"
+ " d%d after set update\n"
+ " (Checkpointable interface)\n"
+ " d%d during get state\n"
+ " d%d before set state\n"
+ " d%d after set state\n"
+ " Logistics commands:\n"
+ " # ignore this line (comment).\n"
+ " v set verbosity:\n"
+ " 0 don't check counter value.\n"
+ " 1 only display counter value mismatch.\n"
+ " 2 display counter value after every command (default).\n"
+ " 3 display commands.\n"
+ " 4 display method calls.\n"
+ " zN sleep N seconds.\n"
+ " q quit (end the client, not the replica(s).)\n"
+ " q1 quit (end the client, and shutdown the currently active replica.)\n"
+ " ? help (this message)\n",
+ FT_TEST::TestReplica::NOT_YET,
+ FT_TEST::TestReplica::RIGHT_NOW,
+ FT_TEST::TestReplica::WHILE_IDLE,
+ FT_TEST::TestReplica::BEFORE_STATE_CHANGE,
+ FT_TEST::TestReplica::BEFORE_REPLICATION,
+ FT_TEST::TestReplica::BEFORE_REPLY,
+ FT_TEST::TestReplica::DURING_IS_ALIVE,
+ FT_TEST::TestReplica::DENY_IS_ALIVE,
+ FT_TEST::TestReplica::DURING_GET_UPDATE,
+ FT_TEST::TestReplica::BEFORE_SET_UPDATE,
+ FT_TEST::TestReplica::AFTER_SET_UPDATE,
+ FT_TEST::TestReplica::DURING_GET_STATE,
+ FT_TEST::TestReplica::BEFORE_SET_STATE,
+ FT_TEST::TestReplica::AFTER_SET_STATE);
+}
+
+int
+FTClientMain::parse_args (int argc, char *argv[])
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+ int result = 0;
+
+ // note: dfnkx are simple_util options
+ // include them here so we can detect bad args
+ ACE_Get_Opt get_opts (argc, argv, "c:f:");
+ int c;
+
+ while (result == 0 && (c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'c':
+ {
+ this->inFileName_ = get_opts.opt_arg ();
+ this->inFile_ = ACE_OS::fopen (this->inFileName_, "r");
+ if(this->inFile_ && !ferror (this->inFile_))
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Reading commands from %s\n", this->inFileName_);
+ this->commandIn_ = this->inFile_;
+ }
+ else
+ {
+ ACE_OS::fprintf (stderr, "FT Client: Can't open input file: %s\n", this->inFileName_);
+ result = -1;
+ }
+ break;
+ }
+ case 'f':
+ {
+ replica_iors_.push_back(get_opts.opt_arg ());
+ break;
+ }
+
+ default:
+ case '?':
+ usage(stderr);
+ result = 1;
+ }
+ }
+ return result;
+}
+
+void FTClientMain::usage(FILE* out)const
+{
+ ACE_OS::fprintf (out, "usage"
+ " -c <command file>"
+ " [-f <ior file>]...\n");
+}
+
+int FTClientMain::pass (
+ long & counter,
+ int & more,
+ ACE_CString & command,
+ int retry
+ ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+
+ ::FT::State_var state;
+ unsigned long stateValue = 0;
+ ::FT::State_var update;
+ unsigned long updateValue = 0;
+
+ while(more && result == 0 && !feof (this->commandIn_))
+ {
+ if (! retry || command.length () == 0 )
+ {
+ char buffer[1000];
+ char *str_ = ACE_OS::fgets (buffer, sizeof(buffer)-1, this->commandIn_);
+ if ( str_ )
+ {
+ str_ = ACE_OS::strrchr (str_, '\n');
+ if ( str_ )
+ *str_ = '\0';
+ }
+ command = buffer;
+ }
+ retry = 0;
+
+ if (command.length() >0)
+ {
+ char op = command[0];
+ ACE_CString cdr = command.substr(1);
+ char * junque;
+ long operand = strtol(cdr.c_str(),&junque, 10);
+
+ if (this->verbose_ >= NOISY)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: %s\n", command.c_str());
+ }
+
+ // turn echo on (based on verbose)
+ // individual commands can turn it off
+ int echo = this->verbose_ >= QUIET;
+
+ switch(op)
+ {
+ case '#':
+ {
+ echo = 0;
+ break;
+ }
+ case '=':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->set(%ld);\n", operand);
+ }
+ this->replica_->set(operand ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ counter = operand;
+ break;
+ }
+ case 'c':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->get();\n");
+ }
+ long value = this->replica_->counter(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (value == operand)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Good: Read %ld expecting %ld\n", value, operand);
+ counter = operand;
+ }
+ else
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Error: Read %ld expecting %ld\n", value, operand);
+ }
+ echo = 0;
+ break;
+
+ }
+ case '>':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->counter(%ld);\n", operand);
+ }
+ this->replica_->counter(operand ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ counter = operand;
+ break;
+ }
+ case '+':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->increment(%ld);\n", operand);
+ }
+ this->replica_->increment(operand ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ counter += operand;
+ break;
+ }
+ case '-':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->increment(%ld);\n", -operand);
+ }
+ this->replica_->increment(-operand ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ counter -= operand;
+ break;
+ }
+ case '<':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->counter();\n");
+ }
+ long attribute = this->replica_->counter(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_OS::fprintf (stdout, "FT Client: Attribute: %ld\n", attribute);
+ echo = 0;
+ break;
+ }
+ case '!':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->is_alive();\n");
+ }
+ int alive = this->replica_->is_alive(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ACE_OS::fprintf (stdout, "FT Client: Is alive? %d\n", alive);
+ break;
+ }
+ case 'd':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->die(%ld);\n", operand);
+ }
+ this->replica_->die(static_cast<FT_TEST::TestReplica::Bane> (operand) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ echo = 0;
+ break;
+ }
+ case 's':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->get_state();\n");
+ }
+ state = this->replica_->get_state(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ stateValue = counter;
+ break;
+ }
+ case 'S':
+ {
+ if (state->length () > 0)
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->set_state(saved_state);\n");
+ }
+ this->replica_->set_state (state.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ counter = stateValue;
+ }
+ else
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Error: no saved state.\n");
+ }
+ break;
+ }
+ case 'u':
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->get_update();\n");
+ }
+ update = this->replica_->get_update(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ updateValue = counter;
+ break;
+ }
+ case 'U':
+ {
+ if (update->length () > 0)
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->set_update(saved_update);\n");
+ }
+ this->replica_->set_update(update.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ counter = updateValue;
+ }
+ else
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ERROR: No saved update information.\n");
+ }
+ break;
+ }
+ case 'v':
+ {
+ this->verbose_ = static_cast<Verbosity> (operand);
+ break;
+ }
+ case 'z':
+ {
+ if (operand == 0)
+ {
+ operand = 1;
+ }
+ ACE_Time_Value tv (operand,0);
+ ACE_OS::sleep(tv);
+ break;
+ }
+ case 'q':
+ {
+ if (operand != 0)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->shutdown();\n");
+ }
+ this->replica_->shutdown( ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // @@ Note: this is here because the corba event loop seems to go to sleep
+ // if there's nothing for it to do.
+ // not quite sure why, yet. Dale
+ this->replica_->is_alive(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Ignoring expected exception during shutdown.\n");
+ ; // ignore exception during shutdown
+ }
+ ACE_ENDTRY;
+ }
+ echo = 0;
+ more = 0;
+ break;
+ }
+ default:
+ {
+ if (op != '?')
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Unknown: %s\n", command.c_str());
+ }
+ commandUsage(stderr);
+ break;
+ }
+ }
+ if (echo && this->verbose_ >= QUIET)
+ {
+ if (this->verbose_ >= LOUD)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: ->get();\n");
+ }
+
+ long value = this->replica_->get(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (value == counter)
+ {
+ if (this->verbose_ >= NORMAL)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: %ld\n", counter);
+ }
+ }
+ else
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Error: read %ld expecting %ld\n", value, counter);
+ result = -1;
+ }
+ }
+ }
+ }
+ return result;
+}
+
+int FTClientMain::next_replica (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = 0;
+ if (this->replica_pos_ < this->replica_iors_.size())
+ {
+ this->replica_name_ = this->replica_iors_[this->replica_pos_].c_str();
+ this->replica_pos_ += 1;
+ CORBA::Object_var rep_obj = this->orb_->string_to_object (this->replica_name_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ this->replica_ = FT_TEST::TestReplica::_narrow (rep_obj.in ());
+ if (! CORBA::is_nil (replica_.in ()))
+ {
+ result = 1;
+ }
+ else
+ {
+ ACE_OS::fprintf (stderr, "FT Client: Can't resolve IOR: %s\n", this->replica_name_);
+ }
+ }
+ else
+ {
+ ACE_OS::fprintf (stderr, "***OUT_OF_REPLICAS*** "
+ ACE_SIZE_T_FORMAT_SPECIFIER
+ "\n", this->replica_pos_);
+ }
+ return result;
+}
+
+
+int FTClientMain::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = 0;
+
+ this->orb_ = CORBA::ORB_init(this->argc_, this->argv_);
+
+ int ok = next_replica (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (ok)
+ {
+ // retry information
+ ACE_CString command;
+ int retry = 0;
+ long counter = this->replica_->get(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->verbose_ >= NORMAL)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Initial counter %ld\n", counter);
+ }
+ if (ACE_OS::isatty(fileno(stdin)))
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Commands(? for help):\n");
+ }
+
+ int more = 1;
+ while (more && result == 0 && !feof (this->commandIn_))
+ {
+ ACE_TRY_NEW_ENV
+ {
+ result = pass (counter, more, command, retry ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Caught system exception: \n");
+ ACE_PRINT_EXCEPTION (sysex, "FT Client");
+
+ retry = 0;
+ int handled = 0;
+
+ handled = next_replica(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (handled)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Recovering from fault.\n");
+ ACE_OS::fprintf (stdout, "FT Client: Activate %s\n", this->replica_name_);
+ if (command.length () == 0)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: No command to retry.\n");
+ }
+ else if (command[0] == 'd')
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Not retrying \"die\" command.\n");
+ }
+ else if (sysex.completed () == CORBA::COMPLETED_YES)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Last command completed. No retry needed.\n");
+ }
+ else
+ {
+ if (sysex.completed () == CORBA::COMPLETED_MAYBE)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Last command may have completed. Retrying anyway.\n");
+ }
+ retry = 1;
+ ACE_OS::fprintf (stdout, "FT Client: Retrying command: %s\n", command.c_str());
+ }
+ }
+ if (! handled)
+ {
+ ACE_OS::fprintf (stdout, "FT Client: Exception not handled. Rethrow. ");
+ ACE_RE_THROW;
+ }
+ }
+ ACE_ENDTRY;
+ }
+ }
+ else
+ {
+ ACE_OS::fprintf (stderr, "FT Client: Can't connect to replica.\n");
+ }
+ return result;
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ FTClientMain app;
+ int result = app.parse_args(argc, argv);
+ if (result == 0)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ result = app.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "FT_Client::main\t\n");
+ result = -1;
+ }
+ ACE_ENDTRY;
+ }
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FT_Creator.cpp b/TAO/orbsvcs/tests/FT_App/FT_Creator.cpp
new file mode 100644
index 00000000000..996c2a27fb7
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_Creator.cpp
@@ -0,0 +1,290 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_Creator.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * Main wrapped around TAO_Object_Group_Creator
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "FT_Creator.h"
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+#include <orbsvcs/PortableGroup/PG_Properties_Encoder.h>
+
+#include <ace/Get_Opt.h>
+#include <ace/OS_NS_stdio.h>
+
+FTAPP::FT_Creator::FT_Creator ()
+ : creator_ ()
+ , orb_ (CORBA::ORB::_nil ())
+ , registry_ior_(0)
+ , replication_manager_ (::FT::ReplicationManager::_nil ())
+ , have_replication_manager_ (0)
+ , write_iors_ (0)
+ , write_iogr_ (0)
+ , ns_register_ (1)
+ , iogr_seq_ (0)
+ , prefix_ ("")
+{
+}
+
+FTAPP::FT_Creator::~FT_Creator ()
+{
+}
+
+int
+FTAPP::FT_Creator::parse_args (int argc, char *argv[])
+{
+ int result = 0;
+
+ ACE_Get_Opt get_opts (argc, argv, "r:ignf:u:p:");
+ int c;
+
+ while (result == 0 && (c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'r':
+ {
+ this->create_roles_.push_back (get_opts.opt_arg ());
+ break;
+ }
+ case 'u':
+ {
+ this->unregister_roles_.push_back (get_opts.opt_arg ());
+ break;
+ }
+ case 'f':
+ {
+ this->registry_ior_ = get_opts.opt_arg ();
+ break;
+ }
+
+ case 'g':
+ {
+ this->write_iogr_ = !this->write_iogr_;
+ break;
+ }
+
+ case 'i':
+ {
+ this->write_iors_ = ! this->write_iors_;
+ break;
+ }
+
+ case 'n':
+ {
+ this->ns_register_ = !this->ns_register_;
+ break;
+ }
+
+ case 'p':
+ {
+ this->prefix_ = get_opts.opt_arg();
+ break;
+ }
+
+ default:
+ {
+ ACE_OS::fprintf (stderr, "Creator: Unknown argument -%c\n", (char) c);
+ usage(stderr);
+ result = 1;
+ break;
+ }
+ case '?':
+ {
+ usage(stderr);
+ result = 1;
+ break;
+ }
+ }
+ }
+
+ if ( this->create_roles_.size() == 0 && this->unregister_roles_.size() == 0)
+ {
+ ACE_OS::fprintf (stderr, "Creator: neither create (-t) nor kill (-u) specified. Nothing to do.\n");
+ usage (stderr);
+ result = -1;
+ }
+
+ return result;
+}
+
+void FTAPP::FT_Creator::usage(FILE* out)const
+{
+ ACE_OS::fprintf (out, "usage\n"
+ " -r <role for objects to be created>\n"
+ " -f <factory registry ior file> (if not specified, ReplicationManager is used.)\n"
+ " -u <role to be unregistered (for testing factory registry)>\n"
+ " -i (toggle write ior for each object (default false))\n"
+ " -p <prefix for registration & file names>\n"
+ " -g (toggle write iogr to file (default false))\n"
+ " -n (toggle register iogr with name service (default true))\n")
+ ;
+}
+
+
+
+int FTAPP::FT_Creator::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ // if a factory IOR was specified on command line
+ if ( this->registry_ior_ != 0)
+ {
+ CORBA::Object_var registry_obj
+ = this->orb_->string_to_object (this->registry_ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ PortableGroup::FactoryRegistry_var registry
+ = PortableGroup::FactoryRegistry::_narrow(registry_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (! CORBA::is_nil (registry.in ()))
+ {
+ result = this->creator_.set_factory_registry(registry.in());
+ }
+ }
+
+ if (result == 0)
+ {
+ result = this->creator_.init (orb ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+
+ if (result == 0 && this->ns_register_)
+ {
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil(naming_obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%T %n (%P|%t) Unable to find the Naming Service\n"),
+ 1);
+ }
+ this->naming_context_=
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return result;
+}
+
+int FTAPP::FT_Creator::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = 0;
+ size_t typeCount = this->create_roles_.size();
+ size_t nType = 0;
+ for ( nType = 0; result == 0 && nType < typeCount; ++nType)
+ {
+ const char * role = this->create_roles_[nType].c_str();
+ ACE_OS::fprintf (stdout, "\nCreator: Creating group of %s\n", role);
+ PortableGroup::ObjectGroup_var group = this->creator_.create_group (
+ role,
+ this->write_iors_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ if (this->write_iogr_)
+ {
+ CORBA::String_var iogr = this->orb_->object_to_string (group.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+
+ char iogr_filename[1000];
+ ACE_OS::snprintf (iogr_filename, sizeof(iogr_filename)-1, "%s%s_%d.iogr",
+ this->prefix_,
+ role,
+ this->iogr_seq_);
+ FILE * iogr_file = fopen (iogr_filename, "w");
+ if (iogr_file != 0)
+ {
+ char const * siogr = static_cast<const char *> (iogr.in ());
+ fwrite (siogr, 1, strlen(siogr), iogr_file);
+ fclose (iogr_file);
+ }
+ else
+ {
+ ACE_OS::fprintf (stderr, "Can't open iogr output file %s\n", iogr_filename);
+ result = 1;
+ }
+ }
+
+ if(this->ns_register_)
+ {
+ char iogr_name[1000];
+ ACE_OS::snprintf (iogr_name, sizeof(iogr_name)-1, "%s_%s_%d",
+ this->prefix_,
+ role,
+ this->iogr_seq_);
+
+ CosNaming::Name this_name (1);
+ this_name.length (1);
+ this_name[0].id = CORBA::string_dup (iogr_name);
+
+ this->naming_context_->rebind (this_name, group.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ }
+
+ iogr_seq_ += 1;
+
+ }
+
+ typeCount = this->unregister_roles_.size();
+ for ( nType = 0; result == 0 && nType < typeCount; ++nType)
+ {
+ const char * role = this->unregister_roles_[nType].c_str();
+ result = this->creator_.unregister_role (role ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return result;
+}
+
+int FTAPP::FT_Creator::fini ()
+{
+ return this->creator_.fini();
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ ACE_TRY_CHECK;
+ FTAPP::FT_Creator app;
+ result = app.parse_args(argc, argv);
+ if (result == 0)
+ {
+ result = app.init (orb.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (result == 0)
+ {
+ result = app.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ if (result == 0)
+ {
+ result = app.fini();
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "FT_Creator::main\t\n");
+ result = -1;
+ }
+ ACE_ENDTRY;
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FT_Creator.h b/TAO/orbsvcs/tests/FT_App/FT_Creator.h
new file mode 100644
index 00000000000..14e2664fda9
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_Creator.h
@@ -0,0 +1,117 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_Creator.h
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * Main wrapped around TAO_Object_Group_Creator
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef FT_CREATOR_H
+#define FT_CREATOR_H
+
+#include /**/ "ace/pre.h"
+
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "TAO_Object_Group_Creator.h"
+#include "ace/OS_NS_stdio.h"
+
+namespace FTAPP
+{
+ class FT_Creator
+ {
+ typedef ACE_Vector<ACE_CString> StringVec;
+ public:
+ ///////////////////////////
+ // construction/destruction
+ FT_Creator ();
+
+ ~FT_Creator ();
+
+ /////////////////
+ // initialization
+ int parse_args (int argc, char *argv[]);
+
+ int init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ ////////////
+ // execution
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+
+ ////////////
+ // shut down
+ int fini ();
+
+ /////////////////
+ // implementation
+ private:
+ void usage (FILE* out)const;
+
+ ////////////////////
+ // forbidden methods
+ private:
+ FT_Creator (const FT_Creator & rhs);
+ FT_Creator & operator = (const FT_Creator & rhs);
+
+ ////////////////
+ // Data members
+ private:
+
+ TAO::Object_Group_Creator creator_;
+ CORBA::ORB_var orb_;
+ const char * registry_ior_;
+ StringVec create_roles_;
+ StringVec unregister_roles_;
+
+
+ CosNaming::NamingContext_var naming_context_;
+
+ ::FT::ReplicationManager_var replication_manager_;
+ /**
+ * bool: true if we have a real replication manager
+ */
+ int have_replication_manager_;
+
+ /**
+ * bool: true if we should write individual IOR files
+ */
+ int write_iors_;
+
+ /**
+ * bool: true if we should write IOGR to a file
+ */
+ int write_iogr_;
+
+ /**
+ * bool: true if we should write IOGR to a Name Service
+ */
+ int ns_register_;
+
+ /**
+ * sequence number applied to created IOGRs
+ */
+ unsigned long iogr_seq_;
+
+ /**
+ * prefix for names
+ */
+ const char * prefix_;
+
+
+ };
+
+} // namespace TAO
+
+#include /**/ "ace/post.h"
+
+#endif // FT_CREATOR_H
diff --git a/TAO/orbsvcs/tests/FT_App/FT_Replica.cpp b/TAO/orbsvcs/tests/FT_App/FT_Replica.cpp
new file mode 100644
index 00000000000..1fcc2339969
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_Replica.cpp
@@ -0,0 +1,22 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_Replica.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * Implement the FT_TEST::Replica IDL interface.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "tao/Utils/Server_Main.h"
+#include "FT_ReplicaFactory_i.h"
+
+int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ TAO::Utils::Server_Main<FT_ReplicaFactory_i> server_main("TestReplicaFactory");
+ return server_main.run(argc, argv);
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.cpp b/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.cpp
new file mode 100644
index 00000000000..ba8b3d7e58d
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.cpp
@@ -0,0 +1,773 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicaFactory_i.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+#include "FT_ReplicaFactory_i.h"
+#include "FT_TestReplica_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+
+// Use this macro at the beginning of CORBA methods
+// to aid in debugging.
+#define METHOD_ENTRY(name) \
+ ACE_DEBUG (( LM_DEBUG, \
+ "Enter %s\n", #name \
+ ))
+
+// Use this macro to return from CORBA methods
+// to aid in debugging. Note that you can specify
+// the return value after the macro, for example:
+// METHOD_RETURN(Plugh::plover) xyzzy; is equivalent
+// to return xyzzy;
+// METHOD_RETURN(Plugh::troll); is equivalent to
+// return;
+// WARNING: THIS GENERATES TWO STATEMENTS!!! THE FOLLOWING
+// will not do what you want it to:
+// if (cave_is_closing) METHOD_RETURN(Plugh::pirate) aarrggh;
+// Moral: Always use braces.
+#define METHOD_RETURN(name) \
+ ACE_DEBUG (( LM_DEBUG, \
+ "Leave %s\n", #name \
+ )); \
+ return /* value goes here */
+
+
+static const char * criterion_initial_value = "INITIAL_VALUE";
+
+//////////////////////////////////////////////////////
+// FT_ReplicaFactory_i Construction/destruction
+
+FT_ReplicaFactory_i::FT_ReplicaFactory_i ()
+ : internals_ ()
+ , orb_ (CORBA::ORB::_nil ())
+ , poa_ (PortableServer::POA::_nil ())
+ , object_id_ ()
+ , ior_ ()
+ , ior_output_file_ (0)
+ , identity_ ()
+ , have_replication_manager_(0)
+ , replication_manager_(0)
+ , factory_registry_ior_(0)
+ , factory_registry_ (0)
+ , registered_(0)
+ , test_output_file_(0)
+ , ns_name_(0)
+ , naming_context_ (CosNaming::NamingContext::_nil ())
+ , this_name_ ()
+ , roles_ ()
+ , location_ ("unknown")
+ , quit_on_idle_ (0)
+ , unregister_by_location_ (0)
+ , replicas_ ()
+ , empty_slots_(0)
+ , quit_requested_(0)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ char const * repo_id =
+ FT_TEST::_tc_TestReplica->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "TestReplica type_id: %s\n",
+ repo_id));
+
+// ACE_DEBUG((LM_DEBUG, "Hobbit type_id: %s\n", FT_TEST::_tc_Hobbit->id() ));
+// ACE_DEBUG((LM_DEBUG, "Elf type_id: %s\n", FT_TEST::_tc_Elf->id() ));
+// ACE_DEBUG((LM_DEBUG, "Human type_id: %s\n", FT_TEST::_tc_Human->id() ));
+}
+
+
+FT_ReplicaFactory_i::~FT_ReplicaFactory_i ()
+{
+ //scope the guard
+ {
+ InternalGuard guard (this->internals_);
+
+ // be sure all replicas are gone
+ // before this object disappears
+ shutdown_i ();
+ }
+}
+
+////////////////////////////////////////////
+// FT_ReplicaFactory_i private methods
+
+CORBA::ULong FT_ReplicaFactory_i::allocate_id()
+{
+ // assume mutex is locked
+ CORBA::ULong id = this->replicas_.size();
+ if (this->empty_slots_ != 0)
+ {
+ for(CORBA::ULong pos = 0; pos < id; ++pos)
+ {
+ if (this->replicas_[pos] == 0)
+ {
+ id = pos;
+ }
+ }
+ }
+ else
+ {
+ this->replicas_.push_back(0);
+ this->empty_slots_ += 1;
+ }
+ return id;
+}
+
+void FT_ReplicaFactory_i::shutdown_i()
+{
+ // assume mutex is locked
+ for (size_t nReplica = 0; nReplica < this->replicas_.size(); ++nReplica)
+ {
+ FT_TestReplica_i * replica = this->replicas_[nReplica];
+ if (replica != 0)
+ {
+ replica->request_quit();
+ }
+ }
+}
+
+int FT_ReplicaFactory_i::write_ior(const char * outputFile, const char * ior)
+{
+ int result = -1;
+ FILE* out = ACE_OS::fopen (outputFile, "w");
+ if (out)
+ {
+ ACE_OS::fprintf (out, "%s", ior);
+ ACE_OS::fclose (out);
+ result = 0;
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Open failed for %s\n", outputFile
+ ));
+ }
+ return result;
+}
+
+//////////////////////////////////////////////////////
+// FT_ReplicaFactory_i public, non-CORBA methods
+
+int FT_ReplicaFactory_i::parse_args (int argc, char * argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:f:i:l:t:qu");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'o':
+ {
+ this->ior_output_file_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'n':
+ {
+ this->ns_name_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'f':
+ {
+ this->factory_registry_ior_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'i':
+ {
+ this->roles_.push_back(get_opts.opt_arg ());
+ break;
+ }
+ case 'l':
+ {
+ this->location_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'q':
+ {
+ this->quit_on_idle_ = 1;
+ break;
+ }
+ case 'u':
+ {
+ this->unregister_by_location_ = 1;
+ break;
+ }
+
+ case 't':
+ {
+ this->test_output_file_ = get_opts.opt_arg ();
+ break;
+ }
+
+ case '?':
+ // fall thru
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s \n"
+ " -o <factory ior file>\n"
+ " -n <naming service registration name>\n"
+ " -f <factory registry ior file>\n"
+ " -i <registration: role>\n"
+ " -l <registration: location>\n"
+ " -t <test replica ior file>\n"
+ " -u{nregister by location}\n"
+ " -q{uit on idle}\n",
+ argv [0]),
+ -1);
+ break;
+ }
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+const char * FT_ReplicaFactory_i::location () const
+{
+ return this->location_;
+}
+
+const char * FT_ReplicaFactory_i::identity () const
+{
+ return this->identity_.c_str();
+}
+
+int FT_ReplicaFactory_i::idle (int & result ACE_ENV_ARG_DECL)
+{
+ result = 0;
+ size_t replicaCount = this->replicas_.size();
+ if (replicaCount != this->empty_slots_)
+ {
+ for (size_t nReplica = 0; result == 0 && nReplica < replicaCount; ++nReplica)
+ {
+ FT_TestReplica_i * replica = this->replicas_[nReplica];
+ if (replica != 0)
+ {
+ // give the replica's idle processing a change
+ // ignore the return status (the replica should shut itself down
+ // unless result is non-zero.
+ // non-zero result means panic.
+ replica->idle(result ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+ }
+
+ int quit = (this->quit_requested_ || result != 0);
+ if (!quit && this->replicas_.size() == this->empty_slots_)
+ {
+/* if you re-enable this, add some kind of throttle to avoid noise.
+ ACE_ERROR (( LM_ERROR,
+ "ReplicaFactory is idle.\n"
+ ));
+*/
+ if (this->quit_on_idle_ && this->empty_slots_ != 0)
+ {
+ ACE_ERROR (( LM_ERROR,
+ "%s exits due to quit on idle option.\n",
+ identity()
+ ));
+ quit = 1;
+ }
+ }
+
+ return quit;
+}
+
+
+
+int FT_ReplicaFactory_i::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ // Use the ROOT POA for now
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references (TAO_OBJID_ROOTPOA
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+ }
+
+ // Get the POA object.
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil(this->poa_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to narrow the POA.\n")),
+ -1);
+ }
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register with the POA.
+
+ this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var this_obj =
+ this->poa_->id_to_reference (object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->ior_ = this->orb_->object_to_string (this_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->factory_registry_ior_ != 0)
+ {
+ if (ACE_OS::strcmp (this->factory_registry_ior_, "none") != 0)
+ {
+ CORBA::Object_var reg_obj = this->orb_->string_to_object(factory_registry_ior_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->factory_registry_ = ::PortableGroup::FactoryRegistry::_narrow(reg_obj.in ());
+ if (CORBA::is_nil(this->factory_registry_.in ()))
+ {
+ ACE_ERROR (( LM_ERROR,
+ "Can't resolve Factory Registry IOR %s\n",
+ this->factory_registry_ior_
+ ));
+ result = -1;
+ }
+ }
+ }
+ else // no -f option. Try RIR(RM)
+ {
+ ///////////////////////////////
+ // Find the ReplicationManager
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var rm_obj = orb->resolve_initial_references("ReplicationManager" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->replication_manager_ = ::FT::ReplicationManager::_narrow(rm_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!CORBA::is_nil (replication_manager_.in ()))
+ {
+ this->have_replication_manager_ = 1;
+ // empty criteria
+ ::PortableGroup::Criteria criteria;
+ this->factory_registry_ = this->replication_manager_->get_factory_registry(criteria ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (this->factory_registry_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,"ReplicaFactory: ReplicationManager failed to return FactoryRegistry. Factory will not be registered.\n" ));
+ }
+ }
+ else
+ {
+ this->factory_registry_ = ::PortableGroup::FactoryRegistry::_narrow(rm_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!CORBA::is_nil(this->factory_registry_.in ()))
+ {
+ ACE_DEBUG ((LM_DEBUG,"Found a FactoryRegistry DBA ReplicationManager\n" ));
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,"ReplicaFactory: Can't resolve ReplicationManager.\n" ));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (this->test_output_file_ == 0) // ignore if this is a test run
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ReplicaFactory: Exception resolving ReplicationManager. Factory will not be registered.\n" );
+ }
+ }
+ ACE_ENDTRY;
+
+ }
+
+ if ( ! CORBA::is_nil (this->factory_registry_.in ()))
+ {
+ size_t roleCount = roles_.size();
+ for (size_t nRole = 0; nRole < roleCount; ++nRole)
+ {
+ const char * roleName = this->roles_[nRole].c_str();
+
+ PortableGroup::FactoryInfo info;
+ info.the_factory = ::PortableGroup::GenericFactory::_narrow(this_obj.in ());
+ info.the_location.length(1);
+ info.the_location[0].id = CORBA::string_dup(this->location_);
+ info.the_criteria.length(1);
+ info.the_criteria[0].nam.length(1);
+ info.the_criteria[0].nam[0].id = CORBA::string_dup(PortableGroup::role_criterion);
+ info.the_criteria[0].val <<= CORBA::string_dup(roleName);
+
+ ACE_ERROR (( LM_INFO,
+ "Factory: %s@%s registering with factory registry\n",
+ roleName,
+ location_
+ ));
+
+ char const * replica_repository_id =
+ FT_TEST::_tc_TestReplica->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->factory_registry_->register_factory(
+ roleName,
+ replica_repository_id,
+ info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ this->registered_ = 1;
+ }
+
+ int identified = 0; // bool
+
+ if (this->roles_.size() > 0)
+ {
+ this->identity_ = "Factory";
+ if (this->location_ != 0)
+ {
+ this->identity_ += "@";
+ this->identity_ += this->location_;
+ }
+ identified = 1;
+ }
+
+ if (this->ior_output_file_ != 0)
+ {
+ if (!identified)
+ {
+ this->identity_ = "file:";
+ this->identity_ += this->ior_output_file_;
+ // note: don't set identified--ns identity overrides file identitiy
+ }
+ result = write_ior (this->ior_output_file_, this->ior_. in ());
+ }
+ else
+ {
+ if (this->registered_)
+ {
+ // if we didn't register with a FactoryRegistry
+ // and no IOR file specified,
+ // then always try to register with name service
+ this->ns_name_ = "FT_ReplicaFactory";
+ }
+ }
+
+ if (this->ns_name_ != 0)
+ {
+ if (!identified)
+ {
+ this->identity_ = "name:";
+ this->identity_ += this->ns_name_;
+ }
+
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil(naming_obj.in ())){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%T %n (%P|%t) Unable to find the Naming Service\n"),
+ 1);
+ }
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->this_name_.length (1);
+ this->this_name_[0].id = CORBA::string_dup (this->ns_name_);
+
+ this->naming_context_->rebind (this->this_name_, this_obj.in() // CORBA::Object::_duplicate(this_obj)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ // if we're testing. Create a replica at startup time
+ if (this->test_output_file_ != 0)
+ {
+ // shouldn't be necessary, but create_replica assumes this
+ InternalGuard guard (this->internals_);
+ FT_TestReplica_i * replica = create_replica ("test" ACE_ENV_ARG_PARAMETER);
+
+ PortableServer::POA_var poa = replica->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ::CORBA::Object_var replica_obj = poa->servant_to_reference(replica ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ ::CORBA::String_var replicaIOR = this->orb_->object_to_string(replica_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ write_ior (this->test_output_file_, replicaIOR.in ());
+ }
+
+ return result;
+}
+
+int FT_ReplicaFactory_i::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->ior_output_file_ != 0)
+ {
+ ACE_OS::unlink (this->ior_output_file_);
+ this->ior_output_file_ = 0;
+ }
+ if (this->ns_name_ != 0)
+ {
+ this->naming_context_->unbind (this_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->ns_name_ = 0;
+ }
+
+ if (registered_)
+ {
+ registered_ = 0;
+
+ if (this->unregister_by_location_)
+ {
+ ACE_ERROR (( LM_INFO,
+ "%s: unregistering all factories at %s\n",
+ identity(),
+ location_
+ ));
+
+ PortableGroup::Location location(1);
+ location.length(1);
+ location[0].id = CORBA::string_dup(location_);
+ this->factory_registry_->unregister_factory_by_location (
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ size_t roleCount = roles_.size();
+ for (size_t nRole = 0; nRole < roleCount; ++nRole)
+ {
+ const char * roleName = this->roles_[nRole].c_str();
+ ACE_ERROR (( LM_INFO,
+ "Factory for: %s@%s unregistering from factory registry\n",
+ roleName,
+ location_
+ ));
+
+ PortableGroup::Location location(1);
+ location.length(1);
+ location[0].id = CORBA::string_dup(location_);
+ this->factory_registry_->unregister_factory (
+ roleName,
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+void FT_ReplicaFactory_i::remove_replica(CORBA::ULong id, FT_TestReplica_i * replica ACE_ENV_ARG_DECL)
+{
+ InternalGuard guard (this->internals_);
+ if (id < this->replicas_.size())
+ {
+ if(this->replicas_[id] == replica)
+ {
+ replica->fini(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ delete replica;
+ this->replicas_[id] = 0;
+ this->empty_slots_ += 1;
+ }
+ else
+ {
+ ACE_ERROR (( LM_ERROR,
+ "Remove replica %d mismatch.\n",
+ static_cast<int> (id)
+ ));
+ }
+ }
+ else
+ {
+ ACE_ERROR (( LM_ERROR,
+ "Attempt to remove invalid replica %d. Limit %d.\n",
+ static_cast<int> (id),
+ static_cast<int> (this->replicas_.size())
+ ));
+ }
+}
+
+//////////////////////////////////////////
+// FT_ReplicaFactory_i CORBA methods
+
+CORBA::Object_ptr FT_ReplicaFactory_i::create_object (
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::NoFactory
+ , PortableGroup::ObjectNotCreated
+ , PortableGroup::InvalidCriteria
+ , PortableGroup::InvalidProperty
+ , PortableGroup::CannotMeetCriteria
+ ))
+{
+ METHOD_ENTRY(FT_ReplicaFactory_i::create_object);
+ ACE_UNUSED_ARG (type_id);
+ InternalGuard guard (this->internals_);
+
+ ::TAO::PG_Property_Set decoder (the_criteria);
+
+ // boolean, becomes true if a required parameter is missing
+ int missingParameter = 0;
+ const char * missingParameterName = 0;
+
+ CORBA::Long initialValue = 0;
+ if (! ::TAO::find (decoder, criterion_initial_value, initialValue) )
+ {
+ // not required. Otherwise:
+ // missingParameter = 1;
+ // missingParameterName = criterion_initial_value;
+ }
+
+ const char * role = "replica";
+ if (! ::TAO::find (decoder, PortableGroup::role_criterion, role) )
+ {
+ ACE_ERROR((LM_INFO,
+ "Property \"%s\" not found?\n", PortableGroup::role_criterion
+ ));
+ // not required. Otherwise:
+ // missingParameter = 1;
+ // missingParameterName = PortableGroup::role_criterion;
+ }
+
+ if (missingParameter)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Throwing 'InvalidCriteria' due to missing %s\n",
+ missingParameterName
+ ));
+ ACE_THROW_RETURN ( PortableGroup::InvalidCriteria(), 0);
+ }
+
+ FT_TestReplica_i * replica = create_replica(role ACE_ENV_ARG_PARAMETER);
+ if (replica == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "New Replica_i returned NULL. Throwing ObjectNotCreated.\n"
+ ));
+ ACE_THROW_RETURN ( PortableGroup::ObjectNotCreated(), 0);
+ }
+
+ ACE_NEW_THROW_EX ( factory_creation_id,
+ PortableGroup::GenericFactory::FactoryCreationId,
+ PortableGroup::ObjectNotCreated());
+ CORBA::ULong factory_id = replica->factory_id();
+ (*factory_creation_id) <<= factory_id;
+
+ ACE_ERROR ((LM_INFO,
+ "Created %s@%s#%d.\n", role, this->location_, static_cast<int> (factory_id)
+ ));
+
+
+ ::CORBA::Object_ptr replica_obj =
+ replica->_default_POA(ACE_ENV_SINGLE_ARG_PARAMETER)->servant_to_reference(replica);
+ METHOD_RETURN(FT_ReplicaFactory_i::create_object) replica_obj->_duplicate(replica_obj);
+}
+
+FT_TestReplica_i * FT_ReplicaFactory_i::create_replica(const char * name ACE_ENV_ARG_DECL)
+{
+ // assume mutex is locked
+ CORBA::ULong factoryId = allocate_id();
+
+ FT_TestReplica_i * pFTReplica = 0;
+
+ ACE_NEW_NORETURN(pFTReplica, FT_TestReplica_i(
+ this,
+ name,
+ factoryId
+ ));
+
+ this->replicas_[factoryId] = pFTReplica;
+ this->empty_slots_ -= 1;
+
+ pFTReplica->init (this->orb_ ACE_ENV_ARG_PARAMETER);
+ return pFTReplica;
+}
+
+void FT_ReplicaFactory_i::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId & factory_creation_id
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectNotFound
+ ))
+{
+ METHOD_ENTRY(FT_ReplicaFactory_i::delete_object);
+
+ InternalGuard guard (this->internals_);
+
+ CORBA::ULong factoryId;
+ factory_creation_id >>= factoryId;
+ if (factoryId < this->replicas_.size())
+ {
+ if(this->replicas_[factoryId] != 0)
+ {
+ this->replicas_[factoryId]->request_quit();
+ }
+ else
+ {
+ ACE_THROW(::PortableGroup::ObjectNotFound());
+ }
+ }
+ else
+ {
+ ACE_THROW(::PortableGroup::ObjectNotFound());
+ }
+ METHOD_RETURN(FT_ReplicaFactory_i::delete_object);
+}
+
+CORBA::Boolean FT_ReplicaFactory_i::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ METHOD_RETURN(FT_ReplicaFactory_i::is_alive)
+ 1;
+}
+
+void FT_ReplicaFactory_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ METHOD_ENTRY(FT_FaultDetectorFactory_i::shutdown);
+ InternalGuard guard (this->internals_);
+ shutdown_i ();
+ this->quit_requested_ = 1;
+ METHOD_RETURN(FT_FaultDetectorFactory_i::shutdown);
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h b/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h
new file mode 100644
index 00000000000..a87cb08afe6
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_ReplicaFactory_i.h
@@ -0,0 +1,294 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_ReplicaFactory_i.h
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * It declares the implementation of ReplicaFactory which
+ * creates and manages replicas as an agent for
+ * the ReplicationManager as defined in the FT CORBA specification.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef FT_REPLICAFACTORY_H_
+#define FT_REPLICAFACTORY_H_
+#include <ace/ACE.h>
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+//////////////////////////////////
+// Classes declared in this header
+class FT_ReplicaFactory_i;
+
+/////////////////////////////////
+// Includes needed by this header
+#include <ace/Vector_T.h>
+#include "FT_TestReplicaS.h"
+#include <ace/Thread_Manager.h>
+#include <ace/SString.h>
+#include <orbsvcs/FT_ReplicationManagerC.h>
+
+/////////////////////
+// Forward references
+class TAO_ORB_Manager;
+class FT_TestReplica_i;
+
+/**
+ * Implement the GenericFactory interface.
+ */
+class FT_ReplicaFactory_i
+//FT_TEST::ReplicaFactory
+ : public virtual POA_PortableGroup::GenericFactory
+{
+ typedef ACE_Vector<FT_TestReplica_i *> ReplicaVec;
+ typedef ACE_Vector<ACE_CString> StringVec;
+
+ //////////////////////
+ // non-CORBA interface
+public:
+ /**
+ * Default constructor.
+ */
+ FT_ReplicaFactory_i ();
+
+ /**
+ * Virtual destructor.
+ */
+ virtual ~FT_ReplicaFactory_i ();
+
+ /**
+ * Parse command line arguments.
+ * @param argc traditional C argc
+ * @param argv traditional C argv
+ * @return zero for success; nonzero is process return code for failure.
+ */
+ int parse_args (int argc, char * argv[]);
+
+ /**
+ * Initialize this object.
+ * @param orb our ORB -- we keep var to it.
+ * @return zero for success; nonzero is process return code for failure.
+ */
+ int init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ /**
+ * Prepare to exit.
+ * @return zero for success; nonzero is process return code for failure.
+ */
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ int idle(int & result ACE_ENV_ARG_DECL);
+
+
+ /**
+ * Identify this replica factory.
+ * @return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ const char * location () const;
+
+ /**
+ * Remove pointer to individual replica; delete FT_TestReplica_i.
+ * See replica life cycle description.
+ * @param id the numerical id assigned to this replica.
+ * @param replica a pointer to the Replica object (redundant for safety.)
+ */
+ void remove_replica (CORBA::ULong id, FT_TestReplica_i * replica ACE_ENV_ARG_DECL);
+
+ //////////////////
+ // CORBA interface
+ // See IDL for documentation
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /////////////////////////////////////////
+ // CORBA interface GenericFactory methods
+ virtual CORBA::Object_ptr create_object (
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::NoFactory
+ , PortableGroup::ObjectNotCreated
+ , PortableGroup::InvalidCriteria
+ , PortableGroup::InvalidProperty
+ , PortableGroup::CannotMeetCriteria
+ ));
+
+ virtual void delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId & factory_creation_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , PortableGroup::ObjectNotFound
+ ));
+
+ //////////////////////////////////////////
+ // CORBA interface PullMonitorable methods
+
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /////////////////////////
+ // Implementation methods
+private:
+ /**
+ * Actual replica creation happens in this method.
+ * @param name becomes part of the objects identity.
+ */
+ FT_TestReplica_i * create_replica(const char * name ACE_ENV_ARG_DECL);
+
+ /**
+ * Find or allocate an ID for a new replica
+ */
+ CORBA::ULong allocate_id();
+
+ /**
+ * Write this factory's IOR to a file
+ */
+ int write_ior (const char * outputFile, const char * ior);
+
+ /**
+ * Clean house for factory shut down.
+ */
+ void shutdown_i ();
+
+ ///////////////
+ // Data Members
+private:
+
+ /**
+ * Protect internal state.
+ * Mutex should be locked by corba methods, or by
+ * external (public) methods before calling implementation
+ * methods.
+ * Implementation methods should assume the mutex is
+ * locked if necessary.
+ */
+ ACE_SYNCH_MUTEX internals_;
+ typedef ACE_Guard<ACE_SYNCH_MUTEX> InternalGuard;
+
+ /**
+ * The orb
+ */
+ CORBA::ORB_var orb_;
+
+ /**
+ * The POA used to activate this object.
+ */
+ PortableServer::POA_var poa_;
+
+ /**
+ * The CORBA object id assigned to this object.
+ */
+ PortableServer::ObjectId_var object_id_;
+
+ /**
+ * IOR of this object as assigned by poa
+ */
+ CORBA::String_var ior_;
+
+ /**
+ * A file to which the factory's IOR should be written.
+ */
+ const char * ior_output_file_;
+
+ /**
+ * A human-readable string to distinguish this from other Notifiers.
+ */
+ ACE_CString identity_;
+
+ /**
+ * bool: true if we found a replication manager
+ */
+ int have_replication_manager_;
+
+ /**
+ * The replication manager
+ */
+
+ ::FT::ReplicationManager_var replication_manager_;
+
+
+ /**
+ * The factory registry IOR
+ */
+ const char * factory_registry_ior_;
+
+ /**
+ * The factory registry with which to register.
+ */
+ PortableGroup::FactoryRegistry_var factory_registry_;
+
+ /**
+ * true if registered with FactoryRegistry
+ */
+ int registered_; // bool
+
+ /**
+ * A file to which the test replica's IOR will be written
+ */
+ const char * test_output_file_;
+
+ /**
+ * A name to be used to register the factory with the name service.
+ */
+ const char * ns_name_;
+
+ CosNaming::NamingContext_var naming_context_;
+
+ CosNaming::Name this_name_;
+
+ /////////////////
+ // The roles used to register types
+ StringVec roles_;
+
+ /**
+ * the PortableGroup::Location within the domain
+ */
+ const char * location_;
+
+ /**
+ * bool: quit on idle flag.
+ */
+ int quit_on_idle_;
+
+ /**
+ * bool: use a single call to unregister.
+ */
+ int unregister_by_location_;
+
+ /**
+ * A vector of Replicas. Note that the Replica ID
+ * is an index into this vector.
+ */
+ ReplicaVec replicas_;
+
+ /**
+ * count of entries in Replicas_ that have been deleted.
+ * Used to determine when the factory is idle and to avoid futile
+ * searches for empty slots.
+ */
+ size_t empty_slots_;
+
+ /**
+ * boolean: starts false. Set to true when it's time to quit.
+ */
+ int quit_requested_;
+
+};
+
+#endif /* FT_REPLICAFACTORY_H_ */
diff --git a/TAO/orbsvcs/tests/FT_App/FT_ReplicationManagerController.cpp b/TAO/orbsvcs/tests/FT_App/FT_ReplicationManagerController.cpp
new file mode 100755
index 00000000000..16f1f70eee4
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_ReplicationManagerController.cpp
@@ -0,0 +1,200 @@
+// $Id$
+
+#include "orbsvcs/FT_ReplicationManagerC.h"
+#include <ace/Get_Opt.h>
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_stdio.h"
+
+// A simple class for building a client that "controls' the
+// Replication Manager (right now it just shuts it down).
+class TAO_FT_ReplicationManagerController
+{
+/////////////////////////////
+// Public interface.
+public:
+ TAO_FT_ReplicationManagerController ();
+ virtual ~TAO_FT_ReplicationManagerController ();
+
+ int init (int & argc, char * argv[]);
+ int parse_args (int & argc, char* argv[]);
+ int run ();
+
+/////////////////////////////
+// Forbidden.
+private:
+ TAO_FT_ReplicationManagerController (
+ const TAO_FT_ReplicationManagerController & rhs);
+ TAO_FT_ReplicationManagerController & operator = (
+ const TAO_FT_ReplicationManagerController & rhs);
+
+/////////////////////////////
+// Private implementation.
+private:
+ void usage (FILE* out) const;
+
+/////////////////////////////
+// Data members.
+private:
+ CORBA::ORB_var orb_;
+ FT::ReplicationManager_var replication_manager_;
+ const char * rm_ior_;
+ int shutdown_;
+
+};
+
+TAO_FT_ReplicationManagerController::TAO_FT_ReplicationManagerController ()
+ : orb_ (CORBA::ORB::_nil())
+ , replication_manager_ (FT::ReplicationManager::_nil())
+ , rm_ior_ (0)
+ , shutdown_ (0)
+{
+}
+
+TAO_FT_ReplicationManagerController::~TAO_FT_ReplicationManagerController ()
+{
+}
+
+int TAO_FT_ReplicationManagerController::init (int & argc, char * argv[])
+{
+ int result = 0;
+
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize the ORB.
+ this->orb_ = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse arguments.
+ result = this->parse_args (argc, argv);
+ if (result == 0)
+ {
+ CORBA::Object_var obj = CORBA::Object::_nil ();
+ if (this->rm_ior_ != 0)
+ {
+ obj = this->orb_->string_to_object (
+ this->rm_ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ obj = this->orb_->resolve_initial_references (
+ "ReplicationManager" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ this->replication_manager_ = FT::ReplicationManager::_narrow (
+ obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (this->replication_manager_.in()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (
+ "TAO_FT_ReplicationManagerController::init: "
+ "Could not get Replication Manager's IOR.\n")
+ ));
+ result = -1;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT (
+ "TAO_FT_ReplicationManagerController::init: \n")
+ );
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
+
+
+int TAO_FT_ReplicationManagerController::parse_args (int & argc, char * argv[])
+{
+ int result = 0;
+
+ ACE_Get_Opt get_opts (argc, argv, "k:x");
+ int c;
+
+ while (result == 0 && (c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'k':
+ {
+ this->rm_ior_ = get_opts.opt_arg ();
+ break;
+ }
+
+ case 'x':
+ {
+ this->shutdown_ = 1;
+ break;
+ }
+
+ default:
+ ACE_OS::fprintf (stderr, "%s: Unknown argument - %c\n",
+ argv[0], c);
+ this->usage(stderr);
+ result = -1;
+ break;
+
+ case '?':
+ this->usage(stderr);
+ result = -1;
+ }
+ }
+
+ return result;
+}
+
+void TAO_FT_ReplicationManagerController::usage (FILE* out) const
+{
+ ACE_OS::fprintf (out, "usage"
+ " -k <replication manager ior file>"
+ " -x (shutdown the Replication Manager)\n");
+}
+
+int TAO_FT_ReplicationManagerController::run ()
+{
+ int result = 0;
+
+ ACE_TRY_NEW_ENV
+ {
+ if (this->shutdown_ == 1)
+ {
+ this->replication_manager_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_Time_Value tv (0, 500000);
+ ACE_OS::sleep (tv);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (
+ ACE_ANY_EXCEPTION,
+ ACE_TEXT (
+ "TAO_FT_ReplicationManagerController::run: \n")
+ );
+ result = -1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
+
+int main (int argc, char * argv[])
+{
+ int result = 0;
+ TAO_FT_ReplicationManagerController rmctrl;
+ result = rmctrl.init (argc, argv);
+ if (result == 0)
+ {
+ result = rmctrl.run ();
+ }
+ return result;
+}
+
diff --git a/TAO/orbsvcs/tests/FT_App/FT_TestReplica.idl b/TAO/orbsvcs/tests/FT_App/FT_TestReplica.idl
new file mode 100644
index 00000000000..b9d41ed7429
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_TestReplica.idl
@@ -0,0 +1,117 @@
+/* -*- IDL -*- */
+//=============================================================================
+/**
+ * @file FT_TestReplica.idl
+ *
+ * $Id$
+ *
+ * This file defines an interface used to test Fault Tolerant CORBA.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+//
+#ifndef FT_TESTREPLICA_IDL
+#define FT_TESTREPLICA_IDL
+
+#include "orbsvcs/FT_Replica.idl"
+
+module FT_TEST
+{
+ /**
+ * A FT_TEST::Replica provides a test target for a FT::FaultDetector
+ * It is Updateable (and therefore Checkpointable)
+ * and PullMonitorable
+ * It declares a simple counter that can be set, incremented, and read
+ * via method calls. The counter is also exposed as a property.
+ */
+ interface TestReplica : ::FT::Updateable, ::FT::PullMonitorable, ::PortableGroup::TAO_UpdateObjectGroup
+ {
+ /**
+ * set the counter to an specific value.
+ * @param value is the number to be set.
+ */
+ void set(in long value);
+
+ /**
+ * add delta to the counter.
+ * @param delta is the number to be added: (delta may be positive, negative or zero).
+ * @returns the new value of the counter.
+ */
+ long increment(in long delta);
+
+ /**
+ * retrieve the current counter.
+ * @returns the value of the counter.
+ */
+ long get();
+
+
+ /**
+ * enumerate the points at which
+ * the test replica might be convinced to die.
+ */
+ enum Bane
+ {
+ NOT_YET, // normal state, also used to revoke a previous request
+ RIGHT_NOW, // fault immediately during the die() call
+ WHILE_IDLE, // fault while not processing a request
+ // FT_TestReplica interface:
+ BEFORE_STATE_CHANGE, // after receiving request
+ BEFORE_REPLICATION, // after state change
+ BEFORE_REPLY, // after state replication
+ // FT::PullMonitorable interface:
+ DURING_IS_ALIVE,
+ DENY_IS_ALIVE,
+ // FT::Updatable interface:
+ DURING_GET_UPDATE,
+ BEFORE_SET_UPDATE,
+ AFTER_SET_UPDATE,
+ // FT::Checkpointable interface:
+ DURING_GET_STATE,
+ BEFORE_SET_STATE,
+ AFTER_SET_STATE,
+ // Reserved
+ CLEAN_EXIT // reserved for use by shutdown
+ };
+
+
+ /**
+ * die a horrid death.
+ * @param when is an arbitrary code to indicate how and when to die.
+ */
+ void die(in Bane when);
+
+
+ /**
+ * die a clean death.
+ */
+ oneway void shutdown();
+
+ /**
+ * provide direct access to the counter.
+ * Suports the same functionality as set and get.
+ * Can you say "Encapsulization???" this is a test, remember.
+ */
+ attribute long counter;
+ };
+
+ interface ReplicaFactory : ::PortableGroup::GenericFactory, ::FT::PullMonitorable
+ {
+ /**
+ * die a clean death.
+ */
+ oneway void shutdown();
+ };
+
+ ///////////////////////
+ // roles for unit tests
+ // A TestReplica can act as a...
+
+// typedef TestReplica Hobbit;
+// typedef TestReplica Elf;
+// typedef TestReplica Human;
+
+};
+
+#endif // for #ifndef FT_TESTREPLICA_IDL
diff --git a/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp b/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp
new file mode 100644
index 00000000000..ad89659b3bc
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.cpp
@@ -0,0 +1,484 @@
+// $Id$
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_TestReplica_i.cpp
+ *
+ * $Id$
+ *
+ * Implements CORBA interface TestReplica.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+//
+
+#include "FT_TestReplica_i.h"
+#include "FT_ReplicaFactory_i.h"
+#include "tao/ORB_Constants.h"
+#include "FT_TestReplicaC.h"
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+#include "ace/OS_NS_stdio.h"
+
+//////////////////
+// TestReplica_i
+
+namespace
+{
+ /**
+ * Endian neutral store of long into indexable object.
+ * BUFFER can be sequence of Octet, unsigned char[], etc.
+ *
+ * TODO: Find this a good home.
+ *
+ * @param state an object that supports char & operator[] (size_t index);
+ * @param offset is the position within state where the first character should be stored.
+ * @param value is the data to be inserted into state.
+ */
+ template<typename BUFFER>
+ void storeLong(BUFFER & state, size_t offset, long value)
+ {
+ state[offset ] = static_cast<unsigned char> (value >> 24);
+ state[offset + 1] = static_cast<unsigned char> (value >> 16);
+ state[offset + 2] = static_cast<unsigned char> (value >> 8);
+ state[offset + 3] = static_cast<unsigned char> (value );
+ }
+
+ /**
+ * Endian neutral load of long from indexable object.
+ * BUFFER can be sequence of Octet, unsigned char[], etc.
+ *
+ * TODO: Find this a good home.
+ *
+ * @param state an object that supports const char & operator[] (size_t index) const;
+ * @param offset is the position within state where the first character can be found
+ * @returns value is the data loaded from state.
+ */
+ template<typename BUFFER>
+ long loadLong(const BUFFER & state, size_t offset)
+ {
+ long result
+ = ((state[offset ] & 0xFF) << 24)
+ | ((state[offset + 1] & 0xFF) << 16)
+ | ((state[offset + 2] & 0xFF) << 8)
+ | ((state[offset + 3] & 0xFF) );
+ return result;
+ }
+}
+
+// NO_RESPONSE ->no reinvocation
+
+#define FAULT_CODE CORBA::TRANSIENT
+
+// Macros to simplify suicide.
+#define KEVORKIAN(value, method) \
+ if (this->death_pending_ == (FT_TEST::TestReplica::value)){ \
+ suicide (#value " in method " #method); \
+ ACE_THROW (FAULT_CODE ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO::VMCID, \
+ EFAULT), \
+ CORBA::COMPLETED_NO)); \
+ } else ;
+
+#define KEVORKIAN_DURING(method) \
+ if (this->death_pending_ == FT_TEST::TestReplica::BEFORE_REPLY ){\
+ suicide ("read-only method " #method); \
+ ACE_THROW (FAULT_CODE ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO::VMCID, \
+ EFAULT), \
+ CORBA::COMPLETED_NO)); \
+ } else ;
+
+#define KEVORKIAN_RETURN(value, method, result) \
+ if (this->death_pending_ == (FT_TEST::TestReplica::value)){ \
+ suicide (#value " in method " #method); \
+ ACE_THROW_RETURN (FAULT_CODE ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO::VMCID, \
+ EFAULT), \
+ CORBA::COMPLETED_NO), \
+ result); \
+ } else ;
+
+#define KEVORKIAN_DURING_RETURN(method, result) \
+ if (this->death_pending_ == FT_TEST::TestReplica::BEFORE_REPLY ){\
+ suicide ("read-only method " #method); \
+ ACE_THROW_RETURN (FAULT_CODE ( \
+ CORBA::SystemException::_tao_minor_code ( \
+ TAO::VMCID, \
+ EFAULT), \
+ CORBA::COMPLETED_NO), \
+ result); \
+ } else ;
+
+
+//////////////////////////////////////////////////
+// class FT_TestReplica_i construction/destruction
+
+FT_TestReplica_i::FT_TestReplica_i (FT_ReplicaFactory_i * factory, const char * name, unsigned long factory_id)
+ : death_pending_ (FT_TEST::TestReplica::NOT_YET)
+ , verbose_ (1)
+ , name_ (name)
+ , factory_id_ (factory_id)
+ , factory_ (factory)
+ , orb_ (0)
+ , poa_ (0)
+ , object_id_ (0)
+{
+// cout << name_.c_str() << '@' << this->factory_->location() << '#' << this->factory_id_ << " Construct" << endl;
+}
+
+FT_TestReplica_i::~FT_TestReplica_i ()
+{
+// cout << name_.c_str() << '@' << this->factory_->location() << '#' << this->factory_id_ << " Destruct" << endl;
+}
+
+
+void FT_TestReplica_i::suicide(const char * note)
+{
+ ACE_OS::fprintf (stdout, "%s@%s#%lu Simulate FAULT_CODE fault: %s\n",
+ name_.c_str(), this->factory_->location(), this->factory_id_, note);
+
+ // Tell the poa we aren't accepting future calls
+ this->poa_->deactivate_object (this->object_id_.in ());
+}
+
+/////////////////////////////////////////////////////
+// class FT_TestReplica_i public, non-CORBA interface
+
+
+
+//static
+const char * FT_TestReplica_i::repository_id()
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ const char * id =
+ FT_TEST::_tc_TestReplica->id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return id;
+}
+
+int
+FT_TestReplica_i::parse_args (int argc, char *argv[])
+{
+ ACE_UNUSED_ARG (argc);
+ ACE_UNUSED_ARG (argv);
+ return 0;
+}
+
+//static
+const char *
+FT_TestReplica_i::usage_options()
+{
+ return "";
+}
+
+unsigned long FT_TestReplica_i::factory_id()const
+{
+ return this->factory_id_;
+}
+
+::PortableServer::POA_ptr FT_TestReplica_i::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return ::PortableServer::POA::_duplicate(this->poa_.in ());
+}
+
+PortableServer::ObjectId FT_TestReplica_i::object_id()const
+{
+ return this->object_id_.in();
+}
+
+
+/**
+ * Initialize this object.
+ * @param orbManager our ORB -- we keep var to it.
+ * @return zero for success; nonzero is process return code for failure.
+ */
+int FT_TestReplica_i::init (CORBA::ORB_var & orb ACE_ENV_ARG_DECL)
+{
+ this->orb_ = orb;
+
+ // Use the ROOT POA for now
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references (TAO_OBJID_ROOTPOA
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+
+ // Get the POA object.
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil(this->poa_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to narrow the POA.\n")),
+ -1);
+ }
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ // Register with the POA.
+
+ this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void FT_TestReplica_i::_remove_ref (ACE_ENV_SINGLE_ARG_DECL)
+{
+ //////////////////////////////////////////////////
+ // WARNING: The following call invokes fini then deletes this object
+ this->factory_->remove_replica(this->factory_id_, this ACE_ENV_ARG_PARAMETER);
+}
+
+int FT_TestReplica_i::fini (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return 0;
+}
+
+
+
+/////////////////////////////////////////////////////
+// class FT_TestReplica_i: PullMonitorable interface
+CORBA::Boolean FT_TestReplica_i::is_alive (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ KEVORKIAN_RETURN(DURING_IS_ALIVE, is_alive, 0)
+ ACE_ERROR ((LM_ERROR,
+ "%s@%s#%d: is_alive: %d\n",
+ this->name_.c_str(),
+ this->factory_->location(),
+ this->factory_id_,
+ (this->death_pending_ != FT_TEST::TestReplica::DENY_IS_ALIVE)
+ ));
+
+ return this->death_pending_ != FT_TEST::TestReplica::DENY_IS_ALIVE;
+}
+
+/////////////////////////////////////////////////////
+// class FT_TestReplica_i: Updateable interface
+FT::State * FT_TestReplica_i::get_update (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::NoUpdateAvailable))
+{
+ KEVORKIAN_RETURN(DURING_GET_UPDATE, get_update, 0)
+ long counter = load();
+ ::FT::State_var vState = new ::FT::State;
+ vState->length(sizeof(counter));
+ storeLong(vState, 0, counter);
+ return vState._retn();
+}
+
+void FT_TestReplica_i::set_update (const FT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::InvalidUpdate))
+{
+#if defined(FT_TEST_LACKS_UPDATE)
+ ACE_THROW ( FT::InvalidUpdate () );
+#else // FT_TEST_LACKS_UPDATE
+ KEVORKIAN(BEFORE_SET_UPDATE, set_update)
+ long counter = loadLong<FT::State>(s, 0);
+ store(counter);
+ KEVORKIAN(AFTER_SET_UPDATE, set_update)
+#endif // FT_TEST_LACKS_UPDATE
+}
+
+/////////////////////////////////////////////////////
+// class FT_TestReplica_i: Checkpointable interface
+::FT::State * FT_TestReplica_i::get_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::NoStateAvailable))
+{
+#if defined(FT_TEST_LACKS_STATE)
+ ACE_THROW( FT::NoStateAvailable () );
+#else // FT_TEST_LACKS_STATE
+ KEVORKIAN_RETURN(DURING_GET_STATE, get_state, 0)
+ long counter = load();
+ ::FT::State_var vState = new ::FT::State;
+ vState->length(sizeof(counter));
+ storeLong(vState, 0, counter);
+ return vState._retn();
+#endif // FT_TEST_LACKS_STATE
+}
+
+void FT_TestReplica_i::set_state (const FT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::InvalidState))
+{
+#if defined(FT_TEST_LACKS_STATE)
+ ACE_THROW ( FT::InvalidState () );
+#else // FT_TEST_LACKS_STATE
+ KEVORKIAN(BEFORE_SET_STATE, set_state)
+ long counter = loadLong<FT::State>(s, 0);
+ store(counter);
+ KEVORKIAN(AFTER_SET_STATE, set_state)
+#endif // FT_TEST_LACKS_STATE
+}
+
+void FT_TestReplica_i::tao_update_object_group (
+ const char * iogr,
+ PortableGroup::ObjectGroupRefVersion version,
+ CORBA::Boolean is_primary
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG (iogr);
+ ACE_UNUSED_ARG (version);
+ ACE_UNUSED_ARG (is_primary);
+
+ ACE_THROW (CORBA::NO_IMPLEMENT());
+}
+
+//////////////////////////////
+// implement FT_TEST::Replica
+
+void FT_TestReplica_i::set (CORBA::Long value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ KEVORKIAN(BEFORE_STATE_CHANGE, set)
+ long counter = value;
+ store(counter);
+ KEVORKIAN(BEFORE_REPLY, set)
+}
+
+CORBA::Long FT_TestReplica_i::increment (CORBA::Long delta
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ KEVORKIAN_RETURN(BEFORE_STATE_CHANGE, increment, 0)
+ long counter = load ();
+ counter += delta;
+ store (counter);
+ KEVORKIAN_RETURN(BEFORE_REPLY, increment, 0)
+ return counter;
+}
+
+CORBA::Long FT_TestReplica_i::get (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ KEVORKIAN_DURING_RETURN(get, 0)
+ long counter = load ();
+ return counter;
+}
+
+CORBA::Long FT_TestReplica_i::counter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ KEVORKIAN_DURING_RETURN([get]counter, 0)
+ long counter = load ();
+ return counter;
+}
+
+void FT_TestReplica_i::counter (CORBA::Long counter
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ KEVORKIAN(BEFORE_STATE_CHANGE, [set]counter)
+ store (counter);
+ KEVORKIAN(BEFORE_REPLY, [set]counter)
+}
+
+void FT_TestReplica_i::die (FT_TEST::TestReplica::Bane when
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_OS::fprintf (stdout, "%s@%s#%lu Received death threat: %d\n",
+ name_.c_str(), this->factory_->location(), this->factory_id_, when);
+
+ this->death_pending_ = when;
+ KEVORKIAN(RIGHT_NOW, die)
+}
+
+void FT_TestReplica_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_OS::fprintf (stdout, "%s@%s#%lu Shut down requested\n",
+ name_.c_str(), this->factory_->location(), this->factory_id_);
+ this->death_pending_ = FT_TEST::TestReplica::CLEAN_EXIT;
+}
+
+//////////////////////////////////////////////
+// FT_TestReplica_i public non-CORBA interface
+int FT_TestReplica_i::idle (int & result ACE_ENV_ARG_DECL)
+{
+ int quit = 0;
+ if (this->death_pending_ == FT_TEST::TestReplica::WHILE_IDLE)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "%s@%s#%d: Simulated fault WHILE_IDLE",
+ this->name_.c_str(),
+ this->factory_->location(),
+ static_cast<int> (this->factory_id_ )
+ ));
+ this->poa_->deactivate_object (this->object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ result = 0;
+ quit = 1;
+ }
+ else if (this->death_pending_ == FT_TEST::TestReplica::CLEAN_EXIT)
+ {
+ this->poa_->deactivate_object (this->object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ result = 0;
+ quit = 1;
+ }
+ return quit;
+}
+
+void FT_TestReplica_i::request_quit()
+{
+ this->death_pending_ = FT_TEST::TestReplica::WHILE_IDLE;
+}
+
+
+void FT_TestReplica_i::store(long counter)
+{
+ FILE * f = ACE_OS::fopen("Persistent.dat", "w");
+ if(f != 0)
+ {
+ unsigned char* buffer = 0;
+ ACE_NEW (buffer, unsigned char [sizeof(long)]);
+ storeLong(buffer, 0, counter);
+ ACE_OS::fwrite(buffer, 1, sizeof(long), f);
+ ACE_OS::fclose(f);
+ if (this->verbose_)
+ {
+ ACE_OS::fprintf (stdout, "%s@%s#%lu :%ld\n",
+ name_.c_str(), this->factory_->location(), this->factory_id_, counter);
+ }
+ delete[] buffer;
+ buffer = 0;
+ }
+}
+
+long FT_TestReplica_i::load ()
+{
+ long counter = 0;
+ FILE * f = ACE_OS::fopen("Persistent.dat","r");
+ if(f != 0)
+ {
+ unsigned char buffer[sizeof(long)];
+ ACE_OS::fread(buffer, 1, sizeof(long), f);
+ ACE_OS::fclose(f);
+ counter = loadLong<unsigned char *>(buffer, 0);
+ }
+ return counter;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.h b/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.h
new file mode 100644
index 00000000000..77551ea21a0
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/FT_TestReplica_i.h
@@ -0,0 +1,219 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file FT_TestReplica_i.h
+ *
+ * $Id$
+ *
+ * This file declares an implementation of CORBA interface TestReplica.
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+//
+#ifndef FT_TESTREPLICA_I_H_
+#define FT_TESTREPLICA_I_H_
+#include /**/ "ace/pre.h"
+
+#include <ace/ACE.h>
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+
+#include "FT_TestReplicaS.h"
+
+////////////////////
+// Forward Reference
+class FT_ReplicaFactory_i;
+
+/**
+ * Implement the TestReplica IDL interface.
+ *
+ * Persistent storage simulated by storing the counter
+ * in Persistent.dat.
+ */
+class FT_TestReplica_i : public virtual POA_FT_TEST::TestReplica
+{
+public:
+ FT_TestReplica_i (FT_ReplicaFactory_i * factory, const char * name, unsigned long factory_id);
+ virtual ~FT_TestReplica_i ();
+
+ /**
+ * parse command line arguments.
+ * remove any that are recognized, adjusting argc accordingly.
+ * @param argc classic C argc
+ * @param argv classic C argv
+ * @return 0 if ok, otherwise process exit code.
+ */
+ int parse_args (int argc, char *argv[]);
+
+ /**
+ * provide information to appear in a "usage" display.
+ * caller will display:
+ * usage: [program] &lt;usageMessage()&gt; [other usage]
+ * @returns c-style string containing "bare" usage options.
+ */
+ const char * usage_options();
+
+ /**
+ * Initialize this object.
+ * @param orbManager our ORB -- we keep var to it.
+ * @return zero for success; nonzero is process return code for failure.
+ */
+ int init (CORBA::ORB_var & orb ACE_ENV_ARG_DECL);
+
+ /**
+ * Prepare to exit.
+ * @return zero for success; nonzero is process return code for failure.
+ */
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * idle time activity.
+ * @param result [out] status code to return from process
+ * @returns 0 to continue; nonzero to quit
+ */
+ int idle(int &result ACE_ENV_ARG_DECL);
+
+ void request_quit();
+
+ unsigned long factory_id()const;
+
+ static const char * repository_id();
+
+ ::FT_TEST::TestReplica_ptr object_reference();
+
+ PortableServer::ObjectId object_id()const;
+
+ //////////////////////////////////////////
+ // Override CORBA servant virtual methods
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+ virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ ///////////////////////////
+ // override Replica methods
+ virtual void set (CORBA::Long value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC (( CORBA::SystemException));
+
+ virtual CORBA::Long increment (CORBA::Long delta
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Long get (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Long counter (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void counter (CORBA::Long counter
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void die (FT_TEST::TestReplica::Bane when
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ///////////////////////////
+ // override PullMonitorable
+
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ///////////////////////////
+ // override Updatable
+
+ virtual ::FT::State * get_update (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::NoUpdateAvailable));
+
+ virtual void set_update (const FT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::InvalidUpdate));
+
+ virtual ::FT::State * get_state (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::NoStateAvailable));
+
+ virtual void set_state (const FT::State & s ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException, FT::InvalidState));
+
+ ////////////////
+ // Implement TAO_UpdateObjectGroup
+
+ virtual void tao_update_object_group (
+ const char * iogr,
+ PortableGroup::ObjectGroupRefVersion version,
+ CORBA::Boolean is_primary
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /////////////////
+ // implementation
+private:
+ /**
+ * Load the persistent data.
+ * returns the data loaded.
+ */
+ long load();
+ /**
+ * Store the persistent data.
+ * @param value the data to be stored.
+ */
+ void store(long value);
+
+ void suicide(const char *);
+
+ ///////////////
+ // data members
+private:
+ /**
+ * a bane code for when we should die.
+ */
+ FT_TEST::TestReplica::Bane death_pending_;
+
+ /**
+ * verbosity level, settable by client.
+ */
+ int verbose_;
+
+ /**
+ * who am I?
+ */
+ ACE_CString name_;
+
+ /**
+ * The ID number assigned by the factory
+ */
+ unsigned long factory_id_;
+
+ /**
+ * The factory that created this replica
+ */
+ FT_ReplicaFactory_i * factory_;
+
+ /**
+ * The orb
+ */
+ CORBA::ORB_var orb_;
+
+ /**
+ * The POA used to activate this object.
+ */
+ PortableServer::POA_var poa_;
+
+ /**
+ * The CORBA object id assigned to this object.
+ */
+ PortableServer::ObjectId_var object_id_;
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* FT_TESTREPLICA_I_H_ */
diff --git a/TAO/orbsvcs/tests/FT_App/Makefile.am b/TAO/orbsvcs/tests/FT_App/Makefile.am
new file mode 100644
index 00000000000..1ce5367ba13
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/Makefile.am
@@ -0,0 +1,489 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.FT_App_Analyzer.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ft_analyzer
+
+ft_analyzer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ft_analyzer_SOURCES = \
+ FTAPP_Analyzer_Main.cpp \
+ StubBatchConsumer.cpp \
+ StubFaultAnalyzer.cpp \
+ StubFaultConsumer.cpp \
+ StubBatchConsumer.h \
+ StubFaultAnalyzer.h \
+ StubFaultConsumer.h
+
+ft_analyzer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_App_Idl.am
+
+BUILT_SOURCES = \
+ FT_TestReplicaC.cpp \
+ FT_TestReplicaC.h \
+ FT_TestReplicaC.inl \
+ FT_TestReplicaS.cpp \
+ FT_TestReplicaS.h \
+ FT_TestReplicaS.inl \
+ FT_TestReplicaS_T.cpp \
+ FT_TestReplicaS_T.h \
+ FT_TestReplicaS_T.inl
+
+CLEANFILES = \
+ FT_TestReplica-stamp \
+ FT_TestReplicaC.cpp \
+ FT_TestReplicaC.h \
+ FT_TestReplicaC.inl \
+ FT_TestReplicaS.cpp \
+ FT_TestReplicaS.h \
+ FT_TestReplicaS.inl \
+ FT_TestReplicaS_T.cpp \
+ FT_TestReplicaS_T.h \
+ FT_TestReplicaS_T.inl
+
+FT_TestReplicaC.cpp FT_TestReplicaC.h FT_TestReplicaC.inl FT_TestReplicaS.cpp FT_TestReplicaS.h FT_TestReplicaS.inl FT_TestReplicaS_T.cpp FT_TestReplicaS_T.h FT_TestReplicaS_T.inl: FT_TestReplica-stamp
+
+FT_TestReplica-stamp: $(srcdir)/FT_TestReplica.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/FT_TestReplica.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ FT_TestReplica.idl
+
+## Makefile.FT_App_Client.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ft_client
+
+ft_client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ft_client_SOURCES = \
+ FT_Client.cpp \
+ FT_TestReplicaC.cpp \
+ FT_Creator.h \
+ FT_ReplicaFactory_i.h \
+ FT_TestReplica_i.h \
+ ReplicationManagerFaultConsumerAdapter.h \
+ StubBatchConsumer.h \
+ StubFaultAnalyzer.h \
+ StubFaultConsumer.h \
+ StubFaultNotifier.h \
+ TAO_Object_Group_Creator.h
+
+ft_client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_App_Creator.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ft_create
+
+ft_create_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ft_create_SOURCES = \
+ FT_Creator.cpp \
+ TAO_Object_Group_Creator.cpp \
+ FT_Creator.h \
+ TAO_Object_Group_Creator.h
+
+ft_create_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_App_FactoryRegistry.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ft_registry
+
+ft_registry_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ft_registry_SOURCES = \
+ FTAPP_FactoryRegistry_Main.cpp
+
+ft_registry_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_App_FaultConsumer.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ft_fault_consumer
+
+ft_fault_consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ft_fault_consumer_SOURCES = \
+ FTAPP_FaultConsumer_Main.cpp \
+ ReplicationManagerFaultConsumerAdapter.cpp \
+ ReplicationManagerFaultConsumerAdapter.h
+
+ft_fault_consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/FT_ReplicationManager/libTAO_ReplicationManagerLib.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_App_Notifier.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ft_notifier
+
+ft_notifier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ft_notifier_SOURCES = \
+ FTAPP_Notifier_Main.cpp \
+ StubFaultNotifier.cpp \
+ StubFaultNotifier.h
+
+ft_notifier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_App_RMController.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += replmgr_controller
+
+replmgr_controller_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+replmgr_controller_SOURCES = \
+ FT_ReplicationManagerController.cpp \
+ FT_Creator.h \
+ FT_ReplicaFactory_i.h \
+ FT_TestReplica_i.h \
+ ReplicationManagerFaultConsumerAdapter.h \
+ StubBatchConsumer.h \
+ StubFaultAnalyzer.h \
+ StubFaultConsumer.h \
+ StubFaultNotifier.h \
+ TAO_Object_Group_Creator.h
+
+replmgr_controller_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FT_App_Server.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ft_replica
+
+ft_replica_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ft_replica_SOURCES = \
+ FT_Replica.cpp \
+ FT_ReplicaFactory_i.cpp \
+ FT_TestReplicaC.cpp \
+ FT_TestReplicaS.cpp \
+ FT_TestReplica_i.cpp \
+ FT_ReplicaFactory_i.h \
+ FT_TestReplica_i.h
+
+ft_replica_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/FT_App/README b/TAO/orbsvcs/tests/FT_App/README
new file mode 100644
index 00000000000..33b790044b6
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/README
@@ -0,0 +1,88 @@
+$Id$
+
+This is a simple application intended to test Fault Tolerant Corba.
+
+The server implements GenericFactory as a factory that creates TestReplicas.
+TestReplicas are defined in the IDL in FT_TestReplica.idl.
+
+FT_TEST::TestReplica inherits from PullMonitorable and Checkpointable
+to provide access needed by FT Corba's FaultDetector and Orb.
+
+An FT_TEST::TestReplica contains a long counter. Methods are defined
+to set, increment, and get the value of the counter. The counter
+is also exposed as an attribute named counter. (i.e. set(x) is
+exactly equivalent to counter(x), and get() is exactly equivalent
+to counter())
+
+In addition there is a method named die that lets the client request
+a server "failure" at a variety of interesting times. See the "die"
+command to find out when death can be scheduled.
+
+The client provides a command interface to operate on the server.
+Tests may be run manually by typing commands, or may be automated by
+reading the commands from a file.
+
+Commands consist of a single character followed by an optional number
+(with no space between). For example: =10 sets the value of the counter
+to 10. +5 increments the counter by 5 (thereby setting the value to 15).
+
+The '?' commmand lists the possible commands and their options.
+
+Additional programs:
+ ft_notifier is a stub implementation of a fault notifier for testing fault detectors.
+ ft_analyzer is a stub implementation of a fault analyzer for testing the fault notifier
+ ft_registry is an implementation of FactoryRegistry for testing GenericFactories.
+
+To run:
+Start one or more FT_Replicas. Use a -o <filename> to tell the replica
+where to write its ior..
+
+Start the FT_Client with -f file1<,filen>... (i.e. a comma separated list
+of replica IOR files. To read commands from a file, use -c <command file>
+
+The counter is persistent and will survive server failures. It's
+stored in a file named persistent.dat.
+
+Replicas of the server may be run in separate directories to simulate
+replicated stateful objects (each replica has its own distinct state), or
+multiple replicas can be run in the same directory to simulate a server
+with a shared state or one that executes real-world unsafe-to-repeat
+action (i.e. "fire the retro rockets" or "expose the patient to
+theraputic radiation.")
+
+Unit Tests based on this application:
+
+ run_test_basic.pl
+ tests ft_client and ft_replica, thereby answering the question,
+ "who will test the tester?".
+
+ run_test_detector.pl
+ uses ft_client, ft_replica, and ft_notifier (a "stub" fault notifier)
+ to test the Fault_Detector (from orbsvcs)
+
+ run_test_notifier.pl
+ uses ft_client, ft_replica, Fault_Detector and ft_analyzer (a "stub" fault analyzer)
+ to test the Fault_Notifier (from orbsvcs)
+
+ run_test_fault_consumer.pl
+ uses ft_client, ft_replica, Fault_Detector, Fault_Notifier to test
+ ft_fault_consumer (the implementation of a fault consumer)
+
+ run_test_registry.pl
+ uses ft_client, ft_replica, and ft_creator to test ft_registry
+ (i.e. to test the implementation of PortableServer::FactoryRegistry)
+
+ run_test_rmregistry.pl
+ uses ft_client, ft_replica, and ft_creator to test the FactoryRegistery
+ implementation in the ReplicationManager.
+
+
+ run_test_rmnotifier.pl
+ uses ft_client, ft_replica, Fault_Detector to test the connection between
+ the Fault_Notifier and the ReplicationManager
+
+ demo.pl
+ tests the entire FT system.
+
+
+See the internal documentation of the .pl files for more details.
diff --git a/TAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.cpp b/TAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.cpp
new file mode 100755
index 00000000000..12357cb9297
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.cpp
@@ -0,0 +1,379 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "ReplicationManagerFaultConsumerAdapter.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+#include "orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h"
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+#include "ace/OS_NS_stdio.h"
+
+ReplicationManagerFaultConsumerAdapter::ReplicationManagerFaultConsumerAdapter()
+ : orb_(CORBA::ORB::_nil())
+ , quit_(0)
+ , readyFile_(0)
+ , detector_ior_(0)
+ , factory_(FT::FaultDetectorFactory::_nil())
+ , notifier_ior_(0)
+ , notifier_(FT::FaultNotifier::_nil())
+ , p_fault_consumer_(0)
+ , consumer_servant_(0)
+{
+}
+
+
+ReplicationManagerFaultConsumerAdapter::~ReplicationManagerFaultConsumerAdapter()
+{
+}
+
+size_t ReplicationManagerFaultConsumerAdapter::notifications () const
+{
+ // Delegate to the FT_FaultConsumer.
+ return this->p_fault_consumer_->notifications ();
+}
+
+
+int ReplicationManagerFaultConsumerAdapter::parse_args (int argc, char * argv[])
+{
+ int optionError = 0;
+ ACE_Get_Opt get_opts (argc, argv, "o:r:d:n:");
+ int c;
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'r':
+ {
+ this->replica_iors_.push_back (get_opts.opt_arg ());
+ break;
+ }
+ case 'd':
+ {
+ this->detector_ior_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'n':
+ {
+ this->notifier_ior_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'o':
+ {
+ this->readyFile_ = get_opts.opt_arg ();
+ break;
+ }
+
+ default:
+ // fall thru
+ case '?':
+ {
+ break;
+ }
+ }
+ }
+
+ if(! optionError)
+ {
+ if (0 == this->replica_iors_.size())
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-r option is required.\n"
+ ));
+ optionError = -1;
+ }
+ if (0 == this->detector_ior_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-d option is required.\n"
+ ));
+ optionError = -1;
+ }
+ }
+
+ if(optionError)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s"
+ " -r <replica.ior[ -r replica.ior]>"
+ " -d <detector.ior>"
+ " -o <this.ior>"
+ " -n <nameService name>"
+ "\n",
+ argv [0]
+ ));
+ }
+ return optionError;
+}
+
+/**
+ * Register this object.
+ */
+int ReplicationManagerFaultConsumerAdapter::init (
+ CORBA::ORB_ptr orb
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Entered ReplicationManagerFaultConsumerAdapter::init.\n")
+ ));
+
+ int result = 0;
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ //////////////////////////////////////////
+ // resolve reference to detector factory
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("Getting ready to read iorDetectorFile.\n")
+ ));
+
+ CORBA::Object_var detector_obj = this->orb_->string_to_object (
+ this->detector_ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->factory_ = ::FT::FaultDetectorFactory::_narrow (
+ detector_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil (this->factory_.in()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("FaultDetectorFactory IOR is nil: %s\n"),
+ this->detector_ior_),
+ -1);
+ }
+
+ //////////////////////////////////////////
+ // resolve references to notifier
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("Getting ready to read Notifier IOR file.\n")
+ ));
+
+ CORBA::Object_var notifier_ior = this->orb_->string_to_object (
+ this->notifier_ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->notifier_ = ::FT::FaultNotifier::_narrow (
+ notifier_ior.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil (this->notifier_.in()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("FaultNotifier IOR is nil: %s\n"),
+ this->notifier_ior_),
+ -1);
+ }
+
+ // Create the real FaultConsumer.
+ //
+ // Note: We have to hang onto the servant class pointer so we can
+ // invoke member functions on it, but we also give ownership of it
+ // to a PortableServer::ServantBase_var.
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("Getting ready to create the real FaultConsumer.\n")
+ ));
+
+ ACE_NEW_RETURN (this->p_fault_consumer_, TAO::FT_FaultConsumer (), -1);
+ if (this->p_fault_consumer_ != 0)
+ {
+ this->consumer_servant_ = this->p_fault_consumer_;
+ }
+
+ //////////////////////////
+ // Get ready to initialize the consumer. We need to provide it
+ // with the following:
+ // - The POA in which it is to be activated.
+ // - FT::FaultNotifier IOR.
+ // - FT::ReplicationManager IOR (fake it for now).
+
+ // Get the RootPOA from the ORB.
+ CORBA::Object_var poa_obj = this->orb_->resolve_initial_references (
+ "RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ PortableServer::POA_var poa = PortableServer::POA::_narrow (
+ poa_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create a fault analyzer.
+ TAO::FT_FaultAnalyzer * analyzer = 0;
+ ACE_NEW_RETURN (analyzer, TAO::FT_DefaultFaultAnalyzer (), -1);
+
+ // Initialize the FaultConsumer.
+ // It will activate itself in the POA we pass it and connect to the
+ // Fault Notifier we pass it.
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("Getting ready to initialize the real FaultConsumer.\n")
+ ));
+
+ result = this->p_fault_consumer_->init (
+ poa.in(),
+ this->notifier_.in(),
+ analyzer
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (result != 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("Unable to initialize the real FaultConsumer.\n")),
+ result);
+ }
+
+ this->identity_ = "ReplicationManagerFaultConsumerAdapter";
+
+ // Activate the RootPOA.
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /////////////////////////
+ // Set up fault detectors
+ if (result == 0)
+ {
+ ////////////////////////////////////
+ // resolve references to replicas
+ // create a fault detector for each replica
+ size_t replicaCount = this->replica_iors_.size();
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Number of replicas being monitored: (%u)\n"),
+ static_cast<unsigned int> (replicaCount)
+ ));
+ for (size_t nRep = 0; result == 0 && nRep < replicaCount; ++nRep)
+ {
+ const char * iorName = this->replica_iors_[nRep];
+ CORBA::Object_var replica_obj = this->orb_->string_to_object (
+ iorName ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ FT::PullMonitorable_var replica = FT::PullMonitorable::_narrow (
+ replica_obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil(replica.in()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("Can't resolve Replica IOR: %s\n"),
+ iorName),
+ -1);
+ }
+ else
+ {
+ this->replicas_.push_back(replica);
+
+ CORBA::String_var type_id = CORBA::string_dup("FaultDetector");
+
+ TAO_PG::Properties_Encoder encoder;
+
+ PortableGroup::Value value;
+ value <<= notifier_.in ();
+ encoder.add(::FT::FT_NOTIFIER, value);
+
+ value <<= replica.in ();
+ encoder.add(::FT::FT_MONITORABLE, value);
+
+ FT::FTDomainId domain_id = 0;
+ value <<= domain_id;
+ encoder.add(::FT::FT_DOMAIN_ID, value);
+
+ PortableGroup::Location object_location;
+ object_location.length(2);
+ object_location[0].id = CORBA::string_dup("test");
+ object_location[1].id = CORBA::string_dup("Location_A");
+ value <<= object_location;
+ encoder.add(::FT::FT_LOCATION, value);
+
+ PortableGroup::TypeId_var object_type = CORBA::string_dup (
+ "IDL:org.omg/CosNaming/NamingContextExt:1.0");
+ value <<= object_type.in ();
+ encoder.add(::FT::FT_TYPE_ID, value);
+
+ PortableGroup::ObjectGroupId group_id =
+ static_cast<PortableGroup::ObjectGroupId> (6191982);
+ value <<= group_id;
+ encoder.add(::FT::FT_GROUP_ID, value);
+
+ // allocate and populate the criteria
+ PortableGroup::Criteria_var criteria;
+ ACE_NEW_NORETURN (criteria,
+ PortableGroup::Criteria);
+ if (criteria.ptr() == 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("ReplicationManagerFaultConsumerAdapter::init: ")
+ ACE_TEXT ("Error cannot allocate criteria.\n")),
+ -1);
+ }
+ else
+ {
+ encoder.encode(criteria);
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_creation_id;
+
+ this->factory_->create_object (
+ type_id.in(),
+ criteria.in(),
+ factory_creation_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+ }
+
+ // Signal that we are ready to go.
+ if (result == 0 && this->readyFile_ != 0)
+ {
+ FILE* ready = ACE_OS::fopen (this->readyFile_, "w");
+ if (ready)
+ {
+ ACE_OS::fprintf (ready, "ready\n");
+ ACE_OS::fclose (ready);
+ }
+ }
+ }
+
+ return result;
+}
+
+/**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+const char * ReplicationManagerFaultConsumerAdapter::identity () const
+{
+ return this->identity_.c_str();
+}
+
+/**
+ * Clean house for process shut down.
+ */
+int ReplicationManagerFaultConsumerAdapter::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Delegate to the FT_FaultConsumer.
+ return this->p_fault_consumer_->fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+
+int ReplicationManagerFaultConsumerAdapter::idle(int & result
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG(result);
+ int quit = 0;
+
+ if (this->replicas_.size() == this->p_fault_consumer_->notifications())
+ {
+ quit = 1;
+ }
+ return quit;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.h b/TAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.h
new file mode 100755
index 00000000000..6b45d786a6e
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/ReplicationManagerFaultConsumerAdapter.h
@@ -0,0 +1,151 @@
+// -*- C++ -*-
+//
+// $Id$
+#ifndef REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H
+#define REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H
+#include /**/ <ace/pre.h>
+#include <ace/ACE.h>
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include <orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h>
+#include <orbsvcs/FT_NotifierC.h>
+#include <orbsvcs/FT_FaultDetectorFactoryC.h>
+#include <ace/Vector_T.h>
+#include <ace/SString.h>
+
+/////////////////////
+// Class declarations
+
+/**
+ * An adapter to the Replication Manager's fault consumer
+ * for use in unit testing Fault Notifier and Fault Consumer.
+ */
+class ReplicationManagerFaultConsumerAdapter
+{
+public:
+ /**
+ * Default constructor.
+ */
+ ReplicationManagerFaultConsumerAdapter ();
+
+ /**
+ * virtual destructor.
+ */
+ virtual ~ReplicationManagerFaultConsumerAdapter ();
+
+ /**
+ * Parse command line arguments.
+ */
+ int parse_args (int argc, char * argv[]);
+
+ /**
+ * Initialize this object
+ */
+ int init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ /**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * idle time activity.
+ * @param result [out] status code to return from process
+ * @returns 0 to continue; nonzero to quit
+ */
+ int idle(int &result ACE_ENV_ARG_DECL);
+
+ /**
+ * Clean house for process shut down.
+ */
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+
+ size_t notifications() const;
+
+ /////////////////
+ // Implementation
+private:
+
+ ////////////////////
+ // Forbidden methods
+private:
+ ReplicationManagerFaultConsumerAdapter (
+ const ReplicationManagerFaultConsumerAdapter & rhs);
+ ReplicationManagerFaultConsumerAdapter & operator =
+ (const ReplicationManagerFaultConsumerAdapter & rhs);
+
+ /////////////////////////
+ // Implementation methods
+private:
+
+ ///////////////
+ // Data Members
+private:
+ /**
+ * The orb
+ */
+ CORBA::ORB_var orb_;
+
+ /**
+ * A human-readable string to distinguish this from other FaultConsumers.
+ */
+ ACE_CString identity_;
+
+ /**
+ * boolean: request quit
+ */
+ int quit_;
+
+ /**
+ * a file to write to to signal "ready"
+ */
+ const char * readyFile_;
+
+ /**
+ * Detecor's IOR
+ */
+ const char * detector_ior_;
+
+ /**
+ * The FaultDetectorFactory object reference.
+ */
+ ::FT::FaultDetectorFactory_var factory_;
+
+ /**
+ * A collection of replica IORs
+ */
+ ACE_Vector < const char * > replica_iors_;
+
+ /**
+ * A collection of replica references.
+ */
+ ACE_Vector < FT::PullMonitorable_var > replicas_;
+
+ /**
+ * A file from which the notifier's IOR should be read.
+ */
+ const char * notifier_ior_;
+
+ /**
+ * the fault notifier
+ */
+ ::FT::FaultNotifier_var notifier_;
+
+ /**
+ * consumer id assigned by the notifier
+ */
+ ::FT::FaultNotifier::ConsumerId consumerId_;
+
+ /**
+ * the real fault consumer
+ */
+ TAO::FT_FaultConsumer* p_fault_consumer_;
+ PortableServer::ServantBase_var consumer_servant_;
+
+};
+#include /**/ <ace/post.h>
+
+#endif /* REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H */
diff --git a/TAO/orbsvcs/tests/FT_App/StubBatchConsumer.cpp b/TAO/orbsvcs/tests/FT_App/StubBatchConsumer.cpp
new file mode 100644
index 00000000000..6d0e445511f
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubBatchConsumer.cpp
@@ -0,0 +1,172 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "StubBatchConsumer.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+
+StubBatchConsumer::StubBatchConsumer ()
+ : quit_(0)
+{
+}
+
+
+StubBatchConsumer::~StubBatchConsumer ()
+{
+}
+
+
+int StubBatchConsumer::parse_args (int argc, char * argv[])
+{
+ ACE_UNUSED_ARG (argc);
+ ACE_UNUSED_ARG (argv);
+ int optionError = 0;
+ // No options for now
+ return optionError;
+}
+
+
+::PortableServer::POA_ptr StubBatchConsumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return ::PortableServer::POA::_duplicate(this->poa_.in ());
+}
+
+PortableServer::ObjectId StubBatchConsumer::objectId()const
+{
+ return this->object_id_.in();
+}
+
+
+/**
+ * register this object
+ */
+int StubBatchConsumer::init (CORBA::ORB_ptr orb, ::FT::FaultNotifier_var & notifier ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->notifier_ = notifier;
+ this->identity_ = "StubBatchConsumer";
+
+
+ // Use the ROOT POA for now
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references (TAO_OBJID_ROOTPOA
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+
+ // Get the POA .
+ this->poa_ = PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil(this->poa_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to narrow the POA.\n")),
+ -1);
+ }
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register with the POA.
+
+ this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // find my identity as an object
+
+ CORBA::Object_var this_obj =
+ this->poa_->id_to_reference (object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyFilter::Filter_var filter = CosNotifyFilter::Filter::_nil();
+
+ this->consumer_id_ = notifier->connect_sequence_fault_consumer(
+ CosNotifyComm::SequencePushConsumer::_narrow(this_obj.in ()),
+ filter.in ());
+
+ return result;
+}
+
+/**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+const char * StubBatchConsumer::identity () const
+{
+ return this->identity_.c_str();
+}
+
+/**
+ * Clean house for process shut down.
+ */
+void StubBatchConsumer::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->notifier_->disconnect_consumer(this->consumer_id_ ACE_ENV_ARG_PARAMETER);
+}
+
+
+int StubBatchConsumer::idle(int & result)
+{
+ ACE_UNUSED_ARG(result);
+ return this->quit_;
+}
+
+////////////////
+// CORBA methods
+
+
+//virtual
+void StubBatchConsumer::push_structured_events (
+ const CosNotification::EventBatch & notifications
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventComm::Disconnected
+ ))
+{
+ ACE_UNUSED_ARG (notifications);
+ //@@ sequence of structured event handling not written yet
+}
+
+void StubBatchConsumer::offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_ERROR ((LM_ERROR,
+ "StubBatchConsumer: offer_change call ignored.\n"
+ ));
+ // @@ not implemented (not likely to be needed)
+}
+
+//virtual
+void StubBatchConsumer::disconnect_sequence_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_ERROR ((LM_ERROR,
+ "StubBatchConsumer:disconnect_sequence_push_consumer interpreted as quit request.\n"
+ ));
+ this->quit_ = 1;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/StubBatchConsumer.h b/TAO/orbsvcs/tests/FT_App/StubBatchConsumer.h
new file mode 100644
index 00000000000..60df5048d5b
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubBatchConsumer.h
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+//
+// $Id$
+#ifndef STUBBATCHCONSUMER_H
+#define STUBBATCHCONSUMER_H
+#include /**/ <ace/pre.h>
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include <orbsvcs/CosNotifyChannelAdminS.h>
+#include <orbsvcs/FT_NotifierC.h>
+
+#include "ace/SString.h"
+
+//////////////////////
+// Forward references
+
+/////////////////////
+// Class declarations
+
+/**
+ * A stub fault consumer for use in unit testing Fault Notifier.
+ */
+class StubBatchConsumer
+ : public virtual POA_CosNotifyComm::SequencePushConsumer
+{
+public:
+ /**
+ * Default constructor.
+ */
+ StubBatchConsumer ();
+
+ /**
+ * virtual destructor.
+ */
+ virtual ~StubBatchConsumer ();
+
+ ::PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ ::PortableServer::ObjectId objectId()const;
+
+ /**
+ * Parse command line arguments.
+ */
+ int parse_args (int argc, char * argv[]);
+
+ /**
+ * Publish this objects IOR.
+ */
+ int init (CORBA::ORB_ptr orbManager, ::FT::FaultNotifier_var & notifier ACE_ENV_ARG_DECL);
+
+ /**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * idle time activity.
+ * @param result [out] status code to return from process
+ * @returns 0 to continue; nonzero to quit
+ */
+ int idle(int &result);
+
+ /**
+ * Clean house for process shut down.
+ */
+ void fini (ACE_ENV_SINGLE_ARG_DECL);
+
+
+public:
+
+ ////////////////
+ // CORBA methods
+
+ virtual void push_structured_events (
+ const CosNotification::EventBatch & notifications
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventComm::Disconnected
+ ));
+
+ virtual void disconnect_sequence_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException, CosNotifyComm::InvalidEventType
+ ));
+
+ ////////////////////
+ // Forbidden methods
+private:
+ StubBatchConsumer (const StubBatchConsumer & rhs);
+ StubBatchConsumer & operator = (const StubBatchConsumer & rhs);
+
+ /////////////////////////
+ // Implementation methods
+private:
+
+ ///////////////
+ // Data Members
+private:
+ /**
+ * The orb
+ */
+ CORBA::ORB_var orb_;
+
+ /**
+ * The POA used to activate this object.
+ */
+ PortableServer::POA_var poa_;
+
+ /**
+ * The CORBA object id assigned to this object.
+ */
+ PortableServer::ObjectId_var object_id_;
+
+ /**
+ * A human-readable string to distinguish this from other FaultConsumers.
+ */
+ ACE_CString identity_;
+
+ /**
+ * boolean: request quit
+ */
+ int quit_;
+
+ /**
+ * the notifier
+ */
+ ::FT::FaultNotifier_var notifier_;
+
+ /**
+ * consumer id assigned by the notifier
+ */
+ ::FT::FaultNotifier::ConsumerId consumer_id_;
+};
+
+#include /**/ <ace/post.h>
+
+#endif /* STUBBATCHCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.cpp b/TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.cpp
new file mode 100644
index 00000000000..56731cf5f59
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.cpp
@@ -0,0 +1,272 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "StubFaultAnalyzer.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+#include "ace/OS_NS_stdio.h"
+
+StubFaultAnalyzer::StubFaultAnalyzer ()
+ : readyFile_(0)
+ , detector_ior_(0)
+ , notifier_ior_(0)
+{
+}
+
+
+StubFaultAnalyzer::~StubFaultAnalyzer ()
+{
+}
+
+
+int StubFaultAnalyzer::parse_args (int argc, char * argv[])
+{
+ int optionError = 0;
+ ACE_Get_Opt get_opts (argc, argv, "o:r:d:n:");
+ int c;
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'r':
+ {
+ this->replicaIORs.push_back (get_opts.opt_arg ());
+ break;
+ }
+ case 'd':
+ {
+ this->detector_ior_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'n':
+ {
+ this->notifier_ior_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'o':
+ {
+ this->readyFile_ = get_opts.opt_arg ();
+ break;
+ }
+
+ default:
+ // fall thru
+ case '?':
+ {
+ break;
+ }
+ }
+ }
+
+ if(! optionError)
+ {
+ if (0 == replicaIORs.size())
+ {
+ ACE_ERROR ((LM_ERROR,
+ "at least one -r option is required.\n"
+ ));
+ optionError = -1;
+ }
+
+ if (0 == this->detector_ior_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-d option is required.\n"
+ ));
+ optionError = -1;
+ }
+ if (0 == this->notifier_ior_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-n option is required.\n"
+ ));
+ optionError = -1;
+ }
+ }
+
+ if(optionError)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s"
+ " -r <replica.ior[,replica.ior]>"
+ " -d <detector.ior>"
+ " -o <ready.file>" // note: not an IOR file. just an "I'm alive" indicator."
+ " -n <notifier.ior>"
+ "\n",
+ argv [0]
+ ));
+ }
+ return optionError;
+}
+
+/**
+ * Register this object as necessary
+ */
+int StubFaultAnalyzer::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ //////////////////////////////////////////
+ // resolve reference to detector factory
+ CORBA::Object_var detector_obj = this->orb_->string_to_object(this->detector_ior_);
+ this->factory_ = ::FT::FaultDetectorFactory::_narrow(detector_obj.in ());
+ if (CORBA::is_nil(this->factory_.in ()))
+ {
+ ACE_OS::fprintf (stderr, "Can't resolve Detector Factory IOR %s\n", this->detector_ior_);
+ result = -1;
+ }
+
+ //////////////////////////////////////////
+ // resolve references to notifier
+ CORBA::Object_var not_obj = this->orb_->string_to_object(this->notifier_ior_);
+ this->notifier_ = ::FT::FaultNotifier::_narrow(not_obj.in ());
+ if (CORBA::is_nil(this->notifier_.in ()))
+ {
+ ACE_OS::fprintf (stderr, "Can't resolve Notifier IOR %s\n", this->notifier_ior_);
+ result = -1;
+ }
+
+
+ //////////////////////////////////
+ // register fault consumers
+ if (result == 0)
+ {
+ result = this->faultConsumer_.init (orb, this->notifier_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ if (result == 0)
+ {
+ result = this->batchConsumer_.init (orb, this->notifier_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ /////////////////////////
+ // Set up fault detectors
+ if (result == 0)
+ {
+ ////////////////////////////////////
+ // resolve references to replicas
+ // create a fault detector for each replica
+ size_t replicaCount = this->replicaIORs.size();
+ for(size_t nRep = 0; result == 0 && nRep < replicaCount; ++nRep)
+ {
+ const char * iorName = this->replicaIORs[nRep];
+ CORBA::Object_var rep_obj = this->orb_->string_to_object(iorName);
+ FT::PullMonitorable_var replica = FT::PullMonitorable::_narrow(rep_obj.in ());
+ if (CORBA::is_nil(replica.in ()))
+ {
+ ACE_OS::fprintf (stderr, "Can't resolve Replica IOR %s\n", iorName);
+ result = -1;
+ }
+ else
+ {
+ this->replicas_.push_back(replica);
+
+ CORBA::String_var type_id = CORBA::string_dup("FaultDetector");
+
+ TAO_PG::Properties_Encoder encoder;
+
+ PortableGroup::Value value;
+ value <<= this->notifier_.in ();
+ encoder.add(::FT::FT_NOTIFIER, value);
+
+ value <<= replica.in ();
+ encoder.add(::FT::FT_MONITORABLE, value);
+
+ FT::FTDomainId domain_id = 0;
+ value <<= domain_id;
+ encoder.add(::FT::FT_DOMAIN_ID, value);
+
+ PortableGroup::Location object_location;
+ object_location.length(1);
+ object_location[0].id = CORBA::string_dup("Test location");
+ value <<= object_location;
+ encoder.add(::FT::FT_LOCATION, value);
+
+ PortableGroup::TypeId object_type = CORBA::string_dup("dummy_type");
+ value <<= object_type;
+ encoder.add(::FT::FT_TYPE_ID, value);
+
+ FT::ObjectGroupId group_id = 0;
+ value <<= group_id;
+ encoder.add(::FT::FT_GROUP_ID, value);
+
+ // allocate and populate the criteria
+ PortableGroup::Criteria_var criteria;
+ ACE_NEW_NORETURN (criteria,
+ PortableGroup::Criteria);
+ if (criteria.ptr() == 0)
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error cannot allocate criteria.\n"
+ ));
+ result = -1;
+ }
+ else
+ {
+ encoder.encode(criteria);
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_creation_id;
+
+ ACE_DEBUG((LM_DEBUG,
+ "Call create_object with type: %s\n", type_id.in()
+ ));
+ this->factory_->create_object (
+ type_id.in(),
+ criteria.in(),
+ factory_creation_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+ }
+
+ if (result == 0 && this->readyFile_ != 0)
+ {
+ FILE *ready = ACE_OS::fopen (this->readyFile_, "w");
+ if ( ready )
+ {
+ ACE_OS::fprintf (ready, "ready\n");
+ ACE_OS::fclose (ready);
+ }
+ }
+ }
+ return result;
+}
+
+
+/**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+const char * StubFaultAnalyzer::identity () const
+{
+ return this->identity_.c_str();
+}
+
+/**
+ * Clean house for process shut down.
+ */
+int StubFaultAnalyzer::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->faultConsumer_.fini(ACE_ENV_SINGLE_ARG_PARAMETER);
+ this->batchConsumer_.fini(ACE_ENV_SINGLE_ARG_PARAMETER);
+ return 0;
+}
+
+
+int StubFaultAnalyzer::idle(int & result ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG(result);
+ int quit = 0;
+
+ if (this->replicas_.size() == this->faultConsumer_.notifications())
+ {
+ quit = 1;
+ }
+ return quit;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.h b/TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.h
new file mode 100644
index 00000000000..2a5067ad4a2
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubFaultAnalyzer.h
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+//
+// $Id$
+#ifndef STUBFAULTANALYZER_H
+#define STUBFAULTANALYZER_H
+#include /**/ <ace/pre.h>
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "StubFaultConsumer.h"
+#include "StubBatchConsumer.h"
+#include <orbsvcs/FT_NotifierC.h>
+#include <orbsvcs/FT_FaultDetectorFactoryC.h>
+
+#include "ace/Vector_T.h"
+#include "ace/SString.h"
+
+//////////////////////
+// Forward references
+
+/////////////////////
+// Class declarations
+
+/**
+ * A stub fault analyzer for use in unit testing.
+ */
+class StubFaultAnalyzer
+{
+public:
+ /**
+ * Default constructor.
+ */
+ StubFaultAnalyzer ();
+
+ /**
+ * destructor.
+ */
+ ~StubFaultAnalyzer ();
+
+ /**
+ * Parse command line arguments.
+ */
+ int parse_args (int argc, char * argv[]);
+
+ /**
+ * Initialize this object
+ */
+ int init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ /**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * idle time activity.
+ * @param result [out] status code to return from process
+ * @returns 0 to continue; nonzero to quit
+ */
+ int idle(int &result ACE_ENV_ARG_DECL);
+
+ /**
+ * Prepare to exit.
+ * @return zero for success; nonzero is process return code for failure.
+ */
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ /////////////////
+ // Implementation
+private:
+ int readIORFile(const char * fileName, CORBA::String_var & ior);
+
+ ///////////////
+ // Data Members
+private:
+ /**
+ * The orb
+ */
+ CORBA::ORB_var orb_;
+
+ /**
+ * The POA used to activate this object.
+ */
+ PortableServer::POA_var poa_;
+
+ /**
+ * The CORBA object id assigned to this object.
+ */
+ PortableServer::ObjectId_var objectId_;
+
+ /**
+ * A human-readable string to distinguish this from other Notifiers.
+ */
+ ACE_CString identity_;
+
+ /**
+ * a file to write to to signal "ready"
+ */
+ const char * readyFile_;
+
+ /**
+ * The detecor's IOR (-d option)
+ */
+ const char * detector_ior_;
+
+ ::FT::FaultDetectorFactory_var factory_;
+
+ /**
+ * The notifier's IOR (-n option)
+ */
+ const char * notifier_ior_;
+
+ ::FT::FaultNotifier_var notifier_;
+
+ /**
+ * A collection of files containing replica IORs
+ */
+ ACE_Vector < const char * > replicaIORs;
+
+ ACE_Vector < FT::PullMonitorable_var > replicas_;
+
+
+ StubFaultConsumer faultConsumer_;
+ StubBatchConsumer batchConsumer_;
+
+};
+
+#include /**/ <ace/post.h>
+
+#endif /* STUBFAULTANALYZER_H */
diff --git a/TAO/orbsvcs/tests/FT_App/StubFaultConsumer.cpp b/TAO/orbsvcs/tests/FT_App/StubFaultConsumer.cpp
new file mode 100644
index 00000000000..25a2934df15
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubFaultConsumer.cpp
@@ -0,0 +1,311 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "StubFaultConsumer.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+
+StubFaultConsumer::StubFaultConsumer ()
+ : quit_(0)
+ , notifications_(0)
+{
+}
+
+
+StubFaultConsumer::~StubFaultConsumer ()
+{
+}
+
+::PortableServer::POA_ptr StubFaultConsumer::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return ::PortableServer::POA::_duplicate(this->poa_.in ());
+}
+
+PortableServer::ObjectId StubFaultConsumer::objectId()const
+{
+ return this->object_id_.in();
+}
+
+size_t StubFaultConsumer::notifications () const
+{
+ return this->notifications_;
+}
+
+
+int StubFaultConsumer::parse_args (int argc, char * argv[])
+{
+ int optionError = 0;
+#ifndef NO_ARGS_FOR_NOW
+ ACE_UNUSED_ARG (argc);
+ ACE_UNUSED_ARG (argv);
+#else // NO_ARGS_FOR_NOW
+ ACE_Get_Opt get_opts (argc, argv, "");
+ int c;
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'r':
+ {
+ if (this->replicaIorBuffer_ == 0)
+ {
+ const char * repNames = get_opts.opt_arg ();
+ size_t repNameLen = ACE_OS::strlen(repNames);
+
+ // make a working copy of the string
+ ACE_NEW_NORETURN(this->replicaIorBuffer_,
+ char[repNameLen + 1]);
+ if ( this->replicaIorBuffer_ != 0)
+ {
+ ACE_OS::memcpy(this->replicaIorBuffer_, repNames, repNameLen+1);
+
+ // tokenize the string on ','
+ // into iorReplicaFiles_
+ char * pos = this->replicaIorBuffer_;
+ while (pos != 0)
+ {
+ this->iorReplicaFiles_.push_back(pos);
+ // find a comma delimiter, and
+ // chop the string there.
+ pos = ACE_OS::strchr (pos, ',');
+ if (pos != 0)
+ {
+ *pos = '\0';
+ pos += 1;
+ }
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Command line option error: -r can't allocate buffer.\n"
+ ));
+ optionError = -1;
+ }
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Command line option error: -r specified more than once.\n"
+ ));
+ optionError = -1;
+ }
+ break;
+ }
+ case 'd':
+ {
+ this->iorDetectorFile_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'n':
+ {
+ this->nsName_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'o':
+ {
+ this->iorOutputFile_ = get_opts.opt_arg ();
+ break;
+ }
+
+ default:
+ // fall thru
+ case '?':
+ {
+ break;
+ }
+ }
+ }
+
+ if(! optionError)
+ {
+ if (0 == this->replicaIorBuffer_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-r option is required.\n"
+ ));
+ optionError = -1;
+ }
+ if (0 == this->iorDetectorFile_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-d option is required.\n"
+ ));
+ optionError = -1;
+ }
+ }
+
+ if(optionError)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s"
+ " -r <replica.ior[,replica.ior]>"
+ " -d <detector.ior>"
+ " -o <this.ior>"
+ " -n <nameService name>"
+ "\n",
+ argv [0]
+ ));
+ }
+#endif /* NO_ARGS_FOR_NOW */
+ return optionError;
+}
+
+/**
+ * Register this object.
+ */
+int StubFaultConsumer::init (CORBA::ORB_ptr orb,
+ ::FT::FaultNotifier_var & notifier
+ ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+ this->notifier_ = notifier;
+ this->identity_ = "StubFaultConsumer";
+
+
+ // Use the ROOT POA for now
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references (TAO_OBJID_ROOTPOA
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+
+ // Get the POA object.
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+ if (CORBA::is_nil(this->poa_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to narrow the POA.\n")),
+ -1);
+ }
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register with the POA.
+
+ this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // find my identity as an object
+
+ CORBA::Object_var this_obj =
+ this->poa_->id_to_reference (object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyFilter::Filter_var filter = CosNotifyFilter::Filter::_nil();
+
+ this->consumer_id_ = notifier->connect_structured_fault_consumer(
+ CosNotifyComm::StructuredPushConsumer::_narrow(this_obj.in ()),
+ filter.in ());
+
+ return result;
+}
+
+/**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+const char * StubFaultConsumer::identity () const
+{
+ return this->identity_.c_str();
+}
+
+/**
+ * Clean house for process shut down.
+ */
+int StubFaultConsumer::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->notifier_->disconnect_consumer(this->consumer_id_ ACE_ENV_ARG_PARAMETER);
+ return 0;
+}
+
+
+int StubFaultConsumer::idle(int & result)
+{
+ ACE_UNUSED_ARG(result);
+ return this->quit_;
+}
+
+////////////////
+// CORBA methods
+void StubFaultConsumer::push_structured_event(
+ const CosNotification::StructuredEvent &notification
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected))
+{
+ ////////////////////////////////////////
+ // keep track of how many we've received
+ this->notifications_ += 1;
+ ACE_ERROR ((LM_ERROR,
+ "FaultConsumer: Received Fault notification(%d):\n"
+ "FaultConsumer: Header EventType domain: %s\n"
+ "FaultConsumer: Header EventType type: %s\n"
+ "FaultConsumer: Header EventName: %s\n",
+ static_cast<unsigned int> (this->notifications_),
+ static_cast<const char *> (notification.header.fixed_header.event_type.domain_name),
+ static_cast<const char *> (notification.header.fixed_header.event_type.type_name),
+ static_cast<const char *> (notification.header.fixed_header.event_name)
+ ));
+ const CosNotification::FilterableEventBody & filterable = notification.filterable_data;
+
+ size_t propertyCount = filterable.length ();
+ for (size_t nProp = 0; nProp < propertyCount; ++nProp)
+ {
+ const CosNotification::Property & property = filterable[nProp];
+
+ const char * property_name = static_cast<const char *> (property.name);
+ const char * value = "<unknown>";
+ if (property.value >>= value )
+ {
+ // ok!
+ }
+ ACE_ERROR ((LM_ERROR,
+ "FaultConsumer: Property Name: %s=%s\n",
+ property_name,
+ value
+ ));
+
+
+// int todo_finish_decode;
+ }
+
+}
+
+void StubFaultConsumer::offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_ERROR ((LM_ERROR,
+ "StubFaultConsumer: offer_change call ignored.\n"
+ ));
+}
+
+void StubFaultConsumer::disconnect_structured_push_consumer(ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_ERROR ((LM_ERROR,
+ "StubFaultConsumer:disconnect_structured_push_consumer interpreted as quit request.\n"
+ ));
+ this->quit_ = 1;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/StubFaultConsumer.h b/TAO/orbsvcs/tests/FT_App/StubFaultConsumer.h
new file mode 100644
index 00000000000..4e8603710e1
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubFaultConsumer.h
@@ -0,0 +1,152 @@
+// -*- C++ -*-
+//
+// $Id$
+#ifndef STUBFAULTCONSUMER_H
+#define STUBFAULTCONSUMER_H
+#include /**/ <ace/pre.h>
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include <orbsvcs/FT_NotifierC.h>
+
+#include "ace/SString.h"
+
+
+//////////////////////
+// Forward references
+
+/////////////////////
+// Class declarations
+
+/**
+ * A stub fault consumer for use in unit testing Fault Notifier.
+ */
+class StubFaultConsumer
+ : public virtual POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ /**
+ * Default constructor.
+ */
+ StubFaultConsumer ();
+
+ /**
+ * virtual destructor.
+ */
+ virtual ~StubFaultConsumer ();
+
+
+ ::PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+ ::PortableServer::ObjectId objectId()const;
+
+ /**
+ * Parse command line arguments.
+ */
+ int parse_args (int argc, char * argv[]);
+
+ /**
+ * Publish this objects IOR.
+ */
+ int init (CORBA::ORB_ptr orb, ::FT::FaultNotifier_var & notifier
+ ACE_ENV_ARG_DECL);
+
+ /**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * idle time activity.
+ * @param result [out] status code to return from process
+ * @returns 0 to continue; nonzero to quit
+ */
+ int idle(int &result);
+
+ /**
+ * Clean house for process shut down.
+ */
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+
+ size_t notifications() const;
+
+public:
+
+ ////////////////
+ // CORBA methods
+ virtual void push_structured_event(
+ const CosNotification::StructuredEvent &notification
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected));
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosNotifyComm::InvalidEventType));
+
+ virtual void disconnect_structured_push_consumer(ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ////////////////////
+ // Forbidden methods
+private:
+ StubFaultConsumer (const StubFaultConsumer & rhs);
+ StubFaultConsumer & operator = (const StubFaultConsumer & rhs);
+
+ /////////////////////////
+ // Implementation methods
+private:
+
+ ///////////////
+ // Data Members
+private:
+ /**
+ * The orb
+ */
+ CORBA::ORB_var orb_;
+
+ /**
+ * The POA used to activate this object.
+ */
+ PortableServer::POA_var poa_;
+
+ /**
+ * The CORBA object id assigned to this object.
+ */
+ PortableServer::ObjectId_var object_id_;
+
+
+ /**
+ * A human-readable string to distinguish this from other FaultConsumers.
+ */
+ ACE_CString identity_;
+
+ /**
+ * boolean: request quit
+ */
+ int quit_;
+
+ /**
+ * the notifier
+ */
+ ::FT::FaultNotifier_var notifier_;
+
+ /**
+ * consumer id assigned by the notifier
+ */
+ ::FT::FaultNotifier::ConsumerId consumer_id_;
+
+ size_t notifications_;
+
+};
+
+#include /**/ <ace/post.h>
+
+#endif /* STUBFAULTCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/FT_App/StubFaultNotifier.cpp b/TAO/orbsvcs/tests/FT_App/StubFaultNotifier.cpp
new file mode 100644
index 00000000000..24c320efb8e
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubFaultNotifier.cpp
@@ -0,0 +1,485 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "StubFaultNotifier.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+
+StubFaultNotifier::StubFaultNotifier ()
+ : ior_output_file_(0)
+ , detector_ior_(0)
+ , ns_name_(0)
+{
+}
+
+
+StubFaultNotifier::~StubFaultNotifier ()
+{
+}
+
+
+::PortableServer::POA_ptr StubFaultNotifier::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ return ::PortableServer::POA::_duplicate(this->poa_.in ());
+}
+
+PortableServer::ObjectId StubFaultNotifier::objectId()const
+{
+ return this->object_id_.in();
+}
+
+int StubFaultNotifier::parse_args (int argc, char * argv[])
+{
+ int optionError = 0;
+ ACE_Get_Opt get_opts (argc, argv, "o:r:d:n:");
+ int c;
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'r':
+ {
+ this->iorReplicaFiles_.push_back( get_opts.opt_arg ());
+ break;
+ }
+ case 'd':
+ {
+ this->detector_ior_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'n':
+ {
+ this->ns_name_ = get_opts.opt_arg ();
+ break;
+ }
+ case 'o':
+ {
+ this->ior_output_file_ = get_opts.opt_arg ();
+ break;
+ }
+
+ default:
+ // fall thru
+ case '?':
+ {
+ break;
+ }
+ }
+ }
+
+ if(! optionError)
+ {
+ if (iorReplicaFiles_.size() == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-r option is required.\n"
+ ));
+ optionError = -1;
+ }
+ if (0 == this->detector_ior_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "-d option is required.\n"
+ ));
+ optionError = -1;
+ }
+ }
+
+ if(optionError)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "usage: %s"
+ " -r <replica.ior [-r <replica2.ior]...>"
+ " -d <detector.ior>"
+ " -o <this.ior>"
+ " -n <nameService name>"
+ "\n",
+ argv [0]
+ ));
+ }
+ return optionError;
+}
+
+/**
+ * Prepare to exit.
+ */
+int StubFaultNotifier::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if(this->ns_name_ != 0)
+ {
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (CORBA::is_nil(naming_obj.in ())){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%T %n (%P|%t) Unable to find the Naming Service\n"),
+ 1);
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ CosNaming::Name this_name (1);
+ this_name.length (1);
+ this_name[0].id = CORBA::string_dup (this->ns_name_);
+
+ naming_context->unbind (this_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ }
+ return 0;
+}
+
+
+/**
+ * Publish this objects IOR.
+ */
+int StubFaultNotifier::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ // Use the ROOT POA for now
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references (TAO_OBJID_ROOTPOA
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to initialize the POA.\n")),
+ -1);
+
+ // Get the POA object.
+ this->poa_ =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil(this->poa_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to narrow the POA.\n")),
+ -1);
+ }
+
+ PortableServer::POAManager_var poa_manager =
+ this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Register with the POA.
+
+ this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // find my identity as a corba object
+ CORBA::Object_var this_obj =
+ this->poa_->id_to_reference (object_id_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ //////////////////////////////////////////
+ // resolve references to detector factory
+
+ CORBA::Object_var obj = this->orb_->string_to_object(detector_ior_);
+ this->factory_ = ::FT::FaultDetectorFactory::_narrow(obj.in ());
+ if (CORBA::is_nil(this->factory_.in ()))
+ {
+ ACE_OS::fprintf (stderr, "Can't resolve Detector Factory IOR %s\n", this->detector_ior_);
+ result = -1;
+ }
+ if (result == 0)
+ {
+ ////////////////////////////////////
+ // resolve references to replicas
+ size_t replicaCount = this->iorReplicaFiles_.size();
+ for(size_t nRep = 0; result == 0 && nRep < replicaCount; ++nRep)
+ {
+ const char * iorName = this->iorReplicaFiles_[nRep];
+ CORBA::Object_var obj = this->orb_->string_to_object(iorName);
+ FT::PullMonitorable_var replica = FT::PullMonitorable::_narrow(obj.in ());
+ if (CORBA::is_nil(replica.in ()))
+ {
+ ACE_OS::fprintf (stderr, "Can't resolve Replica IOR %s\n", iorName);
+ result = -1;
+ }
+ else
+ {
+ this->replicas_.push_back(replica);
+
+ CORBA::String_var type_id = CORBA::string_dup("FaultDetector");
+
+ TAO_PG::Properties_Encoder encoder;
+
+ PortableGroup::Value value;
+ //////////////////
+ // FaultDetectorFactory gets picky about FaultNotifier's object type.
+ // coddle it.
+ ::FT::FaultNotifier_var notifier = ::FT::FaultNotifier::_narrow(this_obj.in ());
+ value <<= notifier.in ();
+ encoder.add(::FT::FT_NOTIFIER, value);
+
+
+ value <<= replica.in ();
+ encoder.add(::FT::FT_MONITORABLE, value);
+
+ FT::FTDomainId domain_id = 0;
+ value <<= domain_id;
+ encoder.add(::FT::FT_DOMAIN_ID, value);
+
+ PortableGroup::Location object_location;
+ object_location.length(1);
+ object_location[0].id = CORBA::string_dup("Test location");
+ value <<= object_location;
+ encoder.add(::FT::FT_LOCATION, value);
+
+ PortableGroup::TypeId object_type = 0;
+ value <<= object_type;
+ encoder.add(::FT::FT_TYPE_ID, value);
+
+ PortableGroup::ObjectGroupId group_id = 0;
+ value <<= group_id;
+ encoder.add(::FT::FT_GROUP_ID, value);
+
+ // allocate and populate the criteria
+ PortableGroup::Criteria_var criteria;
+ ACE_NEW_NORETURN (criteria,
+ PortableGroup::Criteria);
+ if (criteria.ptr() == 0)
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error cannot allocate criteria.\n"
+ ));
+ result = -1;
+ }
+ else
+ {
+ encoder.encode(criteria);
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_creation_id;
+
+ this->factory_->create_object (
+ type_id.in(),
+ criteria.in(),
+ factory_creation_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+ }
+
+ if (this->ior_output_file_ != 0)
+ {
+ this->identity_ = "file:";
+ this->identity_ += this->ior_output_file_;
+ result = write_ior_file();
+ }
+ else
+ {
+ // if no IOR file specified,
+ // then always try to register with name service
+ this->ns_name_ = "FT_FaultNotifier";
+ }
+
+ if(this->ns_name_ != 0)
+ {
+ this->identity_ = "name:";
+ this->identity_ += this->ns_name_;
+
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil(naming_obj.in ())){
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%T %n (%P|%t) Unable to find the Naming Service\n"),
+ 1);
+ }
+
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNaming::Name this_name (1);
+ this_name.length (1);
+ this_name[0].id = CORBA::string_dup (this->ns_name_);
+
+ naming_context->rebind (this_name, this_obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+ return result;
+}
+
+int StubFaultNotifier::write_ior_file()
+{
+ int result = -1;
+ FILE* out = ACE_OS::fopen (this->ior_output_file_, "w");
+ if (out)
+ {
+ ACE_OS::fprintf (out, "%s", this->ior_.in ());
+ ACE_OS::fclose (out);
+ result = 0;
+ }
+ return result;
+}
+
+/**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+const char * StubFaultNotifier::identity () const
+{
+ return this->identity_.c_str();
+}
+
+/**
+ * Clean house for process shut down.
+ */
+void StubFaultNotifier::shutdown_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+void StubFaultNotifier::push_structured_fault (
+ const CosNotification::StructuredEvent & event
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_ERROR ((LM_ERROR,
+ "FaultNotifier: Received Fault notification:\n"
+ "FaultNotifier: Header EventType domain: %s\n"
+ "FaultNotifier: Header EventType type: %s\n"
+ "FaultNotifier: Header EventName: %s\n",
+ static_cast<const char *> (event.header.fixed_header.event_type.domain_name),
+ static_cast<const char *> (event.header.fixed_header.event_type.type_name),
+ static_cast<const char *> (event.header.fixed_header.event_name)
+ ));
+ const CosNotification::FilterableEventBody & filterable = event.filterable_data;
+
+ size_t propertyCount = filterable.length ();
+ for (size_t nProp = 0; nProp < propertyCount; ++nProp)
+ {
+ const CosNotification::Property & property = filterable[nProp];
+ ACE_ERROR ((LM_ERROR,
+ "FaultNotifier: Property Name: %s\n",
+ static_cast<const char *> (property.name)
+ ));
+ //@@ we could stand to decode more--just for completeness
+ }
+}
+
+
+void StubFaultNotifier::push_sequence_fault (
+ const CosNotification::EventBatch & events
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_UNUSED_ARG (events);
+ ACE_THROW (CORBA::NO_IMPLEMENT());
+}
+
+::CosNotifyFilter::Filter_ptr StubFaultNotifier::create_subscription_filter (
+ const char * constraint_grammar
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosNotifyFilter::InvalidGrammar
+ ))
+{
+ ACE_UNUSED_ARG (constraint_grammar);
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT(), 0);
+ return 0;
+}
+
+
+FT::FaultNotifier::ConsumerId StubFaultNotifier::connect_structured_fault_consumer (
+ CosNotifyComm::StructuredPushConsumer_ptr push_consumer,
+ CosNotifyFilter::Filter_ptr filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_UNUSED_ARG(push_consumer);
+ ACE_UNUSED_ARG(filter);
+
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT(), 0);
+ return 0;
+}
+
+
+FT::FaultNotifier::ConsumerId StubFaultNotifier::connect_sequence_fault_consumer (
+ CosNotifyComm::SequencePushConsumer_ptr push_consumer,
+ CosNotifyFilter::Filter_ptr filter
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_UNUSED_ARG(push_consumer);
+ ACE_UNUSED_ARG(filter);
+
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT(), 0);
+ return 0;
+}
+
+void StubFaultNotifier::disconnect_consumer (
+ FT::FaultNotifier::ConsumerId connection
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ , CosEventComm::Disconnected
+ ))
+{
+ ACE_UNUSED_ARG(connection);
+
+ ACE_THROW (CORBA::NO_IMPLEMENT());
+}
+
+CORBA::Boolean StubFaultNotifier::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return 1;
+}
+
+int StubFaultNotifier::idle(int & result ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG(result);
+ int quit = 0;
+ ACE_TRY_NEW_ENV
+ {
+ if(!CORBA::is_nil(this->factory_.in ()))
+ {
+ int ok = this->factory_->is_alive( ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!ok)
+ {
+ quit = 1;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ quit = 1;
+ }
+ ACE_ENDTRY;
+ return quit;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/StubFaultNotifier.h b/TAO/orbsvcs/tests/FT_App/StubFaultNotifier.h
new file mode 100644
index 00000000000..612c5198fa1
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/StubFaultNotifier.h
@@ -0,0 +1,188 @@
+// -*- C++ -*-
+//
+// $Id$
+#ifndef STUBFAULTNOTIFIER_H_
+#define STUBFAULTNOTIFIER_H_
+
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include /**/ <ace/pre.h>
+
+#include <orbsvcs/FT_NotifierS.h>
+#include <orbsvcs/FT_FaultDetectorFactoryC.h>
+#include <ace/Vector_T.h>
+#include <ace/SString.h>
+
+//////////////////////
+// Forward references
+
+/////////////////////
+// Class declarations
+
+/**
+ * A stub implementation of the FaultNotifier interface
+ */
+class StubFaultNotifier : public virtual POA_FT::FaultNotifier
+{
+ //////////////////////
+ // non-CORBA interface
+public:
+ /**
+ * Default constructor.
+ */
+ StubFaultNotifier ();
+
+ /**
+ * Virtual destructor.
+ */
+ virtual ~StubFaultNotifier ();
+
+ /**
+ * Parse command line arguments.
+ */
+ int parse_args (int argc, char * argv[]);
+
+ /**
+ * Initialize.
+ */
+ int init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ /**
+ * Prepare to exit.
+ */
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ /**
+ * Return a string to identify this object for logging/console message purposes.
+ */
+ const char * identity () const;
+
+ /**
+ * idle time activity.
+ * @param result [out] status code to return from process
+ * @returns 0 to continue; nonzero to quit
+ */
+ int idle(int &result ACE_ENV_ARG_DECL);
+
+ // override virtuals
+::PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
+
+ PortableServer::ObjectId objectId()const;
+
+
+ /**
+ * Clean house for process shut down.
+ */
+ void shutdown_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ ////////////////////////////////
+ // CORBA interface FaultNotifier
+
+
+ virtual void push_structured_fault (
+ const CosNotification::StructuredEvent & event
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void push_sequence_fault (
+ const CosNotification::EventBatch & events
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual ::CosNotifyFilter::Filter_ptr create_subscription_filter (
+ const char * constraint_grammar
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosNotifyFilter::InvalidGrammar));
+
+ virtual FT::FaultNotifier::ConsumerId connect_structured_fault_consumer (
+ CosNotifyComm::StructuredPushConsumer_ptr push_consumer,
+ CosNotifyFilter::Filter_ptr filter
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual FT::FaultNotifier::ConsumerId connect_sequence_fault_consumer (
+ CosNotifyComm::SequencePushConsumer_ptr push_consumer,
+ CosNotifyFilter::Filter_ptr filter
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void disconnect_consumer (
+ FT::FaultNotifier::ConsumerId connection
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected));
+
+ //////////////////////////////////////////
+ // CORBA interface PullMonitorable methods
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /////////////////
+ // Implementation
+private:
+ int write_ior_file();
+
+ ///////////////
+ // Data Members
+private:
+ /**
+ * The orb
+ */
+ CORBA::ORB_var orb_;
+
+ /**
+ * The POA used to activate this object.
+ */
+ PortableServer::POA_var poa_;
+
+ /**
+ * The CORBA object id assigned to this object.
+ */
+ PortableServer::ObjectId_var object_id_;
+
+ /**
+ * IOR of this object as assigned by poa
+ */
+ CORBA::String_var ior_;
+
+ /**
+ * A file to which the factory's IOR should be written.
+ */
+ const char * ior_output_file_;
+
+ /**
+ * A file from which the detecor's IOR should be read.
+ */
+ const char * detector_ior_;
+
+ ::FT::FaultDetectorFactory_var factory_;
+
+ /**
+ * A collection of files containing replica IORs
+ */
+ ACE_Vector < const char * > iorReplicaFiles_;
+
+
+ ACE_Vector < FT::PullMonitorable_var > replicas_;
+ /**
+ * A name to be used to register with the name service.
+ */
+ const char * ns_name_;
+
+ /**
+ * A human-readable string to distinguish this from other Notifiers.
+ */
+ ACE_CString identity_;
+};
+
+#include /**/ <ace/post.h>
+
+#endif /* STUBFAULTNOTIFIER_H_ */
diff --git a/TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.cpp b/TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.cpp
new file mode 100644
index 00000000000..8bb35b960a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.cpp
@@ -0,0 +1,470 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file TAO_Object_Group_Creator.cpp
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * Utility to Create Object Group
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#include "TAO_Object_Group_Creator.h"
+#include <ace/OS_NS_stdio.h>
+#include <orbsvcs/PortableGroup/PG_Properties_Encoder.h>
+#include <orbsvcs/FT_FaultDetectorFactoryC.h>
+#include <orbsvcs/PortableGroup/PG_Operators.h>
+
+#include <ace/Get_Opt.h>
+
+TAO::Object_Group_Creator::Object_Group_Creator ()
+ : orb_(CORBA::ORB::_nil ())
+ , registry_ (PortableGroup::FactoryRegistry::_nil ())
+ , replication_manager_ (FT::ReplicationManager::_nil ())
+ , detector_infos_ (0)
+ , have_replication_manager_ (0)
+{
+}
+
+TAO::Object_Group_Creator::~Object_Group_Creator ()
+{
+}
+
+int TAO::Object_Group_Creator::set_factory_registry (PortableGroup::FactoryRegistry_ptr factory)
+{
+ this->registry_ = PortableGroup::FactoryRegistry::_duplicate (factory);
+ return CORBA::is_nil (this->registry_.in ()) ? -1 : 0 ;
+}
+
+
+int TAO::Object_Group_Creator::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL_NOT_USED)
+{
+ int result = 0;
+ this->orb_ = CORBA::ORB::_duplicate (orb);
+
+ if (CORBA::is_nil (this->registry_.in ()))
+ {
+ ///////////////////////////////
+ // Find the ReplicationManager
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Object_var rm_obj
+ = orb->resolve_initial_references (
+ "ReplicationManager" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->replication_manager_
+ = ::FT::ReplicationManager::_narrow (
+ rm_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!CORBA::is_nil (this->replication_manager_.in ()))
+ {
+ this->have_replication_manager_ = 1;
+ // empty criteria
+ ::PortableGroup::Criteria criteria;
+ this->registry_
+ = this->replication_manager_->get_factory_registry (
+ criteria ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!CORBA::is_nil (this->registry_.in ()))
+ {
+ this->detector_infos_
+ = this->registry_->list_factories_by_role (
+ FT::FAULT_DETECTOR_ROLE_NAME,
+ this->detector_type_id_.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::ULong count = this->detector_infos_->length ();
+ ACE_DEBUG ( (LM_DEBUG,
+ "%T %n (%P|%t)Object_Group_Creator: found %u factories for FaultDetectors\n",
+ static_cast<unsigned> (count)
+ ));
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%T %n (%P|%t) Object_Group_Creator: ReplicationManager failed to return FactoryRegistry.\n"
+ ));
+ ACE_TRY_THROW (CORBA::NO_IMPLEMENT ());
+ }
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%T %n (%P|%t) Object_Group_Creator: resolve_initial_references for ReplicationManager failed.\n"
+ ));
+ ACE_TRY_THROW (CORBA::OBJECT_NOT_EXIST ());
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Creator: Exception resolving ReplicationManager,\n");
+
+ result = 1;
+ }
+ ACE_ENDTRY;
+ }
+
+ return result;
+}
+
+int TAO::Object_Group_Creator::unregister_role (const char * role ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+ ACE_ERROR ( (LM_INFO,
+ "%T %n (%P|%t) Object_Group_Creator: Unregistering all factories for %s\n",
+ role
+ ));
+ this->registry_->unregister_factory_by_role (role ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ return result;
+}
+
+
+
+int TAO::Object_Group_Creator::create_detector_for_replica (
+ CORBA::Object_ptr replica,
+ const char * role,
+ const char * type_id,
+ PortableGroup::ObjectGroupId group_id,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL)
+{
+ int result = 0;
+
+ if (this->have_replication_manager_)
+ {
+ CORBA::ULong detector_count = this->detector_infos_->length ();
+ for (CORBA::ULong n_detector = 0; result == 0 && n_detector < detector_count; ++n_detector)
+ {
+ PortableGroup::FactoryInfo & info = (*this->detector_infos_)[n_detector];
+ if ( info.the_location == location || n_detector + 1 == detector_count)
+ {
+ TAO_PG::Properties_Encoder encoder;
+
+ PortableGroup::Value value;
+
+ FT::PullMonitorable_ptr monitorable = FT::PullMonitorable::_narrow (replica);
+ value <<= monitorable;
+ encoder.add (::FT::FT_MONITORABLE, value);
+
+ FT::FTDomainId domain_id = 0;
+ value <<= domain_id;
+ encoder.add (::FT::FT_DOMAIN_ID, value);
+
+ value <<= location;
+ encoder.add (::FT::FT_LOCATION, value);
+
+ value <<= type_id;
+ encoder.add (::FT::FT_TYPE_ID, value);
+
+ value <<= group_id;
+ encoder.add (::FT::FT_GROUP_ID, value);
+
+ value <<= CORBA::string_dup (role);
+ encoder.add (PortableGroup::role_criterion, value);
+
+ // allocate and populate the criteria
+ PortableGroup::Criteria_var criteria;
+ ACE_NEW_NORETURN (criteria,
+ PortableGroup::Criteria);
+ if (criteria.ptr () == 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%T %n (%P|%t)Object_Group_Creater: Error cannot allocate criteria.\n"
+ ));
+ result = -1;
+ }
+ else
+ {
+ encoder.encode (criteria);
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_creation_id;
+
+ info.the_factory->create_object (
+ type_id,
+ criteria.in (),
+ factory_creation_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ result = 1;
+ }
+ }
+ }
+ }
+ return result;
+}
+
+
+CORBA::Object_ptr TAO::Object_Group_Creator::create_infrastructure_managed_group (
+ const char * type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException ))
+{
+ CORBA::Object_var group = CORBA::Object::_nil ();
+
+ if (this->have_replication_manager_)
+ {
+ // set typeid properties
+ PortableGroup::Properties properties (1);
+ properties.length (3);
+
+ properties[0].nam.length (1);
+ properties[0].nam[0].id = PortableGroup::PG_MEMBERSHIP_STYLE;
+ properties[0].val <<= PortableGroup::MEMB_INF_CTRL;
+
+ PortableGroup::InitialNumberMembersValue inm(2);
+ properties[1].nam.length (1);
+ properties[1].nam[0].id = PortableGroup::PG_INITIAL_NUMBER_MEMBERS;
+ properties[1].val <<= inm;
+
+ PortableGroup::MinimumNumberMembersValue mnm(1);
+ properties[2].nam.length (1);
+ properties[2].nam[0].id = PortableGroup::PG_MINIMUM_NUMBER_MEMBERS;
+ properties[2].val <<= mnm;
+
+ this->replication_manager_->set_type_properties (
+ type_id,
+ properties
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (group._retn ());
+
+ ::PortableGroup::GenericFactory::FactoryCreationId_var creation_id;
+ PortableGroup::Criteria criteria (1);
+ criteria.length (1);
+ criteria[0].nam.length (1);
+ criteria[0].nam[0].id = PortableGroup::PG_MEMBERSHIP_STYLE;
+ criteria[0].val <<= PortableGroup::MEMB_APP_CTRL;
+
+ group = this->replication_manager_->create_object (
+ type_id,
+ criteria,
+ creation_id
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ }
+ else
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("%T %n (%P|%t): Object_Group_Creator: infrastructure managed group requires Replication Manager\n")
+ ));
+ }
+ return group._retn ();
+}
+
+CORBA::Object_ptr TAO::Object_Group_Creator::create_group (
+ const char * role,
+ int write_iors
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ( (CORBA::SystemException ))
+{
+ CORBA::Object_var group = CORBA::Object::_nil ();
+
+ PortableGroup::ObjectGroupId group_id = 0;
+ CORBA::String_var type_id;
+ ::PortableGroup::FactoryInfos_var infos = this->registry_->list_factories_by_role (role, type_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ CORBA::ULong count = infos->length ();
+ ACE_ERROR ((LM_INFO,
+ ACE_TEXT ("%T %n (%P|%t): Object_Group_Creator: ")
+ ACE_TEXT ("found %u factories for %s : %s\n"),
+ static_cast<unsigned> (count),
+ role,
+ type_id.in ()));
+
+ if (count > 0)
+ {
+ ///////////////////////////
+ // Begin with an empty IOGR
+ ::PortableGroup::GenericFactory::FactoryCreationId_var creation_id;
+ if (this->have_replication_manager_)
+ {
+
+ //////////////////////////////////////////////////////
+ // note infrastructure controlled because we want the
+ // ReplicationManager to manage the object after it's created.
+ // Initial number members = 0 because we do not want the Replication
+ // Manager to populate the group.
+ // Minimum number of members = 0 because we do not want the
+ // Replication Manager to replace failed members.
+ // Semi-active, because that's what we do.
+ PortableGroup::Criteria criteria (3);
+ criteria.length (4);
+ criteria[0].nam.length (1);
+ criteria[0].nam[0].id = PortableGroup::PG_MEMBERSHIP_STYLE;
+ criteria[0].val <<= PortableGroup::MEMB_INF_CTRL;
+
+ criteria[1].nam.length (1);
+ criteria[1].nam[0].id = PortableGroup::PG_INITIAL_NUMBER_MEMBERS;
+ criteria[1].val <<= PortableGroup::InitialNumberMembersValue (0);
+
+ criteria[2].nam.length (1);
+ criteria[2].nam[0].id = PortableGroup::PG_MINIMUM_NUMBER_MEMBERS;
+ criteria[2].val <<= PortableGroup::MinimumNumberMembersValue (0);
+
+ criteria[3].nam.length (1);
+ criteria[3].nam[0].id = FT::FT_REPLICATION_STYLE;
+ criteria[3].val <<= FT::SEMI_ACTIVE;
+
+ group = this->replication_manager_->create_object (
+ type_id.in (),
+ criteria,
+ creation_id
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ //@@ this is a bit of a hack
+ creation_id >>= group_id;
+
+ }
+
+ const PortableGroup::Location * first_location = 0;
+
+ for (CORBA::ULong nFact = 0; nFact < count; ++nFact)
+ {
+ ::PortableGroup::FactoryInfo & info = infos[nFact];
+
+ const char * loc_name = info.the_location[0].id;
+ ACE_ERROR ( (LM_INFO,
+ "%T %n (%P|%t) Object_Group_Creator: Creating %s@%s\n",
+ role,
+ loc_name
+ ));
+
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_creation_id;
+ CORBA::Object_var created_obj = info.the_factory->create_object (
+ type_id.in (),
+ info.the_criteria,
+ factory_creation_id.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ if ( !CORBA::is_nil (created_obj.in ()) )
+ {
+// that which was first shall now be last if (nFact == 0)
+ {
+ first_location = & info.the_location;
+ }
+
+ // try to create a detector, but don't worry if it doesn't happen
+ (void) create_detector_for_replica (
+ created_obj.in (),
+ role,
+ type_id.in (),
+ group_id,
+ info.the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ const char * replica_ior = orb_->object_to_string (created_obj.in () ACE_ENV_ARG_PARAMETER );
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+
+ if (write_iors)
+ {
+ ////////////////////////////////////
+ // Somewhat of a hack
+ // guess at role of factory creation id
+ CORBA::ULong ulong_id = 0;
+ CORBA::Long long_id = 0;
+ if (factory_creation_id >>= ulong_id)
+ {
+ // ok
+ }
+ else if (factory_creation_id >>= long_id)
+ {
+ ulong_id = static_cast<CORBA::ULong> (long_id);
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%T %n (%P|%t) Object_Group_Creator: Can't decypher factory creation id.\n"
+ ));
+ // Guessed wrong. Just use default value
+ }
+
+ char replica_ior_filename[200]; // "${role}_$ (location)_${factory_id}.ior"
+
+ ACE_OS::snprintf (replica_ior_filename, sizeof (replica_ior_filename)-1, "%s_%s_%lu.ior",
+ role,
+ loc_name,
+ static_cast<unsigned long> (ulong_id));
+ replica_ior_filename[sizeof (replica_ior_filename)-1] = '\0';
+
+ ACE_ERROR ( (LM_INFO,
+ "%T %n (%P|%t) Object_Group_Creator: Writing ior for created object to %s\n",
+ replica_ior_filename
+ ));
+
+ if (write_ior_file (replica_ior_filename, replica_ior) != 0)
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%T %n (%P|%t) Object_Group_Creator: Error writing ior [%s] to %s\n",
+ replica_ior,
+ replica_ior_filename
+ ));
+ }
+ }
+
+ if (this->have_replication_manager_)
+ {
+ group = this->replication_manager_->add_member (
+ group.in (),
+ info.the_location,
+ created_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ }
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%T %n (%P|%t) Object_Group_Creator: create_object returned nil????\n"
+ ));
+ }
+ }
+
+ if (first_location != 0 && this->have_replication_manager_)
+ {
+ group = this->replication_manager_->set_primary_member (group.in (), * first_location ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ }
+ ACE_ERROR ( (LM_INFO,
+ "%T %n (%P|%t) Object_Group_Creator: Successfully created group of %s\n",
+ role
+ ));
+ }
+
+ return group._retn ();
+}
+
+
+int TAO::Object_Group_Creator::fini ()
+{
+ return 0;
+}
+
+int TAO::Object_Group_Creator::write_ior_file (const char * outputFile, const char * ior)
+{
+ int result = -1;
+ FILE* out = ACE_OS::fopen (outputFile, "w");
+ if (out)
+ {
+ ACE_OS::fprintf (out, "%s", ior);
+ ACE_OS::fclose (out);
+ result = 0;
+ }
+ else
+ {
+ ACE_ERROR ( (LM_ERROR,
+ "%T %n (%P|%t) Object_Group_Creator: Open failed for %s\n", outputFile
+ ));
+ }
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.h b/TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.h
new file mode 100644
index 00000000000..2d3128b96d1
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/TAO_Object_Group_Creator.h
@@ -0,0 +1,110 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file TAO_Object_Group_Creator.h
+ *
+ * $Id$
+ *
+ * This file is part of Fault Tolerant CORBA.
+ * Utility to Create Object Group
+ *
+ * @author Dale Wilson <wilson_d@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef TAO_OBJECT_GROUP_CREATOR_H
+#define TAO_OBJECT_GROUP_CREATOR_H
+#include <ace/ACE.h>
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include <orbsvcs/FT_ReplicationManagerC.h>
+#include <orbsvcs/PortableGroupC.h>
+#include <ace/SString.h>
+#include <ace/Vector_T.h>
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace TAO
+{
+ class Object_Group_Creator
+ {
+ typedef ACE_Vector<ACE_CString> StringVec;
+ public:
+ ///////////////////////////
+ // construction/destruction
+ Object_Group_Creator ();
+
+ ~Object_Group_Creator ();
+
+ /////////////////
+ // pre-init methods
+ int set_factory_registry (PortableGroup::FactoryRegistry_ptr factory);
+
+ /////////////////
+ // initialization
+ int init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ /////////////////
+ // functionality
+ CORBA::Object_ptr create_group(
+ const char * role,
+ int write_iors
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /////////////////
+ // functionality
+ CORBA::Object_ptr create_infrastructure_managed_group(
+ const char * type_id
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ int unregister_role(const char * role ACE_ENV_ARG_DECL);
+
+ ////////////
+ // shut down
+ int fini ();
+
+ /////////////////
+ // implementation
+ private:
+ int write_ior_file(const char * outputFile, const char * ior);
+
+ int create_detector_for_replica (
+ CORBA::Object_ptr replica,
+ const char * role,
+ const char * type_id,
+ PortableGroup::ObjectGroupId group_id,
+ const PortableGroup::Location & location
+ ACE_ENV_ARG_DECL);
+
+ ////////////////////
+ // forbidden methods
+ private:
+ Object_Group_Creator (const Object_Group_Creator & rhs);
+ Object_Group_Creator & operator = (const Object_Group_Creator & rhs);
+
+ ////////////////
+ // Data members
+ private:
+ CORBA::ORB_var orb_;
+ PortableGroup::FactoryRegistry_var registry_;
+
+ ::FT::ReplicationManager_var replication_manager_;
+
+ ::PortableGroup::FactoryInfos_var detector_infos_;
+ CORBA::String_var detector_type_id_;
+
+
+ /**
+ * bool: true if we have a real replication manager
+ */
+ int have_replication_manager_;
+ };
+
+} // namespace TAO
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // TAO_OBJECT_GROUP_CREATOR_H
diff --git a/TAO/orbsvcs/tests/FT_App/replica.cmd b/TAO/orbsvcs/tests/FT_App/replica.cmd
new file mode 100755
index 00000000000..6c242ad4a00
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/replica.cmd
@@ -0,0 +1,9 @@
+@if "%1a" == "a" goto error
+@if "%2a" == "a" goto error
+release\ft_replica -o %1.ior -q -f none -l %1 -i %2 %3 %4 %5 %6 %7 %8 %9
+@goto end
+@:error
+@echo Usage %0 location role [options]
+@:end
+pause
+exit
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_basic.pl b/TAO/orbsvcs/tests/FT_App/run_test_basic.pl
new file mode 100755
index 00000000000..dea17745fb6
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_basic.pl
@@ -0,0 +1,107 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them
+my($debug_builds) = 0; # 0: use exes from Release directories
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+}
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+}
+
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($replica1_ior) = PerlACE::LocalFile ("replica1.ior");
+my($replica2_ior) = PerlACE::LocalFile ("replica2.ior");
+my($data_file) = PerlACE::LocalFile ("persistent.dat");
+
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $data_file;
+my($status) = 0;
+
+my($SV1) = new PerlACE::Process ("./$build_directory/ft_replica", "-o $factory1_ior -t $replica1_ior -q -f none");
+my($SV2) = new PerlACE::Process ("./$build_directory/ft_replica", "-o $factory2_ior -t $replica2_ior -q -f none");
+my($CL) = new PerlACE::Process ("./$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+
+print "\nTest: Starting replica 1 " . $SV1->CommandLine . "\n" if ($verbose);
+$SV1->Spawn ();
+
+print "waiting for replica 1's IOR\n" if ($verbose);
+
+if (PerlACE::waitforfile_timed ($replica1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find replica 1 file <$replica1_ior>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
+}
+
+print "\nTest: Starting replica 2 " . $SV2->CommandLine . "\n" if ($verbose);
+$SV2->Spawn ();
+
+print "waiting for replica 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find replica 2 file <$replica2_ior>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+
+print "\nTest: Starting client " . $CL->CommandLine . "\n" if ($verbose);
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "wait for server 1.\n" if ($verbose);
+$server = $SV1->WaitKill (60);
+
+print "wait for server 2.\n" if ($verbose);
+$server = $SV2->WaitKill (60);
+
+if ($server != 0) {
+ print STDERR "TEST ERROR: server returned $server\n";
+ $status = 1;
+}
+
+if ($status == 0) {
+print "Clean up scratch files\n" if ($verbose);
+
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $data_file;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_demo.pl b/TAO/orbsvcs/tests/FT_App/run_test_demo.pl
new file mode 100755
index 00000000000..eb18a88023a
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_demo.pl
@@ -0,0 +1,433 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# Purpose:
+# Integration test for all FT services.
+#
+# Command line options:
+# --debug_build use exes from this directory
+# if not specified use exes from ./release
+# --no_simulate
+# use real IOGR-based recovery.
+# -v display test progress messages (repeating option increases verbosity
+# Process being tested:
+# FT_ReplicationManager
+# Fault_Detector
+# Fault_Notifier
+#
+# Processes used in test:
+# FT_Replica * 3
+# implements GenericFactory interface to create TestReplicas
+# TestReplica implements TestReplica interface.
+# TestReplica implements PullMonitorable interface.
+# FT_Client
+# client for TestReplica interface.
+# client for PullMonitorable.
+# Object Group Creator
+# Creates groups of objects.
+#
+# Test Scenario
+#
+# 1) Start the ReplicationManager (RM),
+# 2) Start the Fault Notification Server(FN)
+# 2.1) FN registers with RM.
+# 2.2) RM registers as consumer with FN
+# 3) Start FaultDetectorFactory at location shire (FD@shire)
+# 3.1) FD@shire registers with RM
+# 4) Start FaultDetectorFactory at location bree (FD@bree)
+# 4.1) FD@bree registers with RM
+# 5) Start Replica Factory at location shire (RF@shire) that can create hobbits
+# 5.1) RF@shire registers with RM to create hobbit@shire
+# 6) Start Replica Factory at location bree (RF@bree) that can create hobbits and elves.
+# 6.1) RF@bree registers with RM to create hobbit@bree
+# 6.1) RF@bree registers with RM to create elf@bree
+# 6) Start Replica Factory at location rivendell (RF@rivendell) that can create elves.
+# 6.1) RF@bree registers with RM to create elf@rivendell
+# 7) Start ObjectGroupCreator (OGC)
+# 7.1) OGC calls RM to create group of hobbits (IOGR1)
+# 7.1.1) OGC calls RF@shire to create hobbit@shire[1]
+# 7.1.1.1) OGC calls FD@shire to create FaultDetector for hobbit@shire[1]
+# 7.1.1.2) OGC adds hobbit@shire[1] to IOGR1.
+# 7.1.2) OGC calls RF@bree to craate hobbit@bree[1]
+# 7.1.2.1) OGC calls FD@bree to create FaultDetector for hobbit@bree[1]
+# 7.1.2.2) OGC adds hobbit@bree[1] to IOGR1.
+# 7.2) OGC calls RM to create group of elves (IOGR2)
+# 7.2.1) OGC calls RF@bree to create elf@bree[2]
+# 7.2.1.1) OGC calls FD@bree to create FaultDetector for elf@bree[2]
+# 7.2.1.2) OGC adds elf@bree[2] to IOGR2.
+# 7.2.2) OGC calls RF@rivendell to create elf@rivendell[1]
+# 7.2.2.1) OGC calls FD@shire to create FaultDetector for elf@rivendell[1]
+# 7.2.2.2) OGC adds elf@rivendell[1] to IOGR2.
+# 7.3) OGC calls RM to create group of hobbits (IOGR3)
+# 7.3.1) OGC calls RF@shire to create hobbit@shire[2]
+# 7.3.1.1) OGC calls FD@shire to create FaultDetector for hobbit@shire[2]
+# 7.3.1.2) OGC adds hobbit@shire[2] to IOGR2.
+# 7.3.2) OGC calls RF@bree to craate hobbit@bree[3]
+# 7.3.2.1) OGC calls FD@bree to create FaultDetector for hobbit@bree[3]
+# 7.3.2.2) OGC adds hobbit@bree[3] to IOGR3.
+# 8) Start client1 with IOGR1
+# 8.1) Hobbit@shire[1] fails. FD sends notification FN.
+# 8.1.1) FN sends notification to RM.
+# 8.1.2) RM removes hobbit@shire[1] from IOGR1.
+# 8.2) Client1 terminates itself and hobbit@bree[1].
+# 9) Start Cient2 with IOGR2.
+# 9.1) Repeat 8.1 & 8.2 using IOGR3.
+# 10) Start Cient3 with IOGR3.
+# 10.1) Repeat 8.1 & 8.2 using IOGR3.
+# 11) System manages to shut itself down.
+
+use lib '../../../../bin';
+#use lib '$ENV{ACE_ROOT}/bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them
+my($debug_builds) = 0; # 0: use exes from Release directories
+my($simulated) = 1; # 1: use "client simulated" fault tolerance
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "--no_simulate") # reverse this once we have FT ORB support
+ {
+ $simulated = 0;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+}
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
+}
+
+my($role1) = "hobbit";
+my($role2) = "elf";
+
+my($location1) = "shire";
+my($location2) = "bree";
+my($location3) = "rivendell";
+
+my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
+my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+
+#define temp files
+my($rm_ior) = PerlACE::LocalFile ("rm.ior");
+my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
+my($detector1_ior) = PerlACE::LocalFile ("detector1.ior");
+my($detector2_ior) = PerlACE::LocalFile ("detector2.ior");
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($factory3_ior) = PerlACE::LocalFile ("factory3.ior");
+my($replica1_ior) = PerlACE::LocalFile ("${role1}_${location1}_0.ior");
+my($replica2_ior) = PerlACE::LocalFile ("${role1}_${location2}_0.ior");
+my($replica3_ior) = PerlACE::LocalFile ("${role2}_${location2}_1.ior");
+my($replica4_ior) = PerlACE::LocalFile ("${role2}_${location3}_0.ior");
+my($replica5_ior) = PerlACE::LocalFile ("${role1}_${location1}_1.ior");
+my($replica6_ior) = PerlACE::LocalFile ("${role1}_${location2}_2.ior");
+
+my($replica1_iogr) = PerlACE::LocalFile ("${role1}_0.iogr");
+my($replica2_iogr) = PerlACE::LocalFile ("${role2}_1.iogr");
+my($replica3_iogr) = PerlACE::LocalFile ("${role1}_2.iogr");
+
+my($client_data) = PerlACE::LocalFile ("persistent.dat");
+
+#discard junk from previous tests
+unlink $rm_ior;
+unlink $notifier_ior;
+unlink $detector1_ior;
+unlink $detector2_ior;
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $factory3_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $replica3_ior;
+unlink $replica4_ior;
+unlink $replica5_ior;
+unlink $replica6_ior;
+unlink $replica1_iogr;
+unlink $replica2_iogr;
+
+unlink $client_data;
+
+my($status) = 0;
+
+my($RM) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/FT_ReplicationManager$build_directory/FT_ReplicationManager", "-o $rm_ior $rm_endpoint");
+my($RMC) = new PerlACE::Process (".$build_directory/replmgr_controller", "$rm_initref -x");
+my($NOT) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier$build_directory/Fault_Notifier", "$rm_initref -o $notifier_ior -q");
+my($DET1) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "$rm_initref -o $detector1_ior -l $location1 -q");
+my($DET2) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "$rm_initref -o $detector2_ior -l $location2 -q");
+my($FAC1) = new PerlACE::Process (".$build_directory/ft_replica", "$rm_initref -o $factory1_ior -l $location1 -i $role1 -q");
+my($FAC2) = new PerlACE::Process (".$build_directory/ft_replica", "$rm_initref -o $factory2_ior -l $location2 -i $role1 -i $role2 -q");
+my($FAC3) = new PerlACE::Process (".$build_directory/ft_replica", "$rm_initref -o $factory3_ior -l $location3 -i $role2 -q");
+
+my($OGC);
+my($CL1);
+my($CL2);
+my($CL3);
+if ($simulated) {
+ print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
+ $OGC= new PerlACE::Process (".$build_directory/ft_create", "$rm_initref -r $role1 -r $role2 -r $role1 -i -n");
+ $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+ $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_ior -f file://$replica4_ior -c testscript");
+ $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica5_ior -f file://$replica6_ior -c testscript");
+}else{
+ print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
+ $OGC = new PerlACE::Process (".$build_directory/ft_create", "$rm_initref -r $role1 -r $role2 -r $role1 -g -n");
+ $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_iogr -c testscript");
+ $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica2_iogr -c testscript");
+ $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_iogr -c testscript");
+}
+
+#######################
+# Start ReplicationManager
+
+print "\nTEST: Starting ReplicationManager " . $RM->CommandLine . "\n" if ($verbose);
+$RM->Spawn ();
+
+print "TEST: waiting for registry's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($rm_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$rm_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ exit 1;
+}
+
+#######################
+# Start FaultNotifier
+print "\nTEST: Starting FaultNotifier " . $NOT->CommandLine . "\n" if ($verbose);
+$NOT->Spawn ();
+
+print "TEST: waiting for FaultNotifier's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($notifier_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait (1);
+ exit 1;
+}
+
+
+##############################
+# Start FaultDetectorFactory 1
+print "\nTEST: Starting FaultDetectorFactory at $location1 " . $DET1->CommandLine . "\n" if ($verbose);
+$DET1->Spawn ();
+
+print "TEST: waiting for FaultDetector's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($detector1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$detector1_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait (1);
+ $DET1->Kill (); $DET1->TimedWait (1);
+ exit 1;
+}
+
+##############################
+# Start FaultDetectorFactory 2
+print "\nTEST: Starting FaultDetectorFactory at $location2 " . $DET2->CommandLine . "\n" if ($verbose);
+$DET2->Spawn ();
+
+print "TEST: waiting for FaultDetector's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($detector2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$detector2_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait (1);
+ $DET1->Kill (); $DET1->TimedWait (1);
+ $DET2->Kill (); $DET2->TimedWait (1);
+ exit 1;
+}
+
+
+#################
+# Start Factories
+
+print "\nTEST: Starting replica factory at $location1 " . $FAC1->CommandLine . "\n" if ($verbose);
+$FAC1->Spawn ();
+
+print "TEST: waiting for factory 1's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory1_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait (1);
+ $DET1->Kill (); $DET1->TimedWait (1);
+ $DET2->Kill (); $DET2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: Starting replica factory at $location2 " . $FAC2->CommandLine . "\n" if ($verbose);
+$FAC2->Spawn ();
+
+print "TEST: waiting for factory 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory2_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait (1);
+ $DET1->Kill (); $DET1->TimedWait (1);
+ $DET2->Kill (); $DET2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: Starting replica factory at $location3 " . $FAC3->CommandLine . "\n" if ($verbose);
+$FAC3->Spawn ();
+
+print "TEST: waiting for factory 3's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory3_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory3_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait (1);
+ $DET1->Kill (); $DET1->TimedWait (1);
+ $DET2->Kill (); $DET2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ exit 1;
+}
+
+######################
+# Create object groups
+
+print "\nTEST: Starting object group creator " . $OGC->CommandLine . "\n" if ($verbose);
+$OGC->Spawn ();
+
+print "\nTEST: wait for object group creator.\n" if ($verbose);
+$config = $OGC->WaitKill (30);
+if ($config != 0) {
+ print STDERR "TEST ERROR: Object Group Creator returned $config\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait (1);
+ $DET1->Kill (); $DET1->TimedWait (1);
+ $DET2->Kill (); $DET2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ exit 1;
+}
+
+#############
+# Run clients
+
+print "\nTEST: Starting client using first group of hobbits " . $CL1->CommandLine . "\n" if ($verbose);
+$client = $CL1->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "\nTEST: Starting client using group of elves " . $CL2->CommandLine . "\n" if ($verbose);
+$client2 = $CL2->SpawnWaitKill (60);
+
+if ($client2 != 0) {
+ print STDERR "TEST ERROR: client returned $client2\n";
+ $status = 1;
+}
+
+print "\nTEST: Starting client using second group of hobbits " . $CL3->CommandLine . "\n" if ($verbose);
+$client3 = $CL3->SpawnWaitKill (60);
+
+if ($client3 != 0) {
+ print STDERR "TEST ERROR: client returned $client3\n";
+ $status = 1;
+}
+
+######################
+# Clean house and exit
+
+print "\nTEST: wait for factory 1.\n" if ($verbose);
+$factory1 = $FAC1->WaitKill (30);
+if ($factory1 != 0) {
+ print STDERR "TEST ERROR: replica returned $factory 1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for factory 2.\n" if ($verbose);
+$factory2 = $FAC2->WaitKill (30);
+if ($factory2 != 0) {
+ print STDERR "TEST ERROR: factory 2 returned $factory2\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for factory 3.\n" if ($verbose);
+$factory3 = $FAC3->WaitKill (30);
+if ($factory3 != 0) {
+ print STDERR "TEST ERROR: factory 3 returned $factory3\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for FaultDetectorFactory 1.\n" if ($verbose);
+$detector1 = $DET1->WaitKill (30);
+if ($detector1 != 0) {
+ print STDERR "TEST ERROR: FaultDetectorFactory returned $detector1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for FaultDetectorFactory 2.\n" if ($verbose);
+$detector2 = $DET2->WaitKill (30);
+if ($detector2 != 0) {
+ print STDERR "TEST ERROR: FaultDetectorFactory returned $detector2\n";
+ $status = 1;
+}
+
+print "\nTEST: shutting down the replication manager.\n" if ($verbose);
+$controller = $RMC->SpawnWaitKill (300);
+if ($controller != 0) {
+ print STDERR "TEST ERROR: replication manager controller returned $controller\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for ReplicationManager.\n" if ($verbose);
+#$RM->Kill ();
+$repmgr = $RM->WaitKill (30);
+if ($repmgr != 0) {
+ print STDERR "TEST ERROR: ReplicationManager returned $repmgr\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for FaultNotifier.\n" if ($verbose);
+$notifier = $NOT->WaitKill (30);
+if ($notifier != 0) {
+ print STDERR "TEST ERROR: FaultNotifier returned $notifier\n";
+ $status = 1;
+}
+
+if ($status == 0 && 0) {
+ print "\nTEST: releasing scratch files.\n" if ($verbose);
+ unlink $rm_ior;
+ unlink $detector1_ior;
+ unlink $detector2_ior;
+ unlink $notifier_ior;
+ unlink $factory1_ior;
+ unlink $factory2_ior;
+ unlink $factory3_ior;
+ unlink $replica1_ior;
+ unlink $replica2_ior;
+ unlink $replica3_ior;
+ unlink $replica4_ior;
+ unlink $replica5_ior;
+ unlink $replica6_ior;
+ unlink $replica1_iogr;
+ unlink $replica2_iogr;
+
+ unlink $client_data;
+}
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_detector.pl b/TAO/orbsvcs/tests/FT_App/run_test_detector.pl
new file mode 100755
index 00000000000..f7886fb6dab
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_detector.pl
@@ -0,0 +1,221 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# Purpose:
+# To test the FaultDetectorFactory and FaultDetectors
+#
+# Command line options:
+# --debug_build use exes from this directory
+# if not specified use exes from ./release
+# -v display test progress messages (repeating option increases verbosity
+#
+# Process being tested:
+# Fault_Detector
+# implements FaultDetectorFactory interface
+# implements PullMonitorable interface
+#
+# Processes used in test:
+# FT_Replica
+# implements TestReplica interface.
+# implements PullMonitorable.
+# StubNotifier
+# implements FaultNotifier interface (as a stub.)
+# implements PullMonitorable.
+# client for FaultDetectorFactory interface.
+# FT_Client
+# client for TestReplica interface.
+# client for PullMonitorable.
+#
+# Test Scenario ( ***Test: marks behavior being tested):
+# Start two FT_Replicas
+# FT_Replicas write TestReplica IORs (FR#1 and FR#2) to files
+# Start the Fault_Detector
+# Fault_Detector writes its IOR (FDF) to a file
+# Wait for IORs: FR#1, FR#2, and FDF
+# Start the StubNotifier giving it IORS: FR#1, FR#2 and FDF
+# StubNotifier calls FDF to create a FaultDetector
+# for each Replica.
+# StubNotifier writes FaultNotifier IOR (FN) to a file.
+# Wait for IOR: FN
+# Start FT_Client giving it IORS: FR#1 and FR#2.
+# FT_Client interacts with FR#1.
+# FT_Client asks FR#1 to fault. It does so.
+# FT_Client notices fault and switches to FR#2.
+# ***Test: FD#1 notices fault and notifies StubNotifier
+# ***Test: FD#1 terminates
+# FT_Client interacts with FR#2.
+# FT_Client asks FR#2 to shut down.
+# FT_Client shuts down.
+# ***Test: FD#2 notices FR2 is gone, interprets this
+# as a fault, and notifies StubNotifier.
+# ***Test: FD#2 terminates.
+# Shut down
+# ***Test: FDF is idle, so it terminates.
+# StubNotifier sees FDF terminate, so it terminates
+# Cleanup
+# Wait for all processes to terminate.
+# Check termination status.
+# Delete temp files.
+#
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them; 2 display settings from command line
+my($debug_builds) = 0; # 0: use exes from Release directories
+my($simulated) = 1; # 1: use "client simulated" fault tolerance
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+}
+
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
+}
+
+
+#define temp files
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($replica1_ior) = PerlACE::LocalFile ("replica1.ior");
+my($replica2_ior) = PerlACE::LocalFile ("replica2.ior");
+my($detector_ior) = PerlACE::LocalFile ("detector.ior");
+my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
+my($client_data) = PerlACE::LocalFile ("persistent.dat");
+
+#discard junk from previous tests
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+unlink #client_data
+
+my($status) = 0;
+
+my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
+my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+
+
+my($REP1) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory1_ior -f none -t $replica1_ior -l loc1 -i type1 -q");
+my($REP2) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory2_ior -f none -t $replica2_ior -l loc2 -i type1 -q");
+my($DET) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "$rm_initref -o $detector_ior -q");
+my($NOT) = new PerlACE::Process (".$build_directory/ft_notifier", "-o $notifier_ior -q -d file://$detector_ior -r file://$replica1_ior -r file://$replica2_ior");
+my($CL) = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+
+print "TEST: starting replica1 ". $REP1->CommandLine . "\n" if ($verbose);
+$REP1->Spawn ();
+
+print "TEST: waiting for replica 1's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting replica2 " . $REP2->CommandLine . "\n" if ($verbose);
+$REP2->Spawn ();
+
+print "TEST: waiting for replica 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica2_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting detector factory " . $DET->CommandLine . "\n" if ($verbose);
+$DET->Spawn ();
+
+print "TEST: waiting for detector's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($detector_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$detector_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET2->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting notifier " . $NOT->CommandLine . "\n" if ($verbose);
+$NOT->Spawn ();
+
+print "TEST: waiting for notifier's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($notifier_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET2->TimedWait(1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting client." . $CL->CommandLine . "\n" if ($verbose);
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 1.\n" if ($verbose);
+$replica1 = $REP1->WaitKill (60);
+if ($replica1 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 2.\n" if ($verbose);
+$replica2 = $REP2->WaitKill (60);
+if ($replica2 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica2\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for detector factory to leave.\n" if ($verbose);
+$detector = $DET->WaitKill (60);
+if ($detector != 0) {
+ print STDERR "TEST ERROR: detector returned $detector\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for notifier to leave.\n" if ($verbose);
+$notifier = $NOT->WaitKill (60);
+if ($notifier != 0) {
+ print STDERR "TEST ERROR: notifier returned $notifier\n";
+ $status = 1;
+}
+
+print "\nTEST: releasing scratch files.\n" if ($verbose);
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+
+#client's work file
+unlink #client_data;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl b/TAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl
new file mode 100755
index 00000000000..bfb3f98db2a
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl
@@ -0,0 +1,270 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# Purpose:
+# To test the FaultConsumer
+#
+# Process being tested:
+# Fault_Consumer
+# implements FaultConsumer interface.
+# Processes used in test:
+# FT_Replica
+# implements TestReplica interface.
+# implements PullMonitorable.
+# Fault_Detector
+# implements FaultDetectorFactory interface
+# implements PullMonitorable interface
+# FT_Client
+# client for TestReplica interface.
+# client for PullMonitorable.
+# Fault_Notifier
+# implements the FaultNotifier interface.
+# propagates fault reports to the FaultConsumer.
+#
+# Test Scenario (***Test: marks behavior being tested):
+# Phase 1:
+# Start two FT_Replicas
+# FT_Replicas write TestReplica IORs (FR#1 and FR#2) to files
+# Start the Fault_Detector
+# Fault_Detector writes its IOR (FDF) to a file
+# Start the Fault_Notifier
+# Fault_Notifier writes its IOR (FN) to a file.
+# Start the Fault_Consumer
+# Subscribes to the Fault_Notifier for fault reports.
+# Phase 2:
+# Wait for IORs: FR#1, FR#2, FDF, and FN
+# Start the StubAnalyzer giving it IORS: FR#1, FR#2 FDF, FN
+# StubAnalyzer calls FDF to create a FaultDetector
+# for each Replica.
+# StubAnalyzer subscribes to Fault_Notifier
+# StubAnalyzer writes dummy message(READY) to a file.
+# Phase 3:
+# Wait for READY
+# Start FT_Client giving it IORS: FR#1 and FR#2. [1]
+# FT_Client interacts with FR#1.
+# FT_Client asks FR#1 to fault. It does so.
+# FT_Client notices fault and switches to FR#2. [1]
+# FD#1 notices fault and notifies Fault_Notifier
+# FD#1 terminates
+# ***Test: Fault_Notifier forwards notification to StubAnalyzer
+# StubAnalyzer prints notification.
+# FT_Client interacts with FR#2.
+# FT_Client asks FR#2 to shut down.
+# FT_Client shuts down.
+# FD#2 notices FR2 is gone, interprets this
+# as a fault, and sends notification to Fault_Notifier
+# FD#2 terminates.
+# ***Test: Fault_Notifier forwards notification to StubAnalyzer
+# StubAnalyzer prints notification.
+# Phase 4: shutting down.
+# All FaultDetectors have terminated so the FaultDetectorFactory
+# honors the "quit-on-idle" option on it's command line and exits.
+# StubAnalyzer compares # fault notifications to # replicas. When
+# they match, it "knows" that the test is over, so it shuts down.
+# As it does so, it disconnects its fault consumers from the FaultNotifier.
+# FaultNotifier notices the last fault consumer disconnecting and exits because
+# the "quit-on-idle" option was specified on the command line.
+# Phase 5: housekeeping
+# Wait for all processes to terminate.
+# Check termination status.
+# Delete temp files.
+#
+# [1] Client mediated fault tolerance. These points will
+# change when IOGR support is available.
+use lib '../../../../bin';
+#use lib '$ENV{ACE_ROOT}/bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them
+my($debug_builds) = 0; # 0: use exes from Release directories
+my($simulated) = 1; # 1: use "client simulated" fault tolerance
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "--no_simulate") # reverse this once we have FT ORB support
+ {
+ $simulated = 0;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+}
+
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
+}
+
+
+#define temp files
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($replica1_ior) = PerlACE::LocalFile ("replica1.ior");
+my($replica2_ior) = PerlACE::LocalFile ("replica2.ior");
+my($detector_ior) = PerlACE::LocalFile ("detector.ior");
+my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
+my($ready_file) = PerlACE::LocalFile ("ready.file");
+my($client_data) = PerlACE::LocalFile ("persistent.dat");
+
+#discard junk from previous tests
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+unlink $ready_file;
+unlink $client_data;
+
+my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
+my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+
+my($status) = 0;
+
+my($REP1) = new PerlACE::Process (".$build_directory/ft_replica", "-f none -o $factory1_ior -t $replica1_ior -l loc1 -i type1 -q");
+my($REP2) = new PerlACE::Process (".$build_directory/ft_replica", "-f none -o $factory2_ior -t $replica2_ior -l loc2 -i type1 -q");
+my($DET) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "-r -o $detector_ior -q");
+my($NOT) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier$build_directory/Fault_Notifier", "-r -o $notifier_ior -q");
+my($CONS) = new PerlACE::Process (".$build_directory/ft_fault_consumer", "-o $ready_file -n file://$notifier_ior -q -d file://$detector_ior -r file://$replica1_ior -r file://$replica2_ior");
+
+my($CL);
+if ($simulated) {
+ print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
+ $CL = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+}else{
+ print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
+ $CL = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_iogr -c testscript");
+}
+
+print "TEST: starting replica1 " . $REP1->CommandLine . "\n" if ($verbose);
+$REP1->Spawn ();
+
+print "TEST: waiting for replica 1's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting replica2 " . $REP2->CommandLine . "\n" if ($verbose);
+$REP2->Spawn ();
+
+print "TEST: waiting for replica 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica2_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting detector factory " . $DET->CommandLine . "\n" if ($verbose);
+$DET->Spawn ();
+
+print "TEST: waiting for detector's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($detector_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$detector_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting notifier " . $NOT->CommandLine . "\n" if ($verbose);
+$NOT->Spawn ();
+
+print "TEST: waiting for notifier's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($notifier_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET->TimedWait(1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting fault consumer " . $CONS->CommandLine . "\n" if ($verbose);
+$CONS->Spawn ();
+
+print "TEST: waiting for READY.FILE from fault consumer\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($ready_file, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$ready_file>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET->TimedWait(1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ $CONS->Kill (); $CONS->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting client " . $CL->CommandLine . "\n" if ($verbose);
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 1.\n" if ($verbose);
+$replica1 = $REP1->WaitKill (5);
+if ($replica1 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 2.\n" if ($verbose);
+$replica2 = $REP2->WaitKill (5);
+if ($replica2 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica2\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for detector factory to leave.\n" if ($verbose);
+$detector = $DET->WaitKill (20);
+if ($detector != 0) {
+ print STDERR "TEST ERROR: detector returned $detector\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for notifier to leave.\n" if ($verbose);
+$notifier = $NOT->WaitKill (20);
+if ($notifier != 0) {
+ print STDERR "TEST ERROR: notifier returned $notifier\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for fault consumer to leave.\n" if ($verbose);
+$consumer = $CONS->WaitKill (20);
+if ($consumer != 0) {
+ print STDERR "TEST ERROR: fault consumer returned $consumer\n";
+ $status = 1;
+}
+
+print "\nTEST: releasing scratch files.\n" if ($verbose);
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+unlink $ready_file;
+
+#client's work file
+unlink $client_data;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_notifier.pl b/TAO/orbsvcs/tests/FT_App/run_test_notifier.pl
new file mode 100755
index 00000000000..521860b7ac3
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_notifier.pl
@@ -0,0 +1,248 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# Purpose:
+# To test the FaultNotifier
+#
+# Command line options:
+# --debug_build use exes from this directory
+# if not specified use exes from ./release
+# -v display test progress messages (repeating option increases verbosity
+#
+# Process being tested:
+# Fault_Notifier
+# implements FaultNotifier interface.
+# Processes used in test:
+# FT_Replica
+# implements TestReplica interface.
+# implements PullMonitorable.
+# Fault_Detector
+# implements FaultDetectorFactory interface
+# implements PullMonitorable interface
+# FT_Client
+# client for TestReplica interface.
+# client for PullMonitorable.
+# StubAnalyzer
+# Subscribes to Fault_Notfier
+#
+# Test Scenario (***Test: marks behavior being tested):
+# Start two FT_Replicas
+# FT_Replicas write TestReplica IORs (FR#1 and FR#2) to files
+# Start the Fault_Detector
+# Fault_Detector writes its IOR (FDF) to a file
+# Start the Fault_Notifier
+# Fault_Notifier writes its IOR (FN) to a file.
+# Start the StubAnalyzer giving it IORS: FR#1, FR#2 FDF, FN
+# StubAnalyzer calls FDF to create a FaultDetector
+# for each Replica.
+# StubAnalyzer subscribes to Fault_Notifier
+# StubAnalyzer writes dummy message(READY) to a file.
+# Wait for READY
+# Start FT_Client giving it IORS: FR#1 and FR#2.
+# FT_Client interacts with FR#1.
+# FT_Client asks FR#1 to fault. It does so.
+# FT_Client notices fault and switches to FR#2.
+# FD#1 notices fault and notifies Fault_Notifier
+# FD#1 terminates
+# ***Test: Fault_Notifier forwards notification to StubAnalyzer
+# StubAnalyzer prints notification.
+# FT_Client interacts with FR#2.
+# FT_Client asks FR#2 to shut down.
+# FT_Client shuts down.
+# FD#2 notices FR2 is gone, interprets this
+# as a fault, and sends notification to Fault_Notifier
+# FD#2 terminates.
+# ***Test: Fault_Notifier forwards notification to StubAnalyzer
+# StubAnalyzer prints notification.
+# Shutting down.
+# All FaultDetectors have terminated so the FaultDetectorFactory
+# honors the "quit-on-idle" option on it's command line and exits.
+# StubAnalyzer compares # fault notifications to # replicas. When
+# they match, it knows that the test is over, so it shuts down.
+# As it does so, it disconnects its fault consumers from the FaultNotifier.
+# FaultNotifier notices the last fault consumer disconnecting and exits because
+# the "quit-on-idle" option was specified on the command line.
+# Housekeeping
+# Wait for all processes to terminate.
+# Check termination status.
+# Delete temp files.
+#
+use lib '../../../../bin';
+#use lib '$ENV{ACE_ROOT}/bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them
+my($debug_builds) = 0; # 0: use exes from Release directories
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+}
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+}
+
+
+#define temp files
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($replica1_ior) = PerlACE::LocalFile ("replica1.ior");
+my($replica2_ior) = PerlACE::LocalFile ("replica2.ior");
+my($detector_ior) = PerlACE::LocalFile ("detector.ior");
+my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
+my($ready_file) = PerlACE::LocalFile ("ready.file");
+my($client_data) = PerlACE::LocalFile ("persistent.dat");
+
+#discard junk from previous tests
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+unlink $ready_file;
+unlink $client_data;
+
+my($status) = 0;
+
+my($REP1) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory1_ior -f none -t $replica1_ior -l loc1 -i type1 -q");
+my($REP2) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory2_ior -f none -t $replica2_ior -l loc2 -i type1 -q");
+my($DET) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "-r -o $detector_ior -q");
+my($NOT) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier$build_directory/Fault_Notifier", "-r -o $notifier_ior -q");
+my($ANA) = new PerlACE::Process (".$build_directory/ft_analyzer", "-o $ready_file -n file://$notifier_ior -d file://$detector_ior -r file://$replica1_ior -r file://$replica2_ior -q");
+my($CL) = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+
+print "TEST: starting replica1 " . $REP1->CommandLine . "\n" if ($verbose);
+$REP1->Spawn ();
+
+print "TEST: waiting for replica 1's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting replica2 " . $REP2->CommandLine . "\n" if ($verbose);
+$REP2->Spawn ();
+
+print "TEST: waiting for replica 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica2_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting detector factory " . $DET->CommandLine . "\n" if ($verbose);
+$DET->Spawn ();
+
+print "TEST: waiting for detector's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($detector_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$detector_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET2->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting notifier " . $NOT->CommandLine . "\n" if ($verbose);
+$NOT->Spawn ();
+
+print "TEST: waiting for notifier's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($notifier_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET2->TimedWait(1);
+ $ANA->Kill (); $ANA->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting analyzer " . $ANA->CommandLine . "\n" if ($verbose);
+$ANA->Spawn ();
+
+print "TEST: waiting for READY.FILE from analyzer\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($ready_file, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$ready_file>\n";
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET2->TimedWait(1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ $ANA->Kill (); $ANA->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: starting client " . $CL->CommandLine . "\n" if ($verbose);
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 1.\n" if ($verbose);
+$replica1 = $REP1->WaitKill (5);
+if ($replica1 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 2.\n" if ($verbose);
+$replica2 = $REP2->WaitKill (5);
+if ($replica2 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica2\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for detector factory to leave.\n" if ($verbose);
+$detector = $DET->WaitKill (20);
+if ($detector != 0) {
+ print STDERR "TEST ERROR: detector returned $detector\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for notifier to leave.\n" if ($verbose);
+$notifier = $NOT->WaitKill (20);
+if ($notifier != 0) {
+ print STDERR "TEST ERROR: notifier returned $notifier\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for analyzer to leave.\n" if ($verbose);
+$analyzer = $ANA->WaitKill (20);
+if ($analyzer != 0) {
+ print STDERR "TEST ERROR: analyzer returned $analyzer\n";
+ $status = 1;
+}
+
+print "\nTEST: releasing scratch files.\n" if ($verbose);
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+unlink $ready_file;
+
+#client's work file
+unlink $client_data;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_registry.pl b/TAO/orbsvcs/tests/FT_App/run_test_registry.pl
new file mode 100755
index 00000000000..dd73b739a52
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_registry.pl
@@ -0,0 +1,438 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# Purpose:
+# To test the FactoryRegistry either as a stand-alone application or as part
+# of the replication manager
+#
+# Command line options:
+# --debug_build use exes from this directory
+# if not specified use exes from ./release
+# -r use ReplicationManager rather than stand-alone factory
+# --no_simulate
+# use real IOGR-based recovery.
+# -v display test progress messages (repeating option increases verbosity
+#
+# Process being tested:
+# FT_Registry
+# implements PortableGroup::FactoryRegistry interface.
+# or
+# FT_ReplicationManager (if -r option is used)
+#
+# Processes used in test:
+# FT_Replica * 3
+# implements GenericFactory interface to create TestReplicas
+# TestReplica implements TestReplica interface.
+# TestReplica implements PullMonitorable interface.
+# FT_Client
+# client for TestReplica interface.
+# client for PullMonitorable.
+# Object Group Creator
+# Creates groups of objects.
+#
+# Test Scenario (***Test: marks behavior being tested):
+#
+# First the test starts a factory registry,
+# Then starts three factories. Each factory exists at a separate location.
+# The locations are named shire, bree, and rivendell. In a "real" system
+# these locations would be on separate computers.
+#
+# The factory at the shire location knows how to create hobbits.
+# The factory at the bree location knows how to create hobbits, elves, and humans.
+# The factory at rivendell can create elves.
+# Hobbits, elves, and humans are actually TestReplica objects. A creation parameter
+# included as part of the registration information specifies which species they are.
+#
+# ***Test: The factories register themselves with the factory registry. Registration
+# information includes the location, the type of object created, a object reference
+# to the factory and set of parameters to be passed to the factory's create_object
+# method.
+#
+# An object group creator is started and asked to create three object groups:
+# a group of hobbits, a group of elves; and another group of hobbits.
+#
+# ***Test: the object group creator asks the registry for the set of factories
+# that can create the type of object needed, then uses the create_object method
+# for each factory to create the actual object.
+#
+# [temporary until IOGR's are working: The object group creator writes the
+# IOR's of the create objects to files -- using a file naming convention to
+# distinguish members of the group. It will be enhanced to assemble these
+# IORs into an IOGR and either write the IOGR to a file or register it with
+# the Naming Service.]
+#
+# The object group creator is also told to unregister all factories that create humans.
+# ***Test: It does so using the unregister_factory_by_type method.
+#
+# Three clients are started, one at a time. Each client is given a reference
+# to an object group
+#
+# [temporary until IOGRs and transparent reinvocaton work: each client is
+# given references to the members of the group and manages its own recovery
+# (client mediated fault tolerance)]
+#
+# Each client sends a few requests to first member of the object group. Eventually
+# this member fails and the requests are then rerouted to the second (and last)
+# member of the group.
+#
+# When a clients job is done, it exits and asks the remaining group member to
+# exit, too.
+#
+# The factories are run with the quit-on-idle option so when the last object
+# created at that location goes away, the factory exits.
+#
+# ***Test: As it exits the factory unregisters itself with the factory registry.
+# ***Test: A command line option determines whether it uses a single
+# unregister_factory_by_location call, or separate unregister_factory calles for
+# each type of object created. In this test, the shire location uses unregister_factory,
+# and bree and rivendell use unregister_factory_by_location.
+#
+# The factory registry is also run with the quit-on-idle option so when the last
+# factory unregisters itself, the factory registry shuts down to end the test.
+
+use lib '../../../../bin';
+#use lib '$ENV{ACE_ROOT}/bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them
+my($debug_builds) = 0; # 0: use exes from Release directories
+my($simulated) = 1; # 1: use "client simulated" fault tolerance
+my($use_rm) = 0; # 1: use replication manager; 0 use stand-alone factory registry
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "-r") # use RegistrationManager
+ {
+ $use_rm = 1
+ }
+ elsif ($i eq "--no_simulate") # reverse this once we have FT ORB support
+ {
+ $simulated = 0;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+ else
+ {
+ print "unknown option $i. Expecting: --debug_build, -r --no_simulate, -v\n";
+ exit(-1);
+ }
+}
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
+}
+
+my($species1) = "hobbit";
+my($species2) = "elf";
+my($species3) = "human";
+my($location1) = "shire";
+my($location2) = "bree";
+my($location3) = "rivendell";
+my($location4) = "rohan";
+
+#define temp files
+my($rm_ior) = PerlACE::LocalFile ("rm.ior");
+my($registry_ior) = PerlACE::LocalFile ("registry.ior");
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($factory3_ior) = PerlACE::LocalFile ("factory3.ior");
+my($replica1_ior) = PerlACE::LocalFile ("${species1}_${location1}_0.ior");
+my($replica2_ior) = PerlACE::LocalFile ("${species1}_${location2}_0.ior");
+my($replica3_ior) = PerlACE::LocalFile ("${species2}_${location2}_1.ior");
+my($replica4_ior) = PerlACE::LocalFile ("${species2}_${location3}_0.ior");
+my($replica5_ior) = PerlACE::LocalFile ("${species1}_${location1}_1.ior");
+my($replica6_ior) = PerlACE::LocalFile ("${species1}_${location2}_2.ior");
+
+my($replica1_iogr) = PerlACE::LocalFile ("${species1}_0.iogr");
+my($replica2_iogr) = PerlACE::LocalFile ("${species2}_1.iogr");
+my($replica3_iogr) = PerlACE::LocalFile ("${species1}_2.iogr");
+
+my($client_data) = PerlACE::LocalFile ("persistent.dat");
+
+#discard junk from previous tests
+unlink $rm_ior;
+unlink $registry_ior;
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $factory3_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $replica3_ior;
+unlink $replica4_ior;
+unlink $replica5_ior;
+unlink $replica6_ior;
+unlink $replica1_iogr;
+unlink $replica2_iogr;
+
+unlink $client_data;
+
+my($status) = 0;
+
+my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
+my ($registry_opt) = "-f file://$registry_ior";
+
+if ($use_rm) {
+ $registry_opt = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+}
+
+my($RM) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/FT_ReplicationManager$build_directory/FT_ReplicationManager", "-ORBDebugLevel 0 -o $rm_ior $rm_endpoint");
+my($RMC) = new PerlACE::Process (".$build_directory/replmgr_controller", "$registry_opt -x");
+my($REG) = new PerlACE::Process (".$build_directory/ft_registry", "-o $registry_ior -q");
+my($FAC1) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory1_ior $registry_opt -l $location1 -i $species1 -q");
+my($FAC2) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory2_ior $registry_opt -l $location2 -i $species1 -i $species2 -i $species3 -q -u");
+my($FAC3) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory3_ior $registry_opt -l $location3 -i $species2 -q -u");
+ # -n means no name service -i means write individual iors
+my($CTR) = new PerlACE::Process (".$build_directory/ft_create", "$registry_opt -r $species1 -r $species2 -r $species1 -u $species3 -n -i");
+
+my($CL1);
+my($CL2);
+my($CL3);
+if ($simulated)
+{
+ print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
+ $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+ $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_ior -f file://$replica4_ior -c testscript");
+ $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica5_ior -f file://$replica6_ior -c testscript");
+}
+else
+{
+ print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
+ $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_iogr -c testscript");
+ $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica2_iogr -c testscript");
+ $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_iogr -c testscript");
+}
+
+#######################
+# Start FactoryRegistry
+if ($use_rm)
+{
+ print "\nTEST: starting ReplicationManager " . $RM->CommandLine . "\n" if ($verbose);
+ $RM->Spawn ();
+
+ print "TEST: waiting for registry's IOR\n" if ($verbose);
+ if (PerlACE::waitforfile_timed ($rm_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$rm_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ exit 1;
+ }
+}
+else
+{
+ print "\nTEST: starting registry " . $REG->CommandLine . "\n" if ($verbose);
+ $REG->Spawn ();
+
+ print "TEST: waiting for registry's IOR\n" if ($verbose);
+ if (PerlACE::waitforfile_timed ($registry_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$registry_ior>\n";
+ $REG->Kill (); $REG->TimedWait (1);
+ exit 1;
+ }
+}
+
+#################
+# Start Factories
+
+print "\nTEST: starting factory 1 " . $FAC1->CommandLine . "\n" if ($verbose);
+$FAC1->Spawn ();
+
+print "TEST: waiting for factory 1's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory1_ior>\n";
+ $REG->Kill (); $REG->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting factory 2 " . $FAC2->CommandLine . "\n" if ($verbose);
+$FAC2->Spawn ();
+
+print "TEST: waiting for factory 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory2_ior>\n";
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $REG->Kill (); $REG->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting factory 3 " . $FAC3->CommandLine . "\n" if ($verbose);
+$FAC3->Spawn ();
+
+print "TEST: waiting for factory 3's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory3_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory3_ior>\n";
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $REG->Kill (); $REG->TimedWait (1);
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ exit 1;
+}
+
+######################
+# Create object groups
+
+print "\nTEST: starting object group creator " . $CTR->CommandLine . "\n" if ($verbose);
+$CTR->Spawn ();
+
+print "TEST: waiting for Replica IOR files from object group creator\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica1_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica2_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica2_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica3_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica3_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica4_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica4_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica5_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica5_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica6_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica6_ior> \n";
+ $status = 1;
+}
+
+if($status != 0){
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $REG->Kill (); $REG->TimedWait (1);
+ $CTR->Kill (); $CTR->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: wait for object group creator.\n" if ($verbose);
+$config = $CTR->WaitKill (5);
+if ($config != 0) {
+ print STDERR "TEST ERROR: configuration manager returned $config\n";
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $REG->Kill (); $REG->TimedWait (1);
+ exit 1;
+}
+
+
+#############
+# Run clients
+
+print "\nTEST: starting client " . $CL1->CommandLine . "\n" if ($verbose);
+$client = $CL1->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "\nTEST: starting client again " . $CL2->CommandLine . "\n" if ($verbose);
+$client2 = $CL2->SpawnWaitKill (60);
+
+if ($client2 != 0) {
+ print STDERR "TEST ERROR: client returned $client2\n";
+ $status = 1;
+}
+
+print "\nTEST: starting client, one more time with feeling " . $CL3->CommandLine . "\n" if ($verbose);
+$client3 = $CL3->SpawnWaitKill (60);
+
+if ($client3 != 0) {
+ print STDERR "TEST ERROR: client returned $client3\n";
+ $status = 1;
+}
+
+######################
+# Clean house and exit
+
+print "\nTEST: wait for factory 1.\n" if ($verbose);
+$factory1 = $FAC1->WaitKill (30);
+if ($factory1 != 0) {
+ print STDERR "TEST ERROR: replica returned $factory 1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for factory 2.\n" if ($verbose);
+$factory2 = $FAC2->WaitKill (30);
+if ($factory2 != 0) {
+ print STDERR "TEST ERROR: factory 2 returned $factory2\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for factory 3.\n" if ($verbose);
+$factory3 = $FAC3->WaitKill (30);
+if ($factory3 != 0) {
+ print STDERR "TEST ERROR: factory 3 returned $factory3\n";
+ $status = 1;
+}
+
+if ($use_rm)
+{
+ print "\nTEST: shutting down the replication manager.\n" if ($verbose);
+ $controller = $RMC->SpawnWaitKill (300);
+ if ($controller != 0) {
+ print STDERR "TEST ERROR: replication manager controller returned $controller\n";
+ $status = 1;
+ }
+
+ print "\nTEST: wait for ReplicationManager.\n" if ($verbose);
+ #$RM->Kill ();
+ $repmgr = $RM->WaitKill (30);
+ if ($repmgr != 0) {
+ print STDERR "TEST ERROR: ReplicationManager returned $repmgr\n";
+ $status = 1;
+ }
+}
+else
+{
+ print "\nTEST: wait for FactoryRegistry.\n" if ($verbose);
+ $registry = $REG->WaitKill (30);
+ if ($registry != 0) {
+ print STDERR "TEST ERROR: FactoryRegistry returned $registry\n";
+ $status = 1;
+ }
+}
+print "\nTEST: releasing scratch files.\n" if ($verbose);
+unlink $rm_ior;
+unlink $registry_ior;
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $factory3_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $replica3_ior;
+unlink $replica4_ior;
+unlink $replica5_ior;
+unlink $replica6_ior;
+unlink $replica1_iogr;
+unlink $replica2_iogr;
+
+unlink $client_data;
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_rmnotifier.pl b/TAO/orbsvcs/tests/FT_App/run_test_rmnotifier.pl
new file mode 100755
index 00000000000..b5023240650
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_rmnotifier.pl
@@ -0,0 +1,319 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# Purpose:
+# To test the FaultNotifier
+#
+# Process being tested:
+# Fault_Notifier
+# implements FaultNotifier interface.
+# Processes used in test:
+# ReplicationManager
+#
+# FT_Replica
+# implements TestReplica interface.
+# implements PullMonitorable.
+# Fault_Detector
+# implements FaultDetectorFactory interface
+# implements PullMonitorable interface
+# FT_Client
+# client for TestReplica interface.
+# client for PullMonitorable.
+# StubAnalyzer
+# Subscribes to Fault_Notfier
+#
+# Test Scenario (***Test: marks behavior being tested):
+# Phase 1:
+# Start two FT_Replicas
+# FT_Replicas write TestReplica IORs (FR#1 and FR#2) to files
+# Start the Fault_Detector
+# Fault_Detector writes its IOR (FDF) to a file
+# Start the Fault_Notifier
+# Fault_Notifier writes its IOR (FN) to a file.
+# Phase 2:
+# Wait for IORs: FR#1, FR#2, FDF, and FN
+# Start the StubAnalyzer giving it IORS: FR#1, FR#2 FDF, FN
+# StubAnalyzer calls FDF to create a FaultDetector
+# for each Replica.
+# StubAnalyzer subscribes to Fault_Notifier
+# StubAnalyzer writes dummy message(READY) to a file.
+# Phase 3:
+# Wait for READY
+# Start FT_Client giving it IORS: FR#1 and FR#2. [1]
+# FT_Client interacts with FR#1.
+# FT_Client asks FR#1 to fault. It does so.
+# FT_Client notices fault and switches to FR#2. [1]
+# FD#1 notices fault and notifies Fault_Notifier
+# FD#1 terminates
+# ***Test: Fault_Notifier forwards notification to StubAnalyzer
+# StubAnalyzer prints notification.
+# FT_Client interacts with FR#2.
+# FT_Client asks FR#2 to shut down.
+# FT_Client shuts down.
+# FD#2 notices FR2 is gone, interprets this
+# as a fault, and sends notification to Fault_Notifier
+# FD#2 terminates.
+# ***Test: Fault_Notifier forwards notification to StubAnalyzer
+# StubAnalyzer prints notification.
+# Phase 4: shutting down.
+# All FaultDetectors have terminated so the FaultDetectorFactory
+# honors the "quit-on-idle" option on it's command line and exits.
+# StubAnalyzer compares # fault notifications to # replicas. When
+# they match, it "knows" that the test is over, so it shuts down.
+# As it does so, it disconnects its fault consumers from the FaultNotifier.
+# FaultNotifier notices the last fault consumer disconnecting and exits because
+# the "quit-on-idle" option was specified on the command line.
+# Phase 5: housekeeping
+# Wait for all processes to terminate.
+# Check termination status.
+# Delete temp files.
+#
+# [1] Client mediated fault tolerance. These points will
+# change when IOGR support is available.
+use lib '../../../../bin';
+#use lib '$ENV{ACE_ROOT}/bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them
+my($debug_builds) = 0; # 0: use exes from Release directories
+my($simulated) = 1; # 1: use "client simulated" fault tolerance
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "--no_simulate") # reverse this once we have FT ORB support
+ {
+ $simulated = 0;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+}
+
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
+}
+
+#define temp files
+my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
+my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+my($rm_ior) = PerlACE::LocalFile ("rm.ior");
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($replica1_ior) = PerlACE::LocalFile ("replica1.ior");
+my($replica2_ior) = PerlACE::LocalFile ("replica2.ior");
+my($detector_ior) = PerlACE::LocalFile ("detector.ior");
+my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
+my($ready_file) = PerlACE::LocalFile ("ready.file");
+my($client_data) = PerlACE::LocalFile ("persistent.dat");
+
+#discard junk from previous tests
+unlink $rm_ior;
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+unlink $ready_file;
+unlink $client_data;
+
+my($status) = 0;
+
+my($RM) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/FT_ReplicationManager$build_directory/FT_ReplicationManager", "-o $rm_ior $rm_endpoint");
+my($RMC) = new PerlACE::Process (".$build_directory/replmgr_controller", "$rm_initref -x");
+my($REP1) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory1_ior -f none -t $replica1_ior -l loc1 -i type1 -q");
+my($REP2) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory2_ior -f none -t $replica2_ior -l loc2 -i type1 -q");
+my($DET) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "$rm_initref -o $detector_ior -q");
+my($NOT) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier$build_directory/Fault_Notifier", "$rm_initref -o $notifier_ior -q");
+my($ANA) = new PerlACE::Process (".$build_directory/ft_analyzer", "-o $ready_file -n file://$notifier_ior -d file://$detector_ior -r file://$replica1_ior -r file://$replica2_ior -q");
+
+my($CL);
+if ($simulated) {
+ print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
+ $CL = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+}else{
+ print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
+ $CL = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_iogr -c testscript");
+}
+
+#######################
+# ReplicationManager
+
+print "\nTEST: starting ReplicationManager " . $RM->CommandLine . "\n" if ($verbose);
+$RM->Spawn ();
+
+print "TEST: waiting for registry's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($rm_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$rm_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ exit 1;
+}
+
+##########
+# Notifier
+print "\nTEST: starting notifier " . $NOT->CommandLine . "\n" if ($verbose);
+$NOT->Spawn ();
+
+print "TEST: waiting for notifier's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($notifier_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ exit 1;
+}
+
+##########
+# Detector
+print "\nTEST: starting detector factory " . $DET->CommandLine . "\n" if ($verbose);
+$DET->Spawn ();
+
+print "TEST: waiting for detector's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($detector_ior, 20) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$detector_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ $DET->Kill (); $DET2->TimedWait(1);
+ exit 1;
+}
+
+###########
+# Replica 1
+print "\nTEST: starting replica1 " . $REP1->CommandLine . "\n" if ($verbose);
+$REP1->Spawn ();
+
+print "TEST: waiting for replica 1's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ $DET->Kill (); $DET->TimedWait(1);
+ $REP1->Kill (); $REP1->TimedWait (1);
+ exit 1;
+}
+
+###########
+# Replica 2
+print "\nTEST: starting replica2 " . $REP2->CommandLine . "\n" if ($verbose);
+$REP2->Spawn ();
+
+print "TEST: waiting for replica 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$replica2_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ $DET->Kill (); $DET->TimedWait(1);
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ exit 1;
+}
+
+##########
+# Analyzer
+print "\nTEST: starting analyzer " . $ANA->CommandLine . "\n" if ($verbose);
+$ANA->Spawn ();
+
+print "TEST: waiting for READY.FILE from analyzer\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($ready_file, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$ready_file>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ $DET->Kill (); $DET->TimedWait(1);
+ $REP1->Kill (); $REP1->TimedWait (1);
+ $REP2->Kill (); $REP2->TimedWait (1);
+ $DET->Kill (); $DET2->TimedWait(1);
+ $NOT->Kill (); $NOT->TimedWait(1);
+ $ANA->Kill (); $ANA->TimedWait(1);
+ exit 1;
+}
+
+########
+# Client
+print "\nTEST: starting client " . $CL->CommandLine . "\n" if ($verbose);
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 1.\n" if ($verbose);
+$replica1 = $REP1->WaitKill (5);
+if ($replica1 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for replica 2.\n" if ($verbose);
+$replica2 = $REP2->WaitKill (5);
+if ($replica2 != 0) {
+ print STDERR "TEST ERROR: replica returned $replica2\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for detector factory to leave.\n" if ($verbose);
+$detector = $DET->WaitKill (20);
+if ($detector != 0) {
+ print STDERR "TEST ERROR: detector returned $detector\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for analyzer to leave.\n" if ($verbose);
+$analyzer = $ANA->WaitKill (20);
+if ($analyzer != 0) {
+ print STDERR "TEST ERROR: analyzer returned $analyzer\n";
+ $status = 1;
+}
+
+print "\nTEST: shutting down the replication manager.\n" if ($verbose);
+$controller = $RMC->SpawnWaitKill (300);
+if ($controller != 0) {
+ print STDERR "TEST ERROR: replication manager controller returned $controller\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for ReplicationManager.\n" if ($verbose);
+#$RM->Kill ();
+$repmgr = $RM->WaitKill (30);
+if ($repmgr != 0) {
+ print STDERR "TEST ERROR: ReplicationManager returned $repmgr\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for notifier to leave.\n" if ($verbose);
+$notifier = $NOT->WaitKill (20);
+if ($notifier != 0) {
+ print STDERR "TEST ERROR: notifier returned $notifier\n";
+ $status = 1;
+}
+
+print "\nTEST: releasing scratch files.\n" if ($verbose);
+unlink $rm_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $detector_ior;
+unlink $notifier_ior;
+unlink $ready_file;
+
+#client's work file
+unlink $client_data;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_rmregistry.pl b/TAO/orbsvcs/tests/FT_App/run_test_rmregistry.pl
new file mode 100755
index 00000000000..5facd17d085
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/run_test_rmregistry.pl
@@ -0,0 +1,385 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# Purpose:
+# To test the FactoryRegistry as a component of ReplicationManager
+#
+# Process being tested:
+# FT_ReplicationManager
+# implements PortableGroup::FactoryRegistry interface.
+# Processes used in test:
+# FT_Replica * 3
+# implements GenericFactory interface to create TestReplicas
+# TestReplica implements TestReplica interface.
+# TestReplica implements PullMonitorable interface.
+# FT_Client
+# client for TestReplica interface.
+# client for PullMonitorable.
+# Object Group Creator
+# Creates groups of objects.
+#
+# Test Scenario (***Test: marks behavior being tested):
+#
+# First the test starts The ReplicationManager,
+# Then starts three factories. Each factory exists at a separate location.
+# The locations are named shire, bree, and rivendell. In a "real" system
+# these locations would be on separate computers.
+#
+# The factory at the shire location knows how to create hobbits.
+# The factory at the bree location knows how to create hobbits, elves, and humans.
+# The factory at rivendell can create elves.
+# Hobbits, elves, and humans are roles for TestReplica objects. A creation parameter
+# included as part of the registration information specifies which role they are playing.
+#
+# ***Test: The factories register themselves with the factory registry in the ReplicationManager.
+# Registration information includes:
+# the role,
+# the type of object created,
+# the location,
+# an object reference to the factory and
+# a set of parameters to be passed to the factory's create_object method.
+#
+# An object group creator is started and asked to create three object groups:
+# a group of hobbits, a group of elves; and another group of hobbits.
+#
+# ***Test: the object group creator asks the ReplicationManager::FactoryRegistry
+# for the set of factories that can create objects for the desired role.
+# Then it uses the create_object method for each factory to create the actual object.
+#
+# [temporary until IOGR's are working: The object group creator writes the
+# IOR's of the create objects to files -- using a file naming convention to
+# distinguish members of the group. It will be enhanced to assemble these
+# IORs into an IOGR and either write the IOGR to a file or register it with
+# the Naming Service.]
+#
+# The object group creator is also told to unregister all factories that create humans.
+# ***Test: It does so using the unregister_factory_by_role method.
+#
+# Three clients are started, one at a time. Each client is given a reference
+# to an object group
+#
+# [temporary until IOGRs and transparent reinvocaton work: each client is
+# given references to the members of the group and manages its own recovery
+# (client mediated fault tolerance)]
+#
+# Each client sends a few requests to first member of the object group. Eventually
+# this member fails and the requests are then rerouted to the second (and last)
+# member of the group.
+#
+# When a clients job is done, it exits and asks the remaining group member to
+# exit, too.
+#
+# The factories are run with the quit-on-idle option so when the last object
+# created at that location goes away, the factory exits.
+#
+# ***Test: As it exits the factory unregisters itself with the ReplicationManager::FactoryRegistry.
+# ***Test: A command line option determines whether it uses a single
+# unregister_factory_by_location call, or separate unregister_factory calles for
+# each type of object created. In this test, the shire location uses unregister_factory,
+# and bree and rivendell use unregister_factory_by_location.
+#
+# The factory registry is also run with the quit-on-idle option so when the last
+# factory unregisters itself.
+# The ReplicationManager is killed because it doesn't have a quit-on-idle option.
+
+use lib '../../../../bin';
+#use lib '$ENV{ACE_ROOT}/bin';
+use PerlACE::Run_Test;
+
+########################
+#command line options
+#set defaults:
+my($verbose) = 0; # 1: report perl actions before executing them
+my($debug_builds) = 0; # 0: use exes from Release directories
+my($simulated) = 1; # 1: use "client simulated" fault tolerance
+
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build")
+ {
+ $debug_builds = 1;
+ }
+ elsif ($i eq "--no_simulate") # reverse this once we have FT ORB support
+ {
+ $simulated = 0;
+ }
+ elsif ($i eq "-v")
+ {
+ $verbose += 1;
+ }
+}
+
+my($build_directory) = "/Release";
+if ( $debug_builds ) {
+ $build_directory = "";
+}
+
+if ( $verbose > 1) {
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
+}
+
+my($role1) = "hobbit";
+my($role2) = "elf";
+my($role3) = "human";
+
+my($location1) = "shire";
+my($location2) = "bree";
+my($location3) = "rivendell";
+my($location4) = "rohan";
+
+my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
+my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+
+#define temp files
+my($rm_ior) = PerlACE::LocalFile ("rm.ior");
+my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
+my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
+my($factory3_ior) = PerlACE::LocalFile ("factory3.ior");
+my($replica1_ior) = PerlACE::LocalFile ("${role1}_${location1}_0.ior");
+my($replica2_ior) = PerlACE::LocalFile ("${role1}_${location2}_0.ior");
+my($replica3_ior) = PerlACE::LocalFile ("${role2}_${location2}_1.ior");
+my($replica4_ior) = PerlACE::LocalFile ("${role2}_${location3}_0.ior");
+my($replica5_ior) = PerlACE::LocalFile ("${role1}_${location1}_1.ior");
+my($replica6_ior) = PerlACE::LocalFile ("${role1}_${location2}_2.ior");
+
+my($replica1_iogr) = PerlACE::LocalFile ("${role1}_0.iogr");
+my($replica2_iogr) = PerlACE::LocalFile ("${role2}_1.iogr");
+my($replica3_iogr) = PerlACE::LocalFile ("${role1}_2.iogr");
+
+my($client_data) = PerlACE::LocalFile ("persistent.dat");
+
+#discard junk from previous tests
+unlink $rm_ior;
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $factory3_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $replica3_ior;
+unlink $replica4_ior;
+unlink $replica5_ior;
+unlink $replica6_ior;
+unlink $replica1_iogr;
+unlink $replica2_iogr;
+
+unlink $client_data;
+
+my($status) = 0;
+
+my($RM) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/FT_ReplicationManager$build_directory/FT_ReplicationManager", "-ORBDebugLevel 0 -o $rm_ior $rm_endpoint");
+my($RMC) = new PerlACE::Process (".$build_directory/replmgr_controller", "$rm_initref -x");
+my($FAC1) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory1_ior $rm_initref -l $location1 -i $role1 -q");
+my($FAC2) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory2_ior $rm_initref -l $location2 -i $role1 -i $role2 -i $role3 -q -u");
+my($FAC3) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory3_ior $rm_initref -l $location3 -i $role2 -q -u");
+my($CTR) = new PerlACE::Process (".$build_directory/ft_create", "$rm_initref -n -r $role1 -r $role2 -r $role1 -u $role3 -i");
+
+my($CL1);
+my($CL2);
+my($CL3);
+if ($simulated) {
+ print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
+ $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
+ $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_ior -f file://$replica4_ior -c testscript");
+ $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica5_ior -f file://$replica6_ior -c testscript");
+}else{
+ print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
+ $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_iogr -c testscript");
+ $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica2_iogr -c testscript");
+ $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_iogr -c testscript");
+}
+
+#######################
+# Start ReplicationManager
+
+print "\nTEST: starting ReplicationManager " . $RM->CommandLine . "\n" if ($verbose);
+$RM->Spawn ();
+
+print "TEST: waiting for registry's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($rm_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$rm_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ exit 1;
+}
+
+
+#################
+# Start Factories
+
+print "\nTEST: starting factory 1 " . $FAC1->CommandLine . "\n" if ($verbose);
+$FAC1->Spawn ();
+
+print "TEST: waiting for factory 1's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory1_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory1_ior>\n";
+ $RM->Kill (); $RM->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting factory 2 " . $FAC2->CommandLine . "\n" if ($verbose);
+$FAC2->Spawn ();
+
+print "TEST: waiting for factory 2's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory2_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory2_ior>\n";
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $RM->Kill (); $RM->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ exit 1;
+}
+
+print "\nTEST: starting factory 3 " . $FAC3->CommandLine . "\n" if ($verbose);
+$FAC3->Spawn ();
+
+print "TEST: waiting for factory 3's IOR\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($factory3_ior, 5) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$factory3_ior>\n";
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $RM->Kill (); $RM->TimedWait (1);
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ exit 1;
+}
+
+######################
+# Create object groups
+
+print "\nTEST: starting object group creator " . $CTR->CommandLine . "\n" if ($verbose);
+$CTR->Spawn ();
+
+print "TEST: waiting for Replica IOR files from object group creator\n" if ($verbose);
+if (PerlACE::waitforfile_timed ($replica1_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica2_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica2_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica3_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica3_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica4_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica4_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica5_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica5_ior> \n";
+ $status = 1;
+}
+elsif (PerlACE::waitforfile_timed ($replica6_ior, 5) == -1){
+ print STDERR "TEST ERROR: cannot find file <$replica6_ior> \n";
+ $status = 1;
+}
+
+if($status != 0){
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $RM->Kill (); $RM->TimedWait (1);
+ $CTR->Kill (); $CTR->TimedWait(1);
+ exit 1;
+}
+
+print "\nTEST: wait for object group creator.\n" if ($verbose);
+$config = $CTR->WaitKill (5);
+if ($config != 0) {
+ print STDERR "TEST ERROR: configuration manager returned $config\n";
+ $FAC3->Kill (); $FAC3->TimedWait (1);
+ $FAC2->Kill (); $FAC2->TimedWait (1);
+ $FAC1->Kill (); $FAC1->TimedWait (1);
+ $RM->Kill (); $RM->TimedWait (1);
+ exit 1;
+}
+
+
+#############
+# Run clients
+
+print "\nTEST: starting client " . $CL1->CommandLine . "\n" if ($verbose);
+$client = $CL1->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "TEST ERROR: client returned $client\n";
+ $status = 1;
+}
+
+print "\nTEST: starting client again " . $CL2->CommandLine . "\n" if ($verbose);
+$client2 = $CL2->SpawnWaitKill (60);
+
+if ($client2 != 0) {
+ print STDERR "TEST ERROR: client returned $client2\n";
+ $status = 1;
+}
+
+print "\nTEST: starting client, one more time with feeling " . $CL3->CommandLine . "\n" if ($verbose);
+$client3 = $CL3->SpawnWaitKill (60);
+
+if ($client3 != 0) {
+ print STDERR "TEST ERROR: client returned $client3\n";
+ $status = 1;
+}
+
+######################
+# Clean house and exit
+
+print "\nTEST: wait for factory 1.\n" if ($verbose);
+$factory1 = $FAC1->WaitKill (30);
+if ($factory1 != 0) {
+ print STDERR "TEST ERROR: replica returned $factory 1\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for factory 2.\n" if ($verbose);
+$factory2 = $FAC2->WaitKill (30);
+if ($factory2 != 0) {
+ print STDERR "TEST ERROR: factory 2 returned $factory2\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for factory 3.\n" if ($verbose);
+$factory3 = $FAC3->WaitKill (30);
+if ($factory3 != 0) {
+ print STDERR "TEST ERROR: factory 3 returned $factory3\n";
+ $status = 1;
+}
+
+print "\nTEST: shutting down the replication manager.\n" if ($verbose);
+$controller = $RMC->SpawnWaitKill (300);
+if ($controller != 0) {
+ print STDERR "TEST ERROR: replication manager controller returned $controller\n";
+ $status = 1;
+}
+
+print "\nTEST: wait for ReplicationManager.\n" if ($verbose);
+#$RM->Kill ();
+$repmgr = $RM->WaitKill (30);
+if ($repmgr != 0) {
+ print STDERR "TEST ERROR: ReplicationManager returned $repmgr\n";
+ $status = 1;
+}
+
+print "\nTEST: releasing scratch files.\n" if ($verbose);
+unlink $rm_ior;
+unlink $factory1_ior;
+unlink $factory2_ior;
+unlink $factory3_ior;
+unlink $replica1_ior;
+unlink $replica2_ior;
+unlink $replica3_ior;
+unlink $replica4_ior;
+unlink $replica5_ior;
+unlink $replica6_ior;
+unlink $replica1_iogr;
+unlink $replica2_iogr;
+
+unlink $client_data;
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/testscript b/TAO/orbsvcs/tests/FT_App/testscript
new file mode 100644
index 00000000000..a428a227ef3
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_App/testscript
@@ -0,0 +1,10 @@
+v3 echo commands
+=0
++5
+d3 FMI: d3 is before state change; d4 is before replication;d5 is before reply
++5
+c10
++5
+z3 sleep for a while
++7
+q1 quit and bring down current primary replica
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/GroupRef_Manipulation.mpc b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/GroupRef_Manipulation.mpc
new file mode 100644
index 00000000000..34ea5a9e113
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/GroupRef_Manipulation.mpc
@@ -0,0 +1,36 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ idlflags += -DCORBA3
+
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): taoserver, orbsvcsexe, iormanip, pi_server, ftorb, messaging {
+ after += *idl
+ Source_Files {
+ test_i.cpp
+ testC.cpp
+ testS.cpp
+ Server_ORBInitializer.cpp
+ Server_Request_Interceptor.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient, orbsvcsexe, iormanip, pi_server, ftorb {
+ after += *idl
+ Source_Files {
+ testC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Makefile.am b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Makefile.am
new file mode 100644
index 00000000000..7fc6b28e84a
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Makefile.am
@@ -0,0 +1,156 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.GroupRef_Manipulation_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St -DCORBA3 $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.GroupRef_Manipulation_Client.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp \
+ testC.cpp \
+ Server_ORBInitializer.h \
+ Server_Request_Interceptor.h \
+ test_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.GroupRef_Manipulation_Server.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ Server_ORBInitializer.cpp \
+ Server_Request_Interceptor.cpp \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ Server_ORBInitializer.h \
+ Server_Request_Interceptor.h \
+ test_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/README b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/README
new file mode 100644
index 00000000000..19cb9b85892
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/README
@@ -0,0 +1,21 @@
+/**
+
+@page GroupRef_Manipulation Test README File
+
+ This is a simple test which tests the following
+
+- If a client receives a location forwarding with a new IOGR version,
+ the next request from the client should have the new version in the
+ FT_GROUP_VERSION context of the GIOP header
+
+- that location forwarding to a FTORB actually works.
+
+The test creates two IOR's and sets both of them as primaries. The
+first IOR is passed to the client for making invocations. After a
+certain number of invocations from the client, the server request
+interceptor throw ForwardRequest exception with a reference to the
+second IOR which also has new IOGR revision information. The
+server side interceptor checks whether the subsequent calls have the
+new version information.
+
+*/
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.cpp b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.cpp
new file mode 100644
index 00000000000..a446d0d7eff
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.cpp
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+#include "Server_ORBInitializer.h"
+#include "tao/ORB_Constants.h"
+
+ACE_RCSID (ForwardRequest,
+ Server_ORBInitializer,
+ "$Id$")
+
+#if TAO_HAS_INTERCEPTORS == 1
+
+#include "Server_Request_Interceptor.h"
+
+Server_ORBInitializer::Server_ORBInitializer (void)
+ : server_interceptor_ ()
+{
+}
+
+void
+Server_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr interceptor;
+ // Install the server request interceptor.
+ ACE_NEW_THROW_EX (interceptor,
+ Server_Request_Interceptor,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ this->server_interceptor_ = interceptor;
+
+ info->add_server_request_interceptor (interceptor
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+PortableInterceptor::ServerRequestInterceptor_ptr
+Server_ORBInitializer::server_interceptor (void)
+{
+ return
+ PortableInterceptor::ServerRequestInterceptor::_duplicate (
+ this->server_interceptor_.in ());
+}
+
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.h b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.h
new file mode 100644
index 00000000000..f2c7f5d20e8
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_ORBInitializer.h
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * Implementation header for the PortableInterceptor::ForwardRequest
+ * exception test server side ORB initializer.
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_SERVER_ORB_INITIALIZER_H
+#define TAO_SERVER_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/LocalObject.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if TAO_HAS_INTERCEPTORS == 1
+
+#include "tao/PI/PI.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+// Forward declaration.
+class Server_Request_Interceptor;
+
+/// Server side ORB initializer.
+class Server_ORBInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ Server_ORBInitializer (void);
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the created server request interceptor. Only valid after
+ /// post_init(), i.e. ORB_init(), has been called.
+ PortableInterceptor::ServerRequestInterceptor_ptr server_interceptor (void);
+
+private:
+
+ /// Pointer to the server request interceptor. ORB is responsible
+ /// for storage.
+ PortableInterceptor::ServerRequestInterceptor_var server_interceptor_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_HAS_INTERCEPTORS == 1 */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_SERVER_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp
new file mode 100644
index 00000000000..fe39a7dc7b6
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.cpp
@@ -0,0 +1,214 @@
+// -*- C++ -*-
+
+#include "Server_Request_Interceptor.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/PI_Server/PI_Server.h"
+#include "tao/ORB_Constants.h"
+#include "tao/CDR.h"
+#include "testS.h"
+
+ACE_RCSID (ForwardRequest,
+ Server_Request_Interceptor,
+ "$Id$")
+
+Server_Request_Interceptor::Server_Request_Interceptor (void)
+ : request_count_ (0)
+ , forward_request_thrown_ (false)
+{
+ this->obj_[0] = CORBA::Object::_nil ();
+ this->obj_[1] = CORBA::Object::_nil ();
+}
+
+Server_Request_Interceptor::~Server_Request_Interceptor (void)
+{
+}
+
+void
+Server_Request_Interceptor::reset (ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->request_count_ = 0;
+ this->forward_request_thrown_ = false;
+}
+
+void
+Server_Request_Interceptor::forward_references (
+ CORBA::Object_ptr obj1,
+ CORBA::Object_ptr obj2
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (CORBA::is_nil (obj1) || CORBA::is_nil (obj2))
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO));
+
+ char *argv[] = {NULL};
+ int argc = 0;
+
+ // Fetch the ORB having been initialized in main()
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "Server ORB" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str1 = orb->object_to_string (obj1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str2 = orb->object_to_string (obj2 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->obj_[0] = orb->string_to_object (str1.in () ACE_ENV_ARG_PARAMETER);
+ this->obj_[1] = orb->string_to_object (str2.in () ACE_ENV_ARG_PARAMETER);
+}
+
+char *
+Server_Request_Interceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("Server_Request_Interceptor");
+}
+
+void
+Server_Request_Interceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::release (this->obj_[0]);
+ CORBA::release (this->obj_[1]);
+}
+
+void
+Server_Request_Interceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ this->request_count_++;
+
+/* ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) receive_request_service_context called [%d] times \n",
+ this->request_count_));
+ */
+
+ if (this->forward_request_thrown_ == true)
+ {
+ IOP::ServiceContext_var svc =
+ ri->get_request_service_context (IOP::FT_GROUP_VERSION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // extract the group component
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (svc->context_data.get_buffer ()),
+ svc->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ return;
+ }
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ FT::TagFTGroupTaggedComponent group_component;
+
+ //cdr >> group_component.component_version;
+ //cdr >> group_component.group_domain_id.inout ();
+ //cdr >> group_component.object_group_id;
+ cdr >> group_component.object_group_ref_version;
+
+ if (group_component.object_group_ref_version != 5)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Error occurred \n"));
+ }
+
+ }
+}
+
+void
+Server_Request_Interceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ if (this->request_count_ == 8)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "SERVER (%P|%t) Request %d will be forwarded "
+ "to object 1\n" // "object 1" as in "obj_[0]"
+ "SERVER (%P|%t) via "
+ "receive_request_service_contexts().\n",
+ this->request_count_));
+
+ this->forward_request_thrown_ = true;
+
+ // Throw forward exception
+ ACE_THROW (PortableInterceptor::ForwardRequest (this->obj_[1]));
+ }
+
+ if (this->forward_request_thrown_ == true)
+ {
+ IOP::ServiceContext_var svc =
+ ri->get_request_service_context (IOP::FT_GROUP_VERSION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // extract the group component
+ TAO_InputCDR cdr (reinterpret_cast<const char*> (svc->context_data.get_buffer ()),
+ svc->context_data.length ());
+
+ CORBA::Boolean byte_order;
+
+ if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
+ {
+ return;
+ }
+
+ cdr.reset_byte_order (static_cast<int> (byte_order));
+
+ FT::TagFTGroupTaggedComponent group_component;
+
+ //cdr >> group_component.component_version;
+ //cdr >> group_component.group_domain_id.inout ();
+ //cdr >> group_component.object_group_id;
+ cdr >> group_component.object_group_ref_version;
+
+ if (group_component.object_group_ref_version != 5)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Error occurred \n"));
+ }
+
+ }
+ return;
+}
+
+void
+Server_Request_Interceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+Server_Request_Interceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+Server_Request_Interceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h
new file mode 100644
index 00000000000..d8a5ce664cf
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/Server_Request_Interceptor.h
@@ -0,0 +1,125 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_Request_Interceptor.h
+ *
+ * $Id$
+ *
+ * Implementation header for the server request interceptor for the
+ * IOGR manipulation test
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef SERVER_REQUEST_INTERCEPTOR_H
+#define SERVER_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "testC.h"
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class Server_Request_Interceptor
+ *
+ * @brief Simple concrete server request interceptor.
+ *
+ *
+ */
+class Server_Request_Interceptor
+ : public virtual ForwardRequestTest::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ Server_Request_Interceptor (void);
+
+ /// Destructor.
+ ~Server_Request_Interceptor (void);
+
+ /// Set the references to which requests will be forwarded.
+ virtual void forward_references (CORBA::Object_ptr obj1,
+ CORBA::Object_ptr obj2
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Reset to initial state, like counter etc, keeps the object-references
+ virtual void reset (ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+
+ /**
+ * @name Methods Required by the Server Request Interceptor
+ * Interface
+ *
+ * These are methods that must be implemented since they are pure
+ * virtual in the abstract base class. They are the canonical
+ * methods required for all server request interceptors.
+ */
+ //@{
+ /// Return the name of this ServerRequestinterceptor.
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+ //@}
+
+private:
+
+ /// The number of requests intercepted by this interceptor.
+ CORBA::ULong request_count_;
+
+ /// References to the two objects used in this test.
+ CORBA::Object_ptr obj_[2];
+
+ /// Flag to indicate whether a forward request was thrown.
+ bool forward_request_thrown_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp
new file mode 100644
index 00000000000..58fd3cc610b
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/client.cpp
@@ -0,0 +1,134 @@
+// -*- C++ -*-
+
+#include "ace/Get_Opt.h"
+#include "testC.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+
+ACE_RCSID (Group_Ref_Manip,
+ client,
+ "$Id$")
+
+const char *ior = 0;
+
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-k IOR_1 -k IOR_2\n",
+ argv[0]),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int status = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ "Client ORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (::parse_args (argc, argv) != 0)
+ return -1;
+
+ // Start out with the first IOR. Interaction with the second
+ // IOR occurs during the various interceptions executed during
+ // this test.
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ForwardRequestTest::test_var server =
+ ForwardRequestTest::test::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Before and after the LOCATION_FORWARD_PERM the marshaled
+ // object reference must differ.
+
+ // Create a stringified/marshaled snapshot of Object reference
+ CORBA::String_var marshaled_obj_snapshot1 =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ CORBA::ULong number = 0;
+ for (int i = 1; i <= 25; ++i)
+ {
+ ACE_DEBUG ((LM_INFO,
+ "CLIENT: Issuing request %d.\n",
+ i));
+
+ number += server->number (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_INFO,
+ "CLIENT: Number %d .\n",
+ number));
+
+
+
+ }
+
+ if (number < 250)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: Did not forward to new location \n"));
+ ACE_OS::abort ();
+ }
+
+ // One of the request triggerd a LOCATION_FORWARD_PERM, in
+ // consequence the marshaled representation of "server" should
+ // look different now, compare to snapshot1.
+ CORBA::String_var marshaled_obj_snapshot2 =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+
+ if (strcmp (marshaled_obj_snapshot1.in (), marshaled_obj_snapshot2.in ()) == 0)
+ {
+ // Error, before and after the marhaled object references look equal
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: Marshaled Object reference should differ after LOCATION_FORWARD_PERM\n"));
+ ACE_OS::abort ();
+ }
+
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_INFO,
+ "Group_Ref_Manip Test passed.\n"));
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/run_test.pl b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/run_test.pl
new file mode 100755
index 00000000000..52e5752ad24
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server", "-o $iorfile");
+$CL = new PerlACE::Process ("client", "-k file://$iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+$SV->Kill();
+
+unlink $iorfile;
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ exit $client;
+}
+
+exit 0;
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/server.cpp b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/server.cpp
new file mode 100644
index 00000000000..ee1bd7e9d0e
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/server.cpp
@@ -0,0 +1,280 @@
+// -*- C++ -*-
+
+#include "ace/Get_Opt.h"
+#include "test_i.h"
+#include "ace/OS_NS_stdio.h"
+
+#if TAO_HAS_INTERCEPTORS
+
+#include "Server_ORBInitializer.h"
+#include "Server_Request_Interceptor.h"
+#include "tao/IORManipulation/IORManipulation.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+
+ACE_RCSID (ForwardRequest,
+ server,
+ "$Id$")
+
+const char *ior_file = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_file = get_opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-o IOR\n",
+ argv[0]),
+ -1);
+ }
+
+ return 0;
+}
+
+void
+add_ft_prop (CORBA::ORB_ptr o,
+ CORBA::Object_ptr obj1,
+ CORBA::Object_ptr obj2
+ ACE_ENV_ARG_DECL)
+{
+ // Get an object reference for the ORBs IORManipultion object!
+ CORBA::Object_var IORM =
+ o->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_IOP::TAO_IOR_Manipulation_var iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+
+ // Property values
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ const char *id = "version_testing";
+ ft_tag_component.group_domain_id = id;
+
+ // Object group id
+ ft_tag_component.object_group_id =
+ (CORBA::ULongLong) 10;
+
+ // Version
+ ft_tag_component.object_group_ref_version =
+ (CORBA::ULong) 1;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property for object 1
+ CORBA::Boolean retval = iorm->set_property (&iogr_prop,
+ obj1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (retval != 0)
+ {
+ retval = iorm->set_primary (&iogr_prop,
+ obj1,
+ obj1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+
+ // Set the property for object 2
+ // Change the version. That is the point of this test
+ // Version
+ ft_tag_component.object_group_ref_version = (CORBA::ULong) 5;
+
+ retval = iorm->set_property (&iogr_prop,
+ obj2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (retval != 0)
+ {
+ retval = iorm->set_primary (&iogr_prop,
+ obj2,
+ obj2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ return;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ Server_ORBInitializer *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ Server_ORBInitializer,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "Server ORB" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (::parse_args (argc, argv) != 0)
+ return -1;
+
+ CORBA::PolicyList policies; // Empty policy list.
+
+ // Servant 1
+ test_i servant1 (1, orb.in ());
+ test_i servant2 (317, orb.in ());
+
+ PortableServer::POA_var first_poa =
+ root_poa->create_POA ("first POA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+
+ PortableServer::ObjectId_var oid1 =
+ first_poa->activate_object (&servant1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var oid2 =
+ first_poa->activate_object (&servant2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj1 =
+ first_poa->servant_to_reference (&servant1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj2 =
+ first_poa->servant_to_reference (&servant2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ (void) add_ft_prop (orb.in (),
+ obj1.in (),
+ obj2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (obj1.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "ForwardRequestTest::test servant 1: <%s>\n",
+ ior.in ()));
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set the forward references in the server request interceptor.
+ PortableInterceptor::ServerRequestInterceptor_var
+ server_interceptor = temp_initializer->server_interceptor ();
+
+ ForwardRequestTest::ServerRequestInterceptor_var interceptor =
+ ForwardRequestTest::ServerRequestInterceptor::_narrow (
+ server_interceptor.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (interceptor.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) Could not obtain reference to "
+ "server request interceptor.\n"),
+ -1);
+
+ interceptor->forward_references (obj1.in (),
+ obj2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Write each IOR to a file.
+
+ // IOR 1
+ FILE *output_file= ACE_OS::fopen (ior_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file <%s> for writing "
+ "IOR: %s",
+ ior.in ()),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ // Run the ORB event loop.
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+#else
+
+int
+main (int, char *[])
+{
+ return 0;
+}
+
+#endif /* TAO_HAS_INTERCEPTORS */
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl
new file mode 100644
index 00000000000..f154942bbb7
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test.idl
@@ -0,0 +1,30 @@
+// -*- IDL -*-
+//$Id$
+#include "tao/PortableInterceptor.pidl"
+#include "tao/PI_Server/PI_Server_include.pidl"
+
+module ForwardRequestTest
+{
+
+ interface test
+ {
+ /// Return the number assigned to the current object. For
+ /// example, object one will return "1," and object two will
+ /// return "2."
+ short number ();
+
+ oneway void shutdown ();
+ };
+
+ local interface ServerRequestInterceptor
+ : PortableInterceptor::ServerRequestInterceptor
+ {
+
+ /// Set the references to which requests will be forwarded.
+ void forward_references (in Object obj1,
+ in Object obj2);
+
+ void reset ();
+ };
+
+};
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.cpp b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.cpp
new file mode 100644
index 00000000000..adafe5be28d
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.cpp
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+
+#include "test_i.h"
+
+ACE_RCSID (ForwardRequest,
+ test_i,
+ "$Id$")
+
+test_i::test_i (CORBA::Short num,
+ CORBA::ORB_ptr orb)
+ : number_ (num),
+ orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+test_i::~test_i (void)
+{
+}
+
+CORBA::Short
+test_i::number (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->number_;
+}
+
+void
+test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Server is shutting down via object %d.\n",
+ this->number_));
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.h b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.h
new file mode 100644
index 00000000000..34f6bcbdbc3
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/test_i.h
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file test_i.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
+ */
+//=============================================================================
+#ifndef TEST_I_H
+#define TEST_I_H
+
+#include "testS.h"
+
+/**
+ * @class test_i
+ *
+ * @brief Simple test class.
+ *
+ * This class implements the "test" interface used in this test.
+ */
+class test_i : public virtual POA_ForwardRequestTest::test
+{
+public:
+
+ /// Constructor.
+ test_i (CORBA::Short num,
+ CORBA::ORB_ptr orb);
+
+ /// Destructor.
+ ~test_i (void);
+
+ /// Return the number assigned to this object.
+ virtual CORBA::Short number (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Shutdown the ORB.
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// The number assigned to this object.
+ CORBA::Short number_;
+
+ /// Pseudo-reference to the ORB.
+ CORBA::ORB_var orb_;
+
+};
+
+#endif /* TEST_I_H */
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/Client_i.h b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Client_i.h
new file mode 100644
index 00000000000..110808818f7
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Client_i.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// test
+//
+// = FILENAME
+// Client_i.h
+//
+// = DESCRIPTION
+// A helper class for the client
+//
+// = AUTHOR
+// Bala Natarajan <bala@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TEST_FT_IOGR_CLIENT_I_H
+#define TEST_FT_IOGR_CLIENT_I_H
+
+#include /**/ "ace/pre.h"
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class Client_i
+{
+public:
+ Client_i (CORBA::ORB_ptr orb);
+ // Our constructor
+
+ void init (ACE_ENV_SINGLE_ARG_DECL);
+ // Initialize the ORB etc.
+
+private:
+ CORBA::ORB_var orb_;
+
+};
+
+#include /**/ "ace/post.h"
+#endif /*TEST_FT_IOGR_CLIENT_I_H*/
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/FaultTolerance_IOGR.mpc b/TAO/orbsvcs/tests/FaultTolerance/IOGR/FaultTolerance_IOGR.mpc
new file mode 100644
index 00000000000..bdc5ba72437
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/FaultTolerance_IOGR.mpc
@@ -0,0 +1,31 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*server): portableserver, orbsvcsexe, iormanip, ftorb, messaging {
+ after += *idl
+ Source_Files {
+ test_i.cpp
+ testS.cpp
+ testC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Manager): portableserver, orbsvcsexe, iormanip, ftorb {
+ after += *idl
+ Source_Files {
+ testC.cpp
+ Manager.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/Makefile.am b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Makefile.am
new file mode 100644
index 00000000000..27be663173a
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Makefile.am
@@ -0,0 +1,150 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.FaultTolerance_IOGR_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.FaultTolerance_IOGR_Manager.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Manager
+
+Manager_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Manager_SOURCES = \
+ Manager.cpp \
+ testC.cpp \
+ Manager.h
+
+Manager_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FaultTolerance_IOGR_Server.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ test_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.cpp b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.cpp
new file mode 100644
index 00000000000..543da3eff4f
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.cpp
@@ -0,0 +1,404 @@
+//$Id$
+#include "Manager.h"
+#include "Client_i.h"
+#include "testC.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/FaultTolerance/FT_Service_Activate.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_fcntl.h"
+
+// Files which have the IOR
+const char *first_ior = 0;
+const char *second_ior = 0;
+const char *ior_output_file = 0;
+
+// Objects
+CORBA::Object_var object_primary = 0;
+CORBA::Object_var object_secondary = 0;
+
+// Reference to the IOR manipulator
+TAO_IOP::TAO_IOR_Manipulation_var iorm = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "a:b:c:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'a':
+ first_ior = get_opts.opt_arg ();
+ break;
+ case 'b':
+ second_ior = get_opts.opt_arg ();
+ break;
+ case 'c':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-a <iorfile>"
+ "-b <iorfile>"
+ "-c <output ior file>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+int
+main (int argc,
+ char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ Manager manager;
+
+ ACE_TRY
+ {
+ // Initilaize the ORB, POA etc.
+ manager.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // the command line arguments
+ if (parse_args (argc, argv) == -1)
+ return -1;
+
+ // Merge the different IORS
+ manager.make_merged_iors (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set properties. This is the most important portion of the
+ // test
+ manager.set_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Write IOR to file
+ manager.write_to_file ();
+
+ // Client, who is going to use the merged IOR
+ // Construct that with the managers ORB
+ Client_i client_imp (manager.orb ());
+ client_imp.init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+Manager::Manager (void)
+ :orb_ (0),
+ merged_set_ (0)
+{
+ //no-op
+}
+
+void
+Manager::init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Obtain the RootPOA.
+ CORBA::Object_var obj_var =
+ this->orb_->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get the POA_var object from Object_var.
+ PortableServer::POA_var root_poa_var =
+ PortableServer::POA::_narrow (obj_var.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get the POAManager of the RootPOA.
+ PortableServer::POAManager_var poa_manager_var =
+ root_poa_var->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager_var->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+Manager::make_merged_iors (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // First server
+ object_primary =
+ this->orb_->string_to_object (first_ior
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ //Second server
+ object_secondary =
+ this->orb_->string_to_object (second_ior
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Get an object reference for the ORBs IORManipultion object!
+ CORBA::Object_var IORM =
+ this->orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (2);
+ iors.length(2);
+ iors [0] = CORBA::Object::_duplicate (object_primary.in ());
+ iors [1] = CORBA::Object::_duplicate (object_secondary.in ());
+
+ // Create a merged set 1;
+ merged_set_ =
+ iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Manager::set_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ const char *id = "iogr_testing";
+ ft_tag_component.group_domain_id = id;
+
+ // Object group id
+ ft_tag_component.object_group_id =
+ (CORBA::ULongLong) 10;
+
+ // Version
+ ft_tag_component.object_group_ref_version =
+ (CORBA::ULong) 5;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property
+ CORBA::Boolean retval = iorm->set_property (&iogr_prop,
+ this->merged_set_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Set the primary
+ // See we are setting the second ior as the primary
+ if (retval != 0)
+ {
+ retval = iorm->set_primary (&iogr_prop,
+ object_secondary.in (),
+ this->merged_set_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+int
+Manager::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Error in run \n"),
+ -1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Manager::write_to_file (void)
+{
+ //
+ CORBA::String_var iorref =
+ this->orb_->object_to_string (this->merged_set_.in ());
+
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", iorref.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ return 0;
+}
+
+CORBA::ORB_ptr
+Manager::orb (void)
+{
+ return this->orb_.in ();
+}
+
+Client_i::Client_i (CORBA::ORB_ptr orb)
+ :orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+void
+run_test (Simple_Server_ptr server
+ ACE_ENV_ARG_DECL);
+
+void
+Client_i::init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Open the file for reading.
+ ACE_HANDLE f_handle = ACE_OS::open (ior_output_file,
+ 0);
+
+ if (f_handle == ACE_INVALID_HANDLE)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ ior_output_file));
+
+ ACE_Read_Buffer ior_buffer (f_handle);
+
+ char *data = ior_buffer.read ();
+
+ if (data == 0)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to read ior: %p\n"));
+
+
+ int argc = 0;
+ char **argv = 0;
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var object =
+ this->orb_->string_to_object (data
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Combined IOR stuff
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ data));
+ }
+
+ run_test (server.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ior_buffer.alloc ()->free (data);
+ ACE_OS::close (f_handle);
+}
+
+
+void run_test (Simple_Server_ptr server
+ ACE_ENV_ARG_DECL)
+{
+ // We do this twice as we know that there are only two servers.
+ for (CORBA::ULong i = 0;
+ i < 2;
+ i++)
+ {
+ ACE_TRY
+ {
+ for (CORBA::ULong j = 0;
+ j < 10;
+ j++)
+ {
+ // Make a remote call
+ server->remote_call (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("*********************************\n")));
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("I am going to shutdown the server\n")));
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_OS::sleep (2);
+ }
+ ACE_CATCH (CORBA::TRANSIENT, t)
+ {
+ if (t.completed () != CORBA::COMPLETED_NO)
+ {
+ ACE_PRINT_EXCEPTION (t, "Unexpected kind of TRANSIENT");
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("The completed status %d\n"), t.completed ()));
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Automagically re-issuing request on TRANSIENT\n")));
+ ACE_OS::sleep (1);
+ }
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, f)
+ {
+ ACE_PRINT_EXCEPTION (f, "A (sort of) expected COMM_FAILURE");
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Automagically re-issuing request on COMM_FAILURE\n")));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.h b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.h
new file mode 100644
index 00000000000..6bdc3e7cf1c
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/Manager.h
@@ -0,0 +1,66 @@
+//$Id$
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// test
+//
+// = FILENAME
+// Manager.h
+//
+// = DESCRIPTION
+// A manager class that merger IORS and designates primary
+//
+// = AUTHOR
+// Bala Natarajan <bala@cs.wustl.edu>
+//
+// ============================================================================
+#ifndef TEST_FT_IOGR_MANAGER_H
+#define TEST_FT_IOGR_MANAGER_H
+
+#include "tao/ORB.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Object.h"
+
+class Manager
+{
+public:
+
+ Manager (void);
+ // Ctor
+
+ void init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL);
+
+ // Initialize the ORB, POA etc.
+
+ int make_merged_iors (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Merges the different IORS
+
+ int set_properties (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Sets the properties for the profiles
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the ORB event loop..
+
+ int write_to_file (void);
+ // Write the merged IOR to a file
+
+ CORBA::ORB_ptr orb (void);
+ // Return the pointer to the copy of our ORB
+private:
+ CORBA::ORB_var orb_;
+ // Our ORB
+
+ CORBA::Object_var merged_set_;
+ // The merged IOR set
+};
+
+#endif /*TEST_FT_IOGR_MANAGER_H */
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/README b/TAO/orbsvcs/tests/FaultTolerance/IOGR/README
new file mode 100644
index 00000000000..5c209a35df4
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/README
@@ -0,0 +1,20 @@
+This program tests the basic FT IOGR implementation. The aim is to set
+a primary server and see whether the client gives preference to
+contact a primary for its first invocation. When the primary is killed
+it contacts the secondary for next invocation.
+
+Two copies of the server are started. A manager is then to merge these
+two iors and designate the second as primary. The merged IOR is then
+written to another file. This merged IOR is then used to make
+invocations on the server.
+
+
+Run the application as follows:
+
+$./server -o <file1.ior>
+$./server -o <file2.ior>
+$./Manager -a file://<file1.ior> -b file://<file2.ior> -c <output.ior>
+
+Due to teh transparent reinvocation functaionality for FT CORBA, the
+application would switch to the new profile without throwing an
+exception to the application. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/run_test.pl b/TAO/orbsvcs/tests/FaultTolerance/IOGR/run_test.pl
new file mode 100755
index 00000000000..c45335861ed
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$file1ior = PerlACE::LocalFile ("file1.ior");
+$file2ior = PerlACE::LocalFile ("file2.ior");
+$outputior = PerlACE::LocalFile ("output.ior");
+
+unlink $file1ior, $file2ior, $outputior;
+
+$SERV1 = new PerlACE::Process ("server", "-o $file1ior");
+$SERV2 = new PerlACE::Process ("server", "-o $file2ior");
+$MANAGER = new PerlACE::Process ("Manager", "-a file://$file1ior -b file://$file2ior -c $outputior");
+
+print STDERR "Starting Server\n";
+
+$SERV1->Spawn ();
+
+if (PerlACE::waitforfile_timed ($file1ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file1ior>\n";
+ $SERV1->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Server\n";
+
+$SERV2->Spawn ();
+
+if (PerlACE::waitforfile_timed ($file2ior, 20) == -1) {
+ print STDERR "ERROR: cannot find file <$file2ior>\n";
+ $SERV1->Kill ();
+ $SERV2->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Manager\n";
+
+$MANAGER->Spawn ();
+
+$manager = $MANAGER->WaitKill (30);
+
+$SERV1->WaitKill(5);
+
+$SERV2->WaitKill(5);
+
+if ($manager != 0) {
+ print STDERR "ERROR: Manager returned $manager\n";
+ $status = 1;
+}
+
+unlink $file1ior, $file2ior, $outputior;
+
+exit $status
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/server.cpp b/TAO/orbsvcs/tests/FaultTolerance/IOGR/server.cpp
new file mode 100644
index 00000000000..ade1a560f4d
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/server.cpp
@@ -0,0 +1,106 @@
+// $Id$
+
+#include "test_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+const char *ior_output_file = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We do the command line parsing first
+ if (parse_args (argc, argv) != 0)
+ return 1;
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Instantiate the LCD_Display implementation class
+ Simple_Server_i display_impl (orb.in ());
+
+ Simple_Server_var server =
+ display_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run ();
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/svc.conf.xml b/TAO/orbsvcs/tests/FaultTolerance/IOGR/svc.conf.xml
new file mode 100644
index 00000000000..b26c9398b5b
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/svc.conf.xml
@@ -0,0 +1,7 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/FaultTolerance/IOGR/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="FT_ClientService_Activate" type="Service_Object">
+ <initializer path="TAO_FT_ClientORB" init="_make_TAO_FT_ClientService_Activate"/>
+ </dynamic>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/test.idl b/TAO/orbsvcs/tests/FaultTolerance/IOGR/test.idl
new file mode 100644
index 00000000000..c3e5912526d
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/test.idl
@@ -0,0 +1,9 @@
+/*
+ * $Id$
+ */
+
+interface Simple_Server
+{
+ void remote_call ();
+ oneway void shutdown ();
+};
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.cpp b/TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.cpp
new file mode 100644
index 00000000000..9813825c275
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.cpp
@@ -0,0 +1,38 @@
+// $Id$
+
+#include "test_i.h"
+
+#if !defined(__ACE_INLINE__)
+//#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(MT_Client, test_i, "$Id$")
+
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+Simple_Server_i::Simple_Server_i (void)
+ : orb_ (0)
+{
+ // no-op
+}
+
+void
+Simple_Server_i::remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Print out from process id (%P) hosting the servant \n")));
+
+ return;
+}
+
+
+void
+Simple_Server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.h b/TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.h
new file mode 100644
index 00000000000..f7944307d55
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/test_i.h
@@ -0,0 +1,47 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/FaultTolerance/IOGR
+//
+// = FILENAME
+// test_i.h
+//
+// = AUTHOR
+// Bala Natarajan <bala@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_FT_IOGR_TEST_I_H
+#define TAO_FT_IOGR_TEST_I_H
+
+#include "testS.h"
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ Simple_Server_i (void);
+ // ctor
+
+ // = The Simple_Server methods.
+ void remote_call (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#endif /* TAO_FT_IOGR_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/FaultTolerance_IOGRManipulation.mpc b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/FaultTolerance_IOGRManipulation.mpc
new file mode 100644
index 00000000000..18cca059edc
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/FaultTolerance_IOGRManipulation.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(IOGRTest): taoserver, orbsvcsexe, iormanip, ftorb, messaging {
+ exename = IOGRTest
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp
new file mode 100644
index 00000000000..72014970c1d
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/IOGRTest.cpp
@@ -0,0 +1,229 @@
+// $Id$
+
+//========================================================================
+//
+// = LIBRARY
+// tests/FaultTolerance/IOGRManipulation
+//
+//
+// = FILENAME
+// IOGRTest.cpp
+//
+// = DESCRIPTION
+// This program tests the basic functionality FT IOGR implementation
+//
+// = AUTHOR
+// Bala Natarajan <bala@cs.wustl.edu>
+//
+//=========================================================================
+
+#include "tao/ORB.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+
+ACE_RCSID(IOGRManipluation,
+ IOGRTest,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+
+ ACE_DEBUG ((LM_DEBUG, "---------------------------------------------\n"));
+ ACE_DEBUG ((LM_DEBUG, "Running the IOGRManipulation Tests.\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Retrieve the ORB.
+ CORBA::ORB_var orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // **********************************************************************
+
+ // Get an object reference for the ORBs IORManipulation object!
+ CORBA::Object_var IORM =
+ orb_->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_IOP::TAO_IOR_Manipulation_var iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // **********************************************************************
+
+ // Create a few fictitious IORs
+ CORBA::Object_var name1 =
+ orb_->string_to_object ("iiop://acme.cs.wustl.edu:6060/xyz"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var name2 =
+ orb_->string_to_object ("iiop://tango.cs.wustl.edu:7070/xyz"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // **********************************************************************
+ // Create IOR list for use with merge_iors.
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (2);
+ iors.length (2);
+ iors [0] = name1;
+ iors [1] = name2;
+ // **********************************************************************
+
+ CORBA::Object_var merged =
+ iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check for set and get primaries
+ // Make a dummy property set
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+ TAO_FT_IOGR_Property prop (ft_tag_component);
+
+ CORBA::Boolean retval =
+ iorm->set_primary (&prop, name2.in (), merged.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval != 0)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tThe primary has been set\n")));
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tError in setting primary\n")));
+ return -1;
+ }
+
+ // Check whether a primary has been set
+ retval = iorm->is_primary_set (&prop,
+ merged.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tis_primary_set () returned true\n")));
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tis_primary_set () returned false\n")));
+
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tSo Exiting\n")));
+ return -1;
+ }
+
+ // Get the primary
+ CORBA::Object_var prim =
+ iorm->get_primary (&prop,
+ merged.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check whether we got back the right primary
+ if (prim->_is_equivalent (name2.in ()))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tWe got the right primary back\n")));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tWe have a problem in getting the right primary\n")));
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tSo exiting\n")));
+ return -1;
+ }
+ // **********************************************************************
+ // Set properties
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ const char *id = "iogr_regression";
+ ft_tag_component.group_domain_id = id;
+
+ // Object group id
+ ft_tag_component.object_group_id =
+ (CORBA::ULongLong) 10;
+
+ // Version
+ ft_tag_component.object_group_ref_version =
+ (CORBA::ULong) 5;
+
+ // Set the property
+ retval = iorm->set_property (&prop,
+ merged.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Extract the property
+ FT::TagFTGroupTaggedComponent ftc;
+ TAO_FT_IOGR_Property tmp_prop;
+
+ retval =
+ tmp_prop.get_tagged_component (merged.in (),
+ ftc
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Testing for tagged component \n"));
+
+
+ if ((ftc.object_group_ref_version != 5) &&
+ (ftc.object_group_id != 10))
+ ACE_ERROR ((LM_ERROR,
+ "%P|%t) Not working right \n"));
+
+
+
+
+ if (retval)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\tWe have set the property\n")));
+ }
+ ACE_CATCH (TAO_IOP::NotFound, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex,
+ ACE_TEXT ("Unexpected NotFound Exception!\n"));
+ return -1;
+ }
+ ACE_CATCH (TAO_IOP::Duplicate, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex,
+ "Unexpected Duplicate Exception!\n");
+ return -1;
+ }
+ ACE_CATCH (TAO_IOP::Invalid_IOR, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex,
+ "Unexpected Invalid_IOR Exception!\n");
+ return -1;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex,
+ "Unexpected system Exception!!\n");
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected ACE_CATCHANY Exception!\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG, "IORManipulation Tests Successfully Completed!\n"));
+ ACE_DEBUG ((LM_DEBUG, "---------------------------------------------\n"));
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/Makefile.am b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/Makefile.am
new file mode 100644
index 00000000000..ffcaf97f714
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/Makefile.am
@@ -0,0 +1,67 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.IOGRTest.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = IOGRTest
+
+IOGRTest_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+IOGRTest_SOURCES = \
+ IOGRTest.cpp
+
+IOGRTest_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/run_test.pl b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/run_test.pl
new file mode 100755
index 00000000000..d91ca3ec08f
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/run_test.pl
@@ -0,0 +1,21 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$T = new PerlACE::Process ("IOGRTest");
+
+$test = $T->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ exit 1;
+}
+
+exit 0;
+
diff --git a/TAO/orbsvcs/tests/FaultTolerance/Makefile.am b/TAO/orbsvcs/tests/FaultTolerance/Makefile.am
new file mode 100644
index 00000000000..fdc9d775202
--- /dev/null
+++ b/TAO/orbsvcs/tests/FaultTolerance/Makefile.am
@@ -0,0 +1,15 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ GroupRef_Manipulation \
+ IOGR \
+ IOGRManipulation
+
diff --git a/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent.mpc b/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent.mpc
new file mode 100644
index 00000000000..774382d8d09
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/FtRtEvent.mpc
@@ -0,0 +1,28 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Consumer): orbsvcsexe, ftrteventclient, strategies {
+ exename = consumer
+
+ Source_Files {
+ consumer.cpp
+ PushConsumer.cpp
+ }
+
+ Header_Files {
+ PushConsumer.h
+ }
+}
+
+project(*Supplier): orbsvcsexe, ftrteventclient, strategies {
+ exename = supplier
+
+ Source_Files {
+ supplier.cpp
+ PushSupplier.cpp
+ }
+
+ Header_Files {
+ PushSupplier.h
+ }
+}
diff --git a/TAO/orbsvcs/tests/FtRtEvent/Makefile.am b/TAO/orbsvcs/tests/FtRtEvent/Makefile.am
new file mode 100644
index 00000000000..2e3981fe200
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/Makefile.am
@@ -0,0 +1,128 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.FtRtEvent_Consumer.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += consumer
+
+consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+consumer_SOURCES = \
+ PushConsumer.cpp \
+ consumer.cpp \
+ PushConsumer.h
+
+consumer_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTRT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FtRtEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Makefile.FtRtEvent_Supplier.am
+
+if BUILD_ACE_UUID
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += supplier
+
+supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+supplier_SOURCES = \
+ PushSupplier.cpp \
+ supplier.cpp \
+ PushSupplier.h
+
+supplier_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTRT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FtRtEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTEvent.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+endif BUILD_ACE_UUID
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp
new file mode 100644
index 00000000000..12e291c0f78
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "ace/OS_NS_sys_time.h"
+#include "PushConsumer.h"
+#include "orbsvcs/FtRtEvent/Utils/resolve_init.h"
+#include <stdio.h>
+
+ACE_RCSID (FtRtEvent,
+ PushConsumer,
+ "$Id$")
+
+PushConsumer_impl::PushConsumer_impl(CORBA::ORB_ptr orb)
+: orb_(CORBA::ORB::_duplicate(orb))
+{
+}
+
+
+void
+PushConsumer_impl::push (const RtecEventComm::EventSet & event
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ CORBA::ULong x;
+ ACE_Time_Value time_val = ACE_OS::gettimeofday ();
+
+ if (event.length() >0) {
+ TimeBase::TimeT elaps =
+ time_val.sec () * 10000000 + time_val.usec ()* 10 - event[0].header.ec_send_time;
+ event[0].data.any_value >>= x;
+ printf("Received data : %d, single trip time = %d usec\n", x, static_cast<int> (elaps/10));
+ }
+}
+
+
+void
+PushConsumer_impl::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ PortableServer::Current_var current =
+ resolve_init<PortableServer::Current>(orb_.in(), "POACurrent" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POA_var poa = current->get_POA(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var oid = current->get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa->deactivate_object(oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h
new file mode 100644
index 00000000000..11c5601a36e
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/PushConsumer.h
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file PushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef PUSHCONSUMERIMPL_H
+#define PUSHCONSUMERIMPL_H
+
+#include "orbsvcs/RtecEventCommS.h"
+
+class PushConsumer_impl :
+public virtual POA_RtecEventComm::PushConsumer
+{
+public:
+ PushConsumer_impl(CORBA::ORB_ptr orb);
+
+ virtual void push (
+ const RtecEventComm::EventSet & data
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+private:
+ CORBA::ORB_var orb_;
+ PushConsumer_impl(const PushConsumer_impl&);
+ bool operator==(const PushConsumer_impl&);
+};
+#endif
diff --git a/TAO/orbsvcs/tests/FtRtEvent/PushSupplier.cpp b/TAO/orbsvcs/tests/FtRtEvent/PushSupplier.cpp
new file mode 100644
index 00000000000..8c1b1757ecf
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/PushSupplier.cpp
@@ -0,0 +1,146 @@
+// $Id$
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "PushSupplier.h"
+#include "ace/Reactor.h"
+#include "ace/Select_Reactor.h"
+#include "tao/MProfile.h"
+#include "tao/Stub.h"
+#include "orbsvcs/FtRtEvent/Utils/resolve_init.h"
+
+ACE_RCSID (FtRtEvent,
+ PushSupplier,
+ "$Id$")
+
+int
+PushSupplier_impl::ReactorTask::svc (void)
+{
+ ACE_DEBUG((LM_DEBUG, "Reactor Thread started\n"));
+ ACE_Reactor reactor (new ACE_Select_Reactor) ;
+ reactor_ = &reactor;
+
+ extern ACE_Time_Value timer_interval;
+
+ if (reactor_->schedule_timer(handler_, 0, ACE_Time_Value::zero, timer_interval)== -1)
+ ACE_ERROR_RETURN((LM_ERROR,"Cannot schedule timer\n"),-1);
+
+ reactor_->run_reactor_event_loop();
+ ACE_DEBUG((LM_DEBUG, "Reactor Thread ended\n"));
+
+ return 0;
+}
+
+
+
+PushSupplier_impl::PushSupplier_impl(CORBA::ORB_ptr orb)
+: orb_(orb), seq_no_(0), reactor_task_(this)
+{
+}
+
+PushSupplier_impl::~PushSupplier_impl()
+{
+ reactor_task_.wait();
+}
+
+int PushSupplier_impl::init(RtecEventChannelAdmin::EventChannel_ptr channel ACE_ENV_ARG_DECL)
+{
+
+ ACE_DEBUG((LM_DEBUG, "for_suppliers\n"));
+ RtecEventChannelAdmin::SupplierAdmin_var supplier_admin =
+ channel->for_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ ACE_DEBUG((LM_DEBUG, "obtain_push_consumer\n"));
+ consumer_ =
+ supplier_admin->obtain_push_consumer(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+
+
+ ACE_DEBUG((LM_DEBUG, "got push_consumer with %d profiles\n",
+ consumer_->_stubobj ()->base_profiles ().profile_count ()));
+
+ RtecEventChannelAdmin::SupplierQOS qos;
+ qos.publications.length (1);
+ RtecEventComm::EventHeader& h0 =
+ qos.publications[0].event.header;
+ h0.type = ACE_ES_EVENT_UNDEFINED; // first free event type
+ h0.source = 1; // first free event source
+
+ RtecEventComm::PushSupplier_var supplier = _this();
+
+ ACE_DEBUG((LM_DEBUG, "connect_push_supplier\n"));
+ consumer_->connect_push_supplier(supplier.in(),
+ qos ACE_ENV_ARG_PARAMETER);
+
+ ACE_DEBUG((LM_DEBUG, "push_consumer connected\n"));
+
+
+ if (!reactor_task_.thr_count() &&
+ reactor_task_.activate (THR_NEW_LWP | THR_JOINABLE, 1) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot activate reactor thread\n"),
+ -1);
+
+ return 0;
+
+}
+
+
+
+void PushSupplier_impl::disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+
+ reactor_task_.reactor_->end_reactor_event_loop();
+
+ PortableServer::Current_var current =
+ resolve_init<PortableServer::Current>(orb_.in(), "POACurrent" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POA_var poa = current->get_POA(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::ObjectId_var oid = current->get_object_id(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa->deactivate_object (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+int PushSupplier_impl::handle_timeout (const ACE_Time_Value &current_time,
+ const void *act)
+{
+ ACE_UNUSED_ARG(act);
+ ACE_UNUSED_ARG(current_time);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY {
+ RtecEventComm::EventSet event (1);
+ event.length (1);
+ event[0].header.type = ACE_ES_EVENT_UNDEFINED;
+ event[0].header.source = 1;
+ event[0].header.ttl = 1;
+
+ ACE_Time_Value time_val = ACE_OS::gettimeofday ();
+
+ event[0].header.ec_send_time = time_val.sec () * 10000000 + time_val.usec ()* 10;
+ event[0].data.any_value <<= seq_no_;
+
+ consumer_->push(event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG((LM_DEBUG, "sending data %d\n", seq_no_));
+ ++seq_no_;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "A CORBA Exception occurred.");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/FtRtEvent/PushSupplier.h b/TAO/orbsvcs/tests/FtRtEvent/PushSupplier.h
new file mode 100644
index 00000000000..dd9897ca66c
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/PushSupplier.h
@@ -0,0 +1,61 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file PushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Huang-Ming Huang <hh1@cse.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef PUSHSUPPLIER_H
+#define PUSHSUPPLIER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Event_Handler.h"
+#include "ace/Task.h"
+#include "ace/Reactor.h"
+#include "ace/Time_Value.h"
+
+class PushSupplier_impl :
+ public virtual ACE_Event_Handler
+ , public virtual POA_RtecEventComm::PushSupplier
+{
+public:
+ PushSupplier_impl(CORBA::ORB_ptr orb);
+ ~PushSupplier_impl();
+
+ int init(RtecEventChannelAdmin::EventChannel_ptr ACE_ENV_ARG_DECL);
+
+ virtual void disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+private:
+
+ class ReactorTask : public ACE_Task_Base
+ {
+ public:
+ // ctor
+ ReactorTask(ACE_Event_Handler* handler) : handler_(handler){}
+ virtual int svc (void);
+ // The thread entry point.
+
+ ACE_Reactor* reactor_;
+ ACE_Event_Handler* handler_;
+ };
+
+ virtual int handle_timeout (const ACE_Time_Value &current_time,
+ const void *act = 0);
+ CORBA::ORB_var orb_;
+ CORBA::ULong seq_no_;
+ ReactorTask reactor_task_;
+ RtecEventChannelAdmin::ProxyPushConsumer_var consumer_;
+ PushSupplier_impl(const PushSupplier_impl&);
+ bool operator==(const PushSupplier_impl&);
+};
+#endif
diff --git a/TAO/orbsvcs/tests/FtRtEvent/consumer.cpp b/TAO/orbsvcs/tests/FtRtEvent/consumer.cpp
new file mode 100644
index 00000000000..45874808c2f
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/consumer.cpp
@@ -0,0 +1,150 @@
+// $Id$
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "orbsvcs/Event_Utilities.h"
+#include "PushConsumer.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "orbsvcs/FtRtEvent/Utils/resolve_init.h"
+#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h"
+
+/// include this file to statically linked with FT ORB
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+
+/// include this file to statically linked with Transaction Depth
+#include "orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h"
+
+ACE_RCSID (FtRtEvent,
+ consumer,
+ "$Id$")
+
+CORBA::ORB_var orb;
+auto_ptr<TAO_FTRTEC::FTEC_Gateway> gateway;
+
+RtecEventChannelAdmin::EventChannel_ptr
+get_event_channel(int argc, ACE_TCHAR** argv ACE_ENV_ARG_DECL)
+{
+ FtRtecEventChannelAdmin::EventChannel_var channel;
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("hi:n"));
+ int opt;
+ int use_gateway = 1;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'i':
+ {
+ CORBA::Object_var obj = orb->string_to_object(get_opt.opt_arg ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ channel = FtRtecEventChannelAdmin::EventChannel::_narrow(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ break;
+ case 'n':
+ use_gateway = 0;
+ break;
+ case 'h':
+ case '?':
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT("Usage: %s ")
+ ACE_TEXT("-i ftrt_eventchannel_ior\n")
+ ACE_TEXT("-n do not use gateway\n")
+ ACE_TEXT("\n"),
+ argv[0]));
+ return 0;
+ }
+ }
+
+
+ if (CORBA::is_nil(channel.in()))
+ {
+ CosNaming::Name name(1);
+ name.length(1);
+ name[0].id = CORBA::string_dup("FT_EventService");
+
+ CosNaming::NamingContext_var naming_context =
+ resolve_init<CosNaming::NamingContext>(orb.in(), "NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ channel = resolve<FtRtecEventChannelAdmin::EventChannel>(naming_context.in(),
+ name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+
+ if (use_gateway)
+ {
+ ACE_AUTO_PTR_RESET (gateway, new TAO_FTRTEC::FTEC_Gateway(orb.in(), channel.in()), TAO_FTRTEC::FTEC_Gateway);
+ return gateway->_this(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ else
+ return channel._retn();
+}
+
+int main(int argc, ACE_TCHAR** argv)
+{
+ ACE_TRY_NEW_ENV {
+ orb = CORBA::ORB_init(argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::EventChannel_var channel
+ = get_event_channel(argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ if (CORBA::is_nil(channel.in()))
+ ACE_ERROR_RETURN((LM_ERROR, "Cannot Find FT_EventService\n"), -1);
+
+ PortableServer::POA_var poa =
+ resolve_init<PortableServer::POA>(orb.in(), "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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;
+
+ PushConsumer_impl push_consumer_impl(orb.in());
+ RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
+ channel->for_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ProxyPushSupplier_var supplier =
+ consumer_admin->obtain_push_supplier(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecEventChannelAdmin::ConsumerQOS qos;
+ qos.is_gateway = 1;
+ qos.dependencies.length(1);
+
+ RtecEventComm::EventHeader& h0 =
+ qos.dependencies[0].event.header;
+ h0.type = ACE_ES_EVENT_UNDEFINED; // first free event type
+ h0.source = ACE_ES_EVENT_SOURCE_ANY;
+
+ RtecEventComm::PushConsumer_var push_consumer =
+ push_consumer_impl._this();
+
+ supplier->connect_push_consumer(push_consumer.in(),
+ qos ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ }
+ ACE_CATCHANY {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "A CORBA Exception occurred.");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/FtRtEvent/supplier.cpp b/TAO/orbsvcs/tests/FtRtEvent/supplier.cpp
new file mode 100644
index 00000000000..9033f5b02c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/supplier.cpp
@@ -0,0 +1,142 @@
+// $Id$
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/FtRtecEventChannelAdminC.h"
+#include "PushSupplier.h"
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+#include "orbsvcs/FtRtEvent/Utils/resolve_init.h"
+#include "orbsvcs/FtRtEvent/Utils/FTEC_Gateway.h"
+
+/// include this file to statically linked with FT ORB
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+
+/// include this file to statically linked with Transaction Depth
+#include "orbsvcs/FtRtEvent/ClientORB/FTRT_ClientORB_Loader.h"
+
+ACE_RCSID (FtRtEvent,
+ supplier,
+ "$Id$")
+
+ACE_Time_Value timer_interval(1,0);
+CORBA::ORB_var orb;
+auto_ptr<TAO_FTRTEC::FTEC_Gateway> gateway;
+
+RtecEventChannelAdmin::EventChannel_ptr
+get_event_channel(int argc, ACE_TCHAR** argv ACE_ENV_ARG_DECL)
+{
+ FtRtecEventChannelAdmin::EventChannel_var channel;
+ ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("hi:nt:?"));
+ int opt;
+ int use_gateway = 1;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'i':
+ {
+ CORBA::Object_var obj = orb->string_to_object(get_opt.opt_arg ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ channel = FtRtecEventChannelAdmin::EventChannel::_narrow(obj.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+ break;
+ case 'n':
+ use_gateway = 0;
+ break;
+ case 't':
+ timer_interval.set(atof(get_opt.opt_arg ()));
+ case 'h':
+ case '?':
+ ACE_DEBUG((LM_DEBUG,
+ ACE_TEXT("Usage: %s ")
+ ACE_TEXT("-i ftrt_eventchannel_ior\n")
+ ACE_TEXT("-n do not use gateway\n")
+ ACE_TEXT("-t time Time interval in seconds between events (default 1.0)\n")
+ ACE_TEXT("\n"),
+ argv[0]));
+ return 0;
+
+ }
+ }
+
+
+ if (CORBA::is_nil(channel.in()))
+ {
+ /// Find the FTRTEC from the Naming Service
+ CosNaming::Name name(1);
+ name.length(1);
+ name[0].id = CORBA::string_dup("FT_EventService");
+
+ CosNaming::NamingContext_var naming_context =
+ resolve_init<CosNaming::NamingContext>(orb.in(), "NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ channel = resolve<FtRtecEventChannelAdmin::EventChannel>(naming_context.in(),
+ name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+
+ if (use_gateway)
+ {
+ // use local gateway to communicate with FTRTEC
+ ACE_AUTO_PTR_RESET (gateway, new TAO_FTRTEC::FTEC_Gateway(orb.in(), channel.in()), TAO_FTRTEC::FTEC_Gateway);
+ return gateway->_this(ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ else
+ return channel._retn();
+}
+
+
+int main(int argc, ACE_TCHAR** argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY {
+ orb = CORBA::ORB_init(argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ RtecEventChannelAdmin::EventChannel_var channel
+ = get_event_channel(argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ if (CORBA::is_nil(channel.in()))
+ return -1;
+
+ PortableServer::POA_var poa =
+ resolve_init<PortableServer::POA>(orb.in(), "RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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;
+
+ PushSupplier_impl push_supplier(orb.in());
+ if (push_supplier.init(channel.in() ACE_ENV_ARG_PARAMETER) == -1)
+ return -1;
+
+ RtecEventComm::PushSupplier_var
+ supplier = push_supplier._this();
+
+
+ orb->run(ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ }
+ ACE_CATCHANY {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "A CORBA Exception occurred.");
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN(-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/FtRtEvent/svc.conf b/TAO/orbsvcs/tests/FtRtEvent/svc.conf
new file mode 100644
index 00000000000..539a8fe48c6
--- /dev/null
+++ b/TAO/orbsvcs/tests/FtRtEvent/svc.conf
@@ -0,0 +1,5 @@
+## $Id$
+
+static Client_Strategy_Factory "-ORBClientConnectionHandler RW"
+static FT_ClientService_Activate
+static FTRT_ClientORB_Service "-ORBTransactionDepth $FTEC_TransactionDepth"
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/HTIOP_AMI.mpc b/TAO/orbsvcs/tests/HTIOP/AMI/HTIOP_AMI.mpc
new file mode 100644
index 00000000000..4dde0b749eb
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/HTIOP_AMI.mpc
@@ -0,0 +1,50 @@
+// -*- MPC -*-
+//
+// $Id$
+
+project(*idl): taoidldefaults, ami {
+ IDL_Files {
+ ami_test.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): messaging, taoexe, portableserver, ami {
+ after += *idl
+ macros += TEST_OUTPUT_HAS_DLL=0
+ Source_Files {
+ Test_Output.cpp
+ ami_test_i.cpp
+ ami_testS.cpp
+ ami_testC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): messaging, taoexe, portableserver, ami {
+ after += *idl
+ macros += TEST_OUTPUT_HAS_DLL=0
+ Source_Files {
+ Test_Output.cpp
+ client.cpp
+ ami_testS.cpp
+ ami_testC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Simple Client): messaging, taoexe, portableserver, ami {
+ after += *idl
+ macros += TEST_OUTPUT_HAS_DLL=0
+ Source_Files {
+ Test_Output.cpp
+ simple_client.cpp
+ ami_testS.cpp
+ ami_testC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/Makefile.am b/TAO/orbsvcs/tests/HTIOP/AMI/Makefile.am
new file mode 100644
index 00000000000..8e47b662087
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/Makefile.am
@@ -0,0 +1,165 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.HTIOP_AMI_Idl.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+
+BUILT_SOURCES = \
+ ami_testC.cpp \
+ ami_testC.h \
+ ami_testC.inl \
+ ami_testS.cpp \
+ ami_testS.h \
+ ami_testS.inl
+
+CLEANFILES = \
+ ami_test-stamp \
+ ami_testC.cpp \
+ ami_testC.h \
+ ami_testC.inl \
+ ami_testS.cpp \
+ ami_testS.h \
+ ami_testS.inl
+
+ami_testC.cpp ami_testC.h ami_testC.inl ami_testS.cpp ami_testS.h ami_testS.inl: ami_test-stamp
+
+ami_test-stamp: $(srcdir)/ami_test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -GC $(srcdir)/ami_test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ ami_test.idl
+
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.HTIOP_AMI_Client.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DTEST_OUTPUT_HAS_DLL=0
+
+client_SOURCES = \
+ Test_Output.cpp \
+ ami_testC.cpp \
+ ami_testS.cpp \
+ client.cpp \
+ ami_test_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.HTIOP_AMI_Server.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DTEST_OUTPUT_HAS_DLL=0
+
+server_SOURCES = \
+ Test_Output.cpp \
+ ami_testC.cpp \
+ ami_testS.cpp \
+ ami_test_i.cpp \
+ server.cpp \
+ ami_test_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.HTIOP_AMI_Simple_Client.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+
+noinst_PROGRAMS += simple_client
+
+simple_client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DTEST_OUTPUT_HAS_DLL=0
+
+simple_client_SOURCES = \
+ Test_Output.cpp \
+ ami_testC.cpp \
+ ami_testS.cpp \
+ simple_client.cpp \
+ ami_test_i.h
+
+simple_client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/README b/TAO/orbsvcs/tests/HTIOP/AMI/README
new file mode 100644
index 00000000000..04117a71d7d
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/README
@@ -0,0 +1,39 @@
+# $Id$
+
+Description:
+This is a simple test for AMI callback model.
+
+Note:
+Use TAO_HAS_CORBA_MESSAGING
+and TAO_HAS_AMI_CALLBACK
+to compile TAO. This enables the AMI code in it.
+
+Use -GC on the TAO IDL compiler to generate code for AMI callbacks.
+
+Usage:
+=====
+$ server -o ior
+$ simple_client -ORBSvcConf muxed.conf -k file://ior -i 10
+
+simple-client:
+=============
+
+$ simple_client -k file://test_ior [-i <niterations] [-x] [-d] \
+ -ORBSvcConf {muxed.conf,
+ exclusive.conf}
+
+-d Enable debug messages.
+-i Number of iterations.
+-k IOR.
+-x Call shutdown method.
+
+Issues <i> number of asynchronous requests. Then it issues a
+synchronous request, which collects the replies.
+
+If you choose Muxed Transport configuration, then the synchronous
+request will collect all the asynchronous replies also, since the
+replies will arrive in order. In the Exclusive Transport, however,
+the synchronous request might not collect all the AMI replies.
+Instead, it might return as soon as its reply arrives.
+
+
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/Test_Output.cpp b/TAO/orbsvcs/tests/HTIOP/AMI/Test_Output.cpp
new file mode 100644
index 00000000000..8ab1d029463
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/Test_Output.cpp
@@ -0,0 +1,230 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file Test_Output.cpp
+ *
+ * $Id$
+ *
+ * This file factors out common macros and other utilities used by the
+ * ACE automated regression tests.
+ *
+ * @author Prashant Jain <pjain@cs.wustl.edu>
+ * @author Tim Harrison <harrison@cs.wustl.edu>
+ * @author David Levine <levine@cs.wustl.edu>
+ * @author Don Hinton <dhinton@dresystems.com>
+ */
+// ============================================================================
+
+#include "tests/test_config.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_sys_stat.h"
+#include "ace/Guard_T.h"
+#include "ace/Object_Manager.h"
+
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+
+#include "ace/Framework_Component.h"
+#include "ace/Log_Msg.h"
+#include "ace/ACE.h"
+
+#if defined (VXWORKS)
+# include "ace/OS_NS_unistd.h"
+# include "ace/OS_NS_fcntl.h"
+#endif /* VXWORKS */
+
+ACE_Test_Output *ACE_Test_Output::instance_ = 0;
+
+ACE_Test_Output::ACE_Test_Output (void)
+ : output_file_ (0)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_ = new OFSTREAM;
+#endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+ACE_Test_Output::~ACE_Test_Output (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_PSOS)
+ ACE_LOG_MSG->msg_ostream (&cerr);
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY && ! ACE_PSOS */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::OSTREAM);
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR);
+
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_HAS_PHARLAP)
+ delete this->output_file_;
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+OFSTREAM *
+ACE_Test_Output::output_file (void)
+{
+ return this->output_file_;
+}
+
+int
+ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
+{
+#if defined (ACE_HAS_PHARLAP)
+ // For PharLap, just send it all to the host console for now - redirect
+ // to a file there for saving/analysis.
+ EtsSelectConsole(ETS_CO_HOST);
+ ACE_LOG_MSG->msg_ostream (&cout);
+
+#else
+ ACE_TCHAR temp[MAXPATHLEN];
+ // Ignore the error value since the directory may already exist.
+ const ACE_TCHAR *test_dir;
+
+#if !defined (ACE_HAS_WINCE)
+# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
+ test_dir = ACE_OS::getenv (ACE_TEXT ("ACE_TEST_DIR"));
+# else
+ ACE_TCHAR tempenv[MAXPATHLEN];
+ char *test_dir_n = ACE_OS::getenv ("ACE_TEST_DIR");
+ if (test_dir_n == 0)
+ test_dir = 0;
+ else
+ {
+ ACE_OS::strcpy (tempenv, ACE_TEXT_CHAR_TO_TCHAR (test_dir_n));
+ test_dir = tempenv;
+ }
+# endif /* ACE_WIN32 || !ACE_USES_WCHAR */
+
+ if (test_dir == 0)
+#endif /* ACE_HAS_WINCE */
+ test_dir = ACE_TEXT ("");
+
+ // This could be done with ACE_OS::sprintf() but it requires different
+ // format strings for wide-char POSIX vs. narrow-char POSIX and Windows.
+ // Easier to keep straight like this.
+ ACE_OS_String::strcpy (temp, test_dir);
+ ACE_OS_String::strcat (temp, ACE_LOG_DIRECTORY);
+ ACE_OS_String::strcat
+ (temp, ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR));
+ ACE_OS_String::strcat (temp, ACE_LOG_FILE_EXT_NAME);
+
+#if defined (VXWORKS)
+ // This is the only way I could figure out to avoid a console
+ // warning about opening an existing file (w/o O_CREAT), or
+ // attempting to unlink a non-existant one.
+ ACE_HANDLE fd = ACE_OS::open (temp,
+ O_WRONLY|O_CREAT,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if (fd != ERROR)
+ {
+ ACE_OS::close (fd);
+ ACE_OS::unlink (temp);
+ }
+# else /* ! VXWORKS */
+ // This doesn't seem to work on VxWorks if the directory doesn't
+ // exist: it creates a plain file instead of a directory. If the
+ // directory does exist, it causes a wierd console error message
+ // about "cat: input error on standard input: Is a directory". So,
+ // VxWorks users must create the directory manually.
+# if defined (ACE_HAS_WINCE)
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY_FOR_MKDIR);
+# else
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY);
+# endif // ACE_HAS_WINCE
+# endif /* ! VXWORKS */
+
+# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->open (ACE_TEXT_ALWAYS_CHAR (temp),
+ ios::out | (append ? ios::app : ios::trunc));
+ if (this->output_file_->bad ())
+ return -1;
+#else /* when ACE_LACKS_IOSTREAM_TOTALLY */
+ ACE_TCHAR *fmode = 0;
+ if (append)
+ fmode = ACE_TEXT ("a");
+ else
+ fmode = ACE_TEXT ("w");
+ this->output_file_ = ACE_OS::fopen (temp, fmode);
+# endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+
+ ACE_LOG_MSG->msg_ostream (this->output_file ());
+#endif /* ACE_HAS_PHARLAP */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER );
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
+
+ return 0;
+}
+
+void
+ACE_Test_Output::close (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->flush ();
+ this->output_file_->close ();
+#else
+ ACE_OS::fflush (this->output_file_);
+ ACE_OS::fclose (this->output_file_);
+#endif /* !ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+ACE_Test_Output*
+ACE_Test_Output::instance ()
+{
+ if (ACE_Test_Output::instance_ == 0)
+ {
+ // Perform Double-Checked Locking Optimization.
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
+ *ACE_Static_Object_Lock::instance (), 0));
+
+ if (ACE_Test_Output::instance_ == 0)
+ {
+ ACE_NEW_RETURN (ACE_Test_Output::instance_,
+ ACE_Test_Output,
+ 0);
+ ACE_REGISTER_FRAMEWORK_COMPONENT(ACE_Test_Output, ACE_Test_Output::instance_)
+ }
+ }
+ return ACE_Test_Output::instance_;
+}
+
+const ACE_TCHAR *
+ACE_Test_Output::dll_name (void)
+{
+ return ACE_TEXT ("Test_Output");
+}
+
+const ACE_TCHAR *
+ACE_Test_Output::name (void)
+{
+ return ACE_TEXT ("ACE_Test_Output");
+}
+
+void
+ACE_Test_Output::close_singleton (void)
+{
+ delete ACE_Test_Output::instance_;
+ ACE_Test_Output::instance_ = 0;
+}
+
+void
+randomize (int array[], size_t size)
+{
+ size_t i;
+
+ for (i = 0; i < size; i++)
+ array [i] = static_cast<int> (i);
+
+ // See with a fixed number so that we can produce "repeatable"
+ // random numbers.
+ ACE_OS::srand (0);
+
+ // Generate an array of random numbers from 0 .. size - 1.
+
+ for (i = 0; i < size; i++)
+ {
+ size_t index = ACE_OS::rand() % size--;
+ int temp = array [index];
+ array [index] = array [size];
+ array [size] = temp;
+ }
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/ami_test.idl b/TAO/orbsvcs/tests/HTIOP/AMI/ami_test.idl
new file mode 100644
index 00000000000..df28b53177a
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/ami_test.idl
@@ -0,0 +1,40 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/AMI
+//
+// = FILENAME
+// ami_test.idl
+//
+// = DESCRIPTION
+// IDL description of the AMI Test interface
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>,
+// Michael Kircher <Michael.Kircher@mchp.siemens.de>
+//
+// ============================================================================
+
+
+module A
+ {
+ exception DidTheRightThing {
+ long id;
+ string whatDidTheRightThing;
+ };
+
+ interface AMI_Test
+ {
+ long foo (out long out_l,
+ in long in_l,
+ in string in_str)
+ raises (DidTheRightThing);
+
+ attribute long yadda;
+
+ oneway void shutdown ();
+ };
+
+ };
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.cpp b/TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.cpp
new file mode 100644
index 00000000000..4586a4d67a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.cpp
@@ -0,0 +1,86 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/AMI
+//
+// = FILENAME
+// ami_test_i.cpp
+//
+// = DESCRIPTION
+// Implementation of the AMI Test interface.
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>,
+// Michael Kircher <Michael.Kircher@mchp.siemens.de>
+//
+// ============================================================================
+
+#include "ami_test_i.h"
+#include "tao/debug.h"
+
+ACE_RCSID(AMI, ami_test_i, "$Id$")
+
+AMI_Test_i::AMI_Test_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ number_ ((CORBA::Long) 931232),
+ yadda_ ((CORBA::Long) 140474)
+{
+}
+
+CORBA::Long
+AMI_Test_i::foo (CORBA::Long_out out_l,
+ CORBA::Long in_l,
+ const char* in_str
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ A::DidTheRightThing))
+{
+ out_l = 931233;
+
+ //if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "%N:%l:(%P:%t):AMI_Test_i::foo: %d %s\n",
+ in_l,
+ in_str));
+
+ if (in_l == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Throwing Exception: A::DidTheRightThing\n"));
+ ACE_THROW_RETURN (A::DidTheRightThing(), 0);
+ }
+
+ return 931234;
+}
+
+
+
+void
+AMI_Test_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0);
+}
+
+
+CORBA::Long
+AMI_Test_i::yadda (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "%N:%l:(%P:%t):AMI_Test_i::(get_)yadda\n"));
+ return yadda_;
+}
+
+
+void
+AMI_Test_i::yadda (CORBA::Long yadda
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "%N:%l:(%P:%t):AMI_Test_i::(set_)yadda\n"));
+ yadda_ = yadda;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.h b/TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.h
new file mode 100644
index 00000000000..161d329e7ff
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/ami_test_i.h
@@ -0,0 +1,60 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/AMI
+//
+// = FILENAME
+// ami_test_i.h
+//
+// = AUTHOR
+// Michael Kircher <Michael.Kircher@mchp.siemens.de>
+//
+// ============================================================================
+
+#ifndef TAO_AMI_TEST_I_H
+#define TAO_AMI_TEST_I_H
+
+#include "ami_testS.h"
+
+class AMI_Test_i : public POA_A::AMI_Test
+{
+ // = TITLE
+ // AMI Test implementation
+ //
+ // = DESCRIPTION
+ // Implements the AMI_Test interface in test.idl
+ //
+public:
+ AMI_Test_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ // The AMI_Test methods.
+ CORBA::Long foo (CORBA::Long_out out_l,
+ CORBA::Long in_l,
+ const char* in_str
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ A::DidTheRightThing));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ CORBA::Long yadda (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void yadda (CORBA::Long yadda
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+
+ CORBA::Long number_;
+
+ CORBA::Long yadda_;
+};
+
+
+#endif /* TAO_AMI_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/client.cpp b/TAO/orbsvcs/tests/HTIOP/AMI/client.cpp
new file mode 100644
index 00000000000..efc9e973701
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/client.cpp
@@ -0,0 +1,339 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/AMI
+//
+// = FILENAME
+// server.cpp
+//
+// = DESCRIPTION
+// A client which uses the AMI callback model.
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>,
+// Michael Kircher <Michael.Kircher@mchp.siemens.de>
+//
+// ============================================================================
+
+#include "tests/test_config.h"
+#include "ace/OS_NS_sys_socket.h"
+#include "ace/Get_Opt.h"
+#include "ace/Task.h"
+#include "ami_testC.h"
+#include "ami_testS.h"
+
+ACE_RCSID(AMI, client, "$Id$")
+
+const char *ior = "file://test.ior";
+int nthreads = 5;
+int niterations = 5;
+int debug = 0;
+int number_of_replies = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "dk:n:i:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ debug = 1;
+ break;
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ case 'n':
+ nthreads = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'i':
+ niterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-d "
+ "-k <ior> "
+ "-n <nthreads> "
+ "-i <niterations> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+class Client : public ACE_Task_Base
+{
+ // = TITLE
+ // Run the client thread
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class to run the client threads.
+ //
+public:
+ Client (A::AMI_Test_ptr server, int niterations);
+ // ctor
+
+ virtual int svc (void);
+ // The thread entry point.
+
+ // private:
+ A::AMI_Test_var ami_test_var_;
+ // Var for the AMI_Test object.
+
+ int niterations_;
+ // The number of iterations on each client thread.
+
+ A::AMI_AMI_TestHandler_var the_handler_var_;
+ // Var for AMI_AMI_Test_ReplyHandler object.
+};
+
+class Handler : public POA_A::AMI_AMI_TestHandler
+{
+public:
+ Handler (void) {};
+
+ void foo (CORBA::Long result,
+ CORBA::Long out_l
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P | %t) : Callback method called: result <%d>, out_arg <%d>\n",
+ result,
+ out_l));
+ }
+
+ number_of_replies--;
+ };
+
+ void foo_excep (::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <foo_excep> called: \n"));
+ ACE_TRY
+ {
+ excep_holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ };
+
+ void get_yadda (CORBA::Long result
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <get_yadda> called: result <%d>\n",
+ result));
+ };
+
+ void get_yadda_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <get_yadda_excep> called: \n"));
+ };
+
+ void set_yadda (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <set_yadda> called: \n"));
+ };
+
+ void set_yadda_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <set_yadda_excep> called: \n"));
+ };
+ ~Handler (void) {};
+};
+
+// ReplyHandler.
+Handler handler;
+
+int
+main (int argc, char *argv[])
+{
+ ACE_START_TEST (ACE_TEXT ("HTIOP_AMI_client"));
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ ACE_OS::socket_init ();
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ A::AMI_Test_var server =
+ A::AMI_Test::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ // Activate POA to handle the call back.
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Let the client perform the test in a separate thread
+
+ Client client (server.in (), niterations);
+ if (client.activate (THR_NEW_LWP | THR_JOINABLE,
+ nthreads) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot activate client threads\n"),
+ 1);
+
+ // Main thread collects replies. It needs to collect
+ // <nthreads*niterations> replies.
+ number_of_replies = nthreads * niterations;
+
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) : Entering perform_work loop to receive <%d> replies\n",
+ number_of_replies));
+ }
+
+ // ORB loop.
+
+ while (number_of_replies > 0)
+ {
+ CORBA::Boolean pending =
+ orb->work_pending(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (pending)
+ {
+ orb->perform_work(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) : Exited perform_work loop Received <%d> replies\n",
+ (nthreads*niterations) - number_of_replies));
+ }
+
+
+ client.thr_mgr ()->wait ();
+
+ ACE_DEBUG ((LM_DEBUG, "threads finished\n"));
+
+ //client.ami_test_var_->shutdown ();
+
+ root_poa->destroy (1, // ethernalize objects
+ 0 // wait for completion
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_END_TEST;
+ return 0;
+}
+
+// ****************************************************************
+
+Client::Client (A::AMI_Test_ptr server,
+ int niterations)
+ : ami_test_var_ (A::AMI_Test::_duplicate (server)),
+ niterations_ (niterations)
+{
+ the_handler_var_ = handler._this (/* ACE_ENV_SINGLE_ARG_PARAMETER */);
+}
+
+int
+Client::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::Long number = 931232;
+
+ for (int i = 0; i < this->niterations_; ++i)
+ {
+ ami_test_var_->sendc_foo (the_handler_var_.in (),
+ number,
+ "Let's talk AMI."
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P | %t):<%d> Asynchronous methods issued\n",
+ niterations));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "MT_Client: exception raised");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/exclusive.conf b/TAO/orbsvcs/tests/HTIOP/AMI/exclusive.conf
new file mode 100644
index 00000000000..37d1ecd17d9
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/exclusive.conf
@@ -0,0 +1,9 @@
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory ()
+ "-inside 1"
+
+static Client_Strategy_Factory
+ "-ORBTransportMuxStrategy EXCLUSIVE -ORBProfileLock null -ORBclientconnectionhandler ST"
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/muxed.conf b/TAO/orbsvcs/tests/HTIOP/AMI/muxed.conf
new file mode 100644
index 00000000000..99322cdc625
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/muxed.conf
@@ -0,0 +1,9 @@
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory ()
+ "-inside 1"
+
+static Client_Strategy_Factory
+ "-ORBTransportMuxStrategy MUXED -ORBProfileLock null -ORBClientConnectionHandler ST"
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/run_test.pl b/TAO/orbsvcs/tests/HTIOP/AMI/run_test.pl
new file mode 100755
index 00000000000..1eb776eba79
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+use Sys::Hostname;
+
+$client_conf = PerlACE::LocalFile ("muxed$PerlACE::svcconf_ext");
+
+$debug_level = '0';
+$iterations = '1';
+$host = hostname();
+
+foreach $i (@ARGV) {
+ if ($i eq '-mux') {
+ $client_conf = PerlACE::LocalFile ("muxed$PerlACE::svcconf_ext");
+ }
+ elsif ($i eq '-debug') {
+ $debug_level = '10';
+ }
+ elsif ($i eq '-exclusive') {
+ $client_conf = PerlACE::LocalFile ("exclusive$PerlACE::svcconf_ext");
+ }
+}
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server",
+ "-ORBEndpoint htiop://$host:8088 -ORBdebuglevel $debug_level -d -o $iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$CL = new PerlACE::Process ("simple_client",
+ "-ORBsvcconf $client_conf "
+ . "-ORBdebuglevel $debug_level"
+ . " -k file://$iorfile "
+ . " -i $iterations -x -d");
+
+$client = $CL->SpawnWaitKill (60);
+$server = $SV->WaitKill (5);
+
+unlink $iorfile;
+
+if ($server != 0 || $client != 0) {
+ exit 1;
+}
+
+exit 0;
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/server.conf b/TAO/orbsvcs/tests/HTIOP/AMI/server.conf
new file mode 100644
index 00000000000..dada9646a63
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/server.conf
@@ -0,0 +1,8 @@
+# $Id$
+#
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory () ""
+
+#static Server_Strategy_Factory "-ORBconcurrency thread-per-connection"
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/server.cpp b/TAO/orbsvcs/tests/HTIOP/AMI/server.cpp
new file mode 100644
index 00000000000..ee6a7282b5f
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/server.cpp
@@ -0,0 +1,144 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/AMI
+//
+// = FILENAME
+// server.cpp
+//
+// = DESCRIPTION
+// Implementation of the server.
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>,
+// Michael Kircher <Michael.Kircher@mchp.siemens.de>
+//
+// ============================================================================
+
+#include "ami_test_i.h"
+
+#include "tests/test_config.h"
+
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_sys_socket.h"
+
+ACE_RCSID(AMI, server, "$Id$")
+
+const char *ior_output_file = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:d");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'd':
+ TAO_debug_level++;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_START_TEST (ACE_TEXT ("HTIOP_AMI_server"));
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ ACE_OS::socket_init ();
+
+ AMI_Test_i ami_test_i (orb.in ());
+
+ A::AMI_Test_var ami_test_var =
+ ami_test_i._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (ami_test_var.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa->destroy (1, // ethernalize objects
+ 0 // wait for completion
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_END_TEST;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/simple_client.cpp b/TAO/orbsvcs/tests/HTIOP/AMI/simple_client.cpp
new file mode 100644
index 00000000000..442d7a9356f
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/simple_client.cpp
@@ -0,0 +1,320 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/AMI
+//
+// = FILENAME
+// simple_client.cpp
+//
+// = DESCRIPTION
+// A very simple client which uses the AMI callback model.
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>,
+// Michael Kircher <Michael.Kircher@mchp.siemens.de>
+//
+// ============================================================================
+
+#include "tests/test_config.h"
+
+#include "ace/OS_NS_sys_socket.h"
+#include "ace/Get_Opt.h"
+#include "ace/Task.h"
+
+#include "ami_testC.h"
+#include "ami_testS.h"
+
+ACE_RCSID(AMI, simple_client, "$Id$")
+
+const char *ior = "file://test.ior";
+int niterations = 5;
+int shutdown_flag = 0;
+int debug = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "dk:i:x");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ debug = 1;
+ break;
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ case 'i':
+ niterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'x':
+ shutdown_flag = 1;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-i <niterations> "
+ "-x "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+class Handler : public POA_A::AMI_AMI_TestHandler
+{
+public:
+ Handler (void) {};
+ // Constructor.
+
+ ~Handler (void) {};
+ // Destructor.
+
+ void foo (CORBA::Long ami_return_val,
+ CORBA::Long out_l
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <foo> called: result <%d>, out_arg <%d>\n",
+ ami_return_val,
+ out_l));
+ }
+ };
+
+ void foo_excep (::Messaging::ExceptionHolder * excep_holder
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <foo_excep> called: \n"
+ "Testing proper exception handling ...\n"));
+ ACE_TRY
+ {
+ excep_holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (A::DidTheRightThing, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "... exception received successfully\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "... caught the wrong exception -> ERROR\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ };
+
+
+ void get_yadda (CORBA::Long result
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <get_yadda> called: result <%d>\n",
+ result));
+ };
+
+ void get_yadda_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <get_yadda_excep> called: \n"));
+ };
+
+ void set_yadda (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <set_yadda> called: \n"));
+ };
+
+ void set_yadda_excep (::Messaging::ExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Callback method <set_yadda_excep> called: \n"));
+ };
+
+};
+
+int
+main (int argc, char *argv[])
+{
+ ACE_START_TEST (ACE_TEXT ("HTIOP_AMI_simple_client"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object_var =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var poa_var =
+ PortableServer::POA::_narrow (object_var.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager_var =
+ poa_var->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager_var->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // We reuse the object_var smart pointer!
+ object_var = orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ A::AMI_Test_var ami_test_var =
+ A::AMI_Test::_narrow (object_var.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (ami_test_var.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ ACE_OS::socket_init ();
+
+ // Instantiate the ReplyHandler and register that with the POA.
+ Handler handler;
+ A::AMI_AMI_TestHandler_var the_handler_var =
+ handler._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Try out sending asynchronous messages without a reply handler
+ // registered. Things fail if we get an exception.
+
+ ami_test_var->sendc_foo (A::AMI_AMI_TestHandler::_nil (),
+ 0,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // Trigger the DidTheRightThing exception on the server side
+ // by sending 0 to it.
+ ACE_DEBUG ((LM_DEBUG,
+ "Sending asynch message\n"));
+
+ ami_test_var->sendc_foo (the_handler_var.in (),
+ 0,
+ "Let's talk AMI."
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Long l = 931247;
+
+ for (ssize_t ni = 0; ni < niterations; ni++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Sending asynch message: %d\n",
+ ni));
+
+ ami_test_var->sendc_foo (the_handler_var.in (),
+ l,
+ "Let's talk AMI."
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Begin test of attributes
+ ami_test_var->sendc_get_yadda (the_handler_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ami_test_var->sendc_set_yadda (the_handler_var.in (),
+ 4711
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ami_test_var->sendc_get_yadda (the_handler_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // End test of attributes
+
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "<%d> Asynchronous methods issued\n",
+ niterations));
+ }
+
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Issuing a synchronous method to collect the AMI replies\n"));
+ }
+
+ //while (orb->work_pending())
+ // orb->perform_work ();
+
+
+ CORBA::Long number = ami_test_var->foo (l,
+ l,
+ "Let's talk SMI."
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Received the following number: %d\n",
+ number));
+ }
+
+ if (shutdown_flag)
+ {
+ ACE_DEBUG ((LM_DEBUG, "invoking shutdown\n"));
+ ami_test_var->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ poa_var->destroy (1, // ethernalize objects
+ 0 // wait for completion
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_END_TEST;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/AMI/svc.conf b/TAO/orbsvcs/tests/HTIOP/AMI/svc.conf
new file mode 100644
index 00000000000..9657f158c19
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/AMI/svc.conf
@@ -0,0 +1,6 @@
+# $Id$
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory () ""
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/HTIOP_BiDirectional.mpc b/TAO/orbsvcs/tests/HTIOP/BiDirectional/HTIOP_BiDirectional.mpc
new file mode 100644
index 00000000000..981b180e88a
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/HTIOP_BiDirectional.mpc
@@ -0,0 +1,35 @@
+// -*- MPC -*-
+//
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*Server): taoexe, portableserver, bidir_giop {
+ after += *idl
+ Source_Files {
+ testC.cpp
+ testS.cpp
+ test_i.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoexe, portableserver, minimum_corba, bidir_giop {
+ after += *idl
+ Source_Files {
+ testC.cpp
+ testS.cpp
+ test_i.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/Makefile.am b/TAO/orbsvcs/tests/HTIOP/BiDirectional/Makefile.am
new file mode 100644
index 00000000000..825e33eaade
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/Makefile.am
@@ -0,0 +1,114 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.HTIOP_BiDirectional_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.HTIOP_BiDirectional_Client.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ client.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ test_i.h \
+ test_i.i
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_BiDirGIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.HTIOP_BiDirectional_Server.am
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+server_SOURCES = \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ test_i.h \
+ test_i.i
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_BiDirGIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/Test_Output.cpp b/TAO/orbsvcs/tests/HTIOP/BiDirectional/Test_Output.cpp
new file mode 100644
index 00000000000..8ab1d029463
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/Test_Output.cpp
@@ -0,0 +1,230 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file Test_Output.cpp
+ *
+ * $Id$
+ *
+ * This file factors out common macros and other utilities used by the
+ * ACE automated regression tests.
+ *
+ * @author Prashant Jain <pjain@cs.wustl.edu>
+ * @author Tim Harrison <harrison@cs.wustl.edu>
+ * @author David Levine <levine@cs.wustl.edu>
+ * @author Don Hinton <dhinton@dresystems.com>
+ */
+// ============================================================================
+
+#include "tests/test_config.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_sys_stat.h"
+#include "ace/Guard_T.h"
+#include "ace/Object_Manager.h"
+
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+
+#include "ace/Framework_Component.h"
+#include "ace/Log_Msg.h"
+#include "ace/ACE.h"
+
+#if defined (VXWORKS)
+# include "ace/OS_NS_unistd.h"
+# include "ace/OS_NS_fcntl.h"
+#endif /* VXWORKS */
+
+ACE_Test_Output *ACE_Test_Output::instance_ = 0;
+
+ACE_Test_Output::ACE_Test_Output (void)
+ : output_file_ (0)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_ = new OFSTREAM;
+#endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+ACE_Test_Output::~ACE_Test_Output (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_PSOS)
+ ACE_LOG_MSG->msg_ostream (&cerr);
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY && ! ACE_PSOS */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::OSTREAM);
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR);
+
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_HAS_PHARLAP)
+ delete this->output_file_;
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+OFSTREAM *
+ACE_Test_Output::output_file (void)
+{
+ return this->output_file_;
+}
+
+int
+ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
+{
+#if defined (ACE_HAS_PHARLAP)
+ // For PharLap, just send it all to the host console for now - redirect
+ // to a file there for saving/analysis.
+ EtsSelectConsole(ETS_CO_HOST);
+ ACE_LOG_MSG->msg_ostream (&cout);
+
+#else
+ ACE_TCHAR temp[MAXPATHLEN];
+ // Ignore the error value since the directory may already exist.
+ const ACE_TCHAR *test_dir;
+
+#if !defined (ACE_HAS_WINCE)
+# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
+ test_dir = ACE_OS::getenv (ACE_TEXT ("ACE_TEST_DIR"));
+# else
+ ACE_TCHAR tempenv[MAXPATHLEN];
+ char *test_dir_n = ACE_OS::getenv ("ACE_TEST_DIR");
+ if (test_dir_n == 0)
+ test_dir = 0;
+ else
+ {
+ ACE_OS::strcpy (tempenv, ACE_TEXT_CHAR_TO_TCHAR (test_dir_n));
+ test_dir = tempenv;
+ }
+# endif /* ACE_WIN32 || !ACE_USES_WCHAR */
+
+ if (test_dir == 0)
+#endif /* ACE_HAS_WINCE */
+ test_dir = ACE_TEXT ("");
+
+ // This could be done with ACE_OS::sprintf() but it requires different
+ // format strings for wide-char POSIX vs. narrow-char POSIX and Windows.
+ // Easier to keep straight like this.
+ ACE_OS_String::strcpy (temp, test_dir);
+ ACE_OS_String::strcat (temp, ACE_LOG_DIRECTORY);
+ ACE_OS_String::strcat
+ (temp, ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR));
+ ACE_OS_String::strcat (temp, ACE_LOG_FILE_EXT_NAME);
+
+#if defined (VXWORKS)
+ // This is the only way I could figure out to avoid a console
+ // warning about opening an existing file (w/o O_CREAT), or
+ // attempting to unlink a non-existant one.
+ ACE_HANDLE fd = ACE_OS::open (temp,
+ O_WRONLY|O_CREAT,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if (fd != ERROR)
+ {
+ ACE_OS::close (fd);
+ ACE_OS::unlink (temp);
+ }
+# else /* ! VXWORKS */
+ // This doesn't seem to work on VxWorks if the directory doesn't
+ // exist: it creates a plain file instead of a directory. If the
+ // directory does exist, it causes a wierd console error message
+ // about "cat: input error on standard input: Is a directory". So,
+ // VxWorks users must create the directory manually.
+# if defined (ACE_HAS_WINCE)
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY_FOR_MKDIR);
+# else
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY);
+# endif // ACE_HAS_WINCE
+# endif /* ! VXWORKS */
+
+# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->open (ACE_TEXT_ALWAYS_CHAR (temp),
+ ios::out | (append ? ios::app : ios::trunc));
+ if (this->output_file_->bad ())
+ return -1;
+#else /* when ACE_LACKS_IOSTREAM_TOTALLY */
+ ACE_TCHAR *fmode = 0;
+ if (append)
+ fmode = ACE_TEXT ("a");
+ else
+ fmode = ACE_TEXT ("w");
+ this->output_file_ = ACE_OS::fopen (temp, fmode);
+# endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+
+ ACE_LOG_MSG->msg_ostream (this->output_file ());
+#endif /* ACE_HAS_PHARLAP */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER );
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
+
+ return 0;
+}
+
+void
+ACE_Test_Output::close (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->flush ();
+ this->output_file_->close ();
+#else
+ ACE_OS::fflush (this->output_file_);
+ ACE_OS::fclose (this->output_file_);
+#endif /* !ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+ACE_Test_Output*
+ACE_Test_Output::instance ()
+{
+ if (ACE_Test_Output::instance_ == 0)
+ {
+ // Perform Double-Checked Locking Optimization.
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
+ *ACE_Static_Object_Lock::instance (), 0));
+
+ if (ACE_Test_Output::instance_ == 0)
+ {
+ ACE_NEW_RETURN (ACE_Test_Output::instance_,
+ ACE_Test_Output,
+ 0);
+ ACE_REGISTER_FRAMEWORK_COMPONENT(ACE_Test_Output, ACE_Test_Output::instance_)
+ }
+ }
+ return ACE_Test_Output::instance_;
+}
+
+const ACE_TCHAR *
+ACE_Test_Output::dll_name (void)
+{
+ return ACE_TEXT ("Test_Output");
+}
+
+const ACE_TCHAR *
+ACE_Test_Output::name (void)
+{
+ return ACE_TEXT ("ACE_Test_Output");
+}
+
+void
+ACE_Test_Output::close_singleton (void)
+{
+ delete ACE_Test_Output::instance_;
+ ACE_Test_Output::instance_ = 0;
+}
+
+void
+randomize (int array[], size_t size)
+{
+ size_t i;
+
+ for (i = 0; i < size; i++)
+ array [i] = static_cast<int> (i);
+
+ // See with a fixed number so that we can produce "repeatable"
+ // random numbers.
+ ACE_OS::srand (0);
+
+ // Generate an array of random numbers from 0 .. size - 1.
+
+ for (i = 0; i < size; i++)
+ {
+ size_t index = ACE_OS::rand() % size--;
+ int temp = array [index];
+ array [index] = array [size];
+ array [size] = temp;
+ }
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/client.cpp b/TAO/orbsvcs/tests/HTIOP/BiDirectional/client.cpp
new file mode 100644
index 00000000000..a9a6dac7d63
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/client.cpp
@@ -0,0 +1,168 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "test_i.h"
+#include "tao/BiDir_GIOP/BiDirGIOP.h"
+#include "tao/AnyTypeCode/Any.h"
+
+ACE_RCSID(BiDirectional, client, "$Id$")
+
+const char *ior = "file://test.ior";
+
+void do_nothing (void)
+{
+}
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ CORBA::ORB_var orb = CORBA::ORB::_nil();
+ PortableServer::POA_var root_poa = PortableServer::POA::_nil();
+ Callback_i *servant = 0;
+
+ ACE_TRY_NEW_ENV
+ {
+ orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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 child_poa =
+ root_poa->create_POA ("childPOA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of childPOA is over. Destroy the Policy objects.
+ for (CORBA::ULong i = 0;
+ i < policies.length ();
+ ++i)
+ {
+ policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+
+ servant = new Callback_i (orb.in ());
+
+ Callback_var callback =
+ servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Send the calback object to the server
+ server->callback_object (callback.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // A method to kickstart callbacks from the server
+ CORBA::Long r =
+ server->test_method (1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (r != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) unexpected result = %d ",
+ r));
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ if (!CORBA::is_nil(root_poa.in()))
+ root_poa->destroy (1,1);
+ delete servant;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/inside.conf b/TAO/orbsvcs/tests/HTIOP/BiDirectional/inside.conf
new file mode 100644
index 00000000000..db8240efb56
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/inside.conf
@@ -0,0 +1,7 @@
+# $Id$
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory () "-inside 1"
+# "-config ../HT_Config.conf -env_persist inside.mmf"
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/outside.conf b/TAO/orbsvcs/tests/HTIOP/BiDirectional/outside.conf
new file mode 100644
index 00000000000..48cf6669bb2
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/outside.conf
@@ -0,0 +1,7 @@
+# $Id$
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory ()
+ "-env_persist outside.mmf"
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/run_test.pl b/TAO/orbsvcs/tests/HTIOP/BiDirectional/run_test.pl
new file mode 100755
index 00000000000..b14d507cb97
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/run_test.pl
@@ -0,0 +1,45 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+use Sys::Hostname;
+
+$status = 0;
+$iorfile = PerlACE::LocalFile ("test.ior");
+$host = hostname();
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server", "-orbendpoint htiop://$host:8088 -orbsvcconf outside.conf -o $iorfile -i 100");
+$CL = new PerlACE::Process ("client", "-orbsvcconf inside.conf -k file://$iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (20);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (20);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/server.cpp b/TAO/orbsvcs/tests/HTIOP/BiDirectional/server.cpp
new file mode 100644
index 00000000000..acd21da590e
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/server.cpp
@@ -0,0 +1,177 @@
+// $Id$
+
+#include "ace/OS_NS_stdio.h"
+#include "ace/Get_Opt.h"
+#include "test_i.h"
+#include "tao/BiDir_GIOP/BiDirGIOP.h"
+#include "tao/AnyTypeCode/Any.h"
+
+ACE_RCSID(BiDirectional, server, "$Id$")
+
+const char *ior_output_file = 0;
+int no_iterations = 10;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:i:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'i':
+ no_iterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "-i <no_iterations>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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 child_poa =
+ root_poa->create_POA ("childPOA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of childPOA is over. Destroy the Policy objects.
+ for (CORBA::ULong i = 0;
+ i < policies.length ();
+ ++i)
+ {
+ policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Simple_Server_i *server_impl = new Simple_Server_i (orb.in (),
+ no_iterations);
+
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("simple_server");
+
+ child_poa->activate_object_with_id (id.in (),
+ server_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ server_impl->_remove_ref(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ child_poa->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ int retval = 0;
+ while (retval == 0)
+ {
+ // Just process one upcall. We know that we would get the
+ // clients IOR in that call.
+ CORBA::Boolean pending =
+ orb->work_pending(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (pending)
+ {
+ orb->perform_work(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ // Now that hopefully we have the clients IOR, just start
+ // making remote calls to the client.
+ retval = server_impl->call_client (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/test.idl b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test.idl
new file mode 100644
index 00000000000..47ede657b9a
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test.idl
@@ -0,0 +1,27 @@
+//
+// $Id$
+//
+
+interface Callback
+{
+ oneway void shutdown ();
+ // A safe way to shutdown the client, using either clean shutdowns
+ // or "catastrophic failures".
+
+ void callback_method ();
+ // A simple remote call
+
+};
+
+interface Simple_Server
+{
+ long test_method (in boolean do_callback);
+ // Just call a method on the server,
+
+ void callback_object (in Callback cb);
+ // send the callback object to the server
+
+ oneway void shutdown ();
+ // A safe way to shutdown the server, it is a oneway function so we
+ // will never get a COMM_FAILURE error
+};
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.cpp b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.cpp
new file mode 100644
index 00000000000..60146973192
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.cpp
@@ -0,0 +1,94 @@
+// $Id$
+
+#include "test_i.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+
+#if !defined(__ACE_INLINE__)
+#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(BiDirectional, test_i, "$Id$")
+
+void
+Callback_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "Performing clean shutdown\n"));
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Callback_i::callback_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Callback method called \n"));
+}
+
+
+// ****************************************************************
+
+CORBA::Long
+Simple_Server_i::test_method (CORBA::Boolean do_callback
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (do_callback)
+ {
+ this->flag_ = 1;
+ }
+
+ return 0;
+}
+
+void
+Simple_Server_i::callback_object (Callback_ptr callback
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Store the callback object
+ this->callback_ = Callback::_duplicate (callback);
+}
+
+int
+Simple_Server_i::call_client (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->flag_)
+ {
+ ACE_DEBUG ((LM_DEBUG,"calling client\n"));
+
+ for (int times = 0; times < this->no_iterations_; ++times)
+ {
+ this->callback_->callback_method (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (this->orb_->orb_core ()->lane_resources ().transport_cache ().current_size () > 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) The cache has grown, aborting ..\n"));
+
+ ACE_OS::abort ();
+ }
+ }
+
+ this->callback_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ this->flag_ = 0;
+
+ return 1;
+ }
+
+ return 0;
+}
+
+
+void
+Simple_Server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.h b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.h
new file mode 100644
index 00000000000..d66809ff118
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.h
@@ -0,0 +1,92 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/BiDirectional
+//
+// = FILENAME
+// test_i.h
+//
+// = AUTHOR
+// Balachandran Natarajan <bala@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_BIDIRECTIONAL_TEST_I_H
+#define TAO_BIDIRECTIONAL_TEST_I_H
+
+#include "testS.h"
+
+class Callback_i : public POA_Callback
+{
+ // = TITLE
+ // A callback object to the "client"
+ //
+ // = DESCRIPTION
+ // To test that the server can call the client on the same
+ // connection that was established by the client
+ //
+public:
+ Callback_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Safe way to shutdown
+
+ void callback_method (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The callback method
+
+private:
+ CORBA::ORB_var orb_;
+ // The orb
+
+};
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb, int no_iterations);
+ // ctor
+
+ // = The Simple_Server methods.
+ CORBA::Long test_method (CORBA::Boolean do_callback
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void callback_object (Callback_ptr callback
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ int call_client (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ CORBA::ORB_var orb_;
+ // The ORB
+
+ int flag_;
+ // Flag to indicate, whether we are ready for a remote call.
+
+ Callback_var callback_;
+ // Callback Object
+
+ int no_iterations_;
+ // Number of times the callback needs to be called
+};
+
+#if defined(__ACE_INLINE__)
+#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_BIDIRECTIONAL_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.i b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.i
new file mode 100644
index 00000000000..799be9fdcbe
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/BiDirectional/test_i.i
@@ -0,0 +1,17 @@
+// $Id$
+
+ACE_INLINE
+Callback_i::Callback_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+ACE_INLINE
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb,
+ int no_iterations)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ flag_ (0),
+ callback_ (0),
+ no_iterations_ (no_iterations)
+{
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/HT_Config.conf b/TAO/orbsvcs/tests/HTIOP/HT_Config.conf
new file mode 100644
index 00000000000..49dfd238ec3
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/HT_Config.conf
@@ -0,0 +1,4 @@
+[htbp]
+proxy_port=3128
+proxy_host=rtai.ociweb.com
+htid_url=http://rtai.ociweb.com/cgi-bin/HTIOP_ID_Generator.cgi
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/HTIOP_Hello.mpc b/TAO/orbsvcs/tests/HTIOP/Hello/HTIOP_Hello.mpc
new file mode 100644
index 00000000000..a6fec141c7e
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/HTIOP_Hello.mpc
@@ -0,0 +1,45 @@
+// -*- MPC -*-
+//
+// $Id$
+
+project(*idl): taoidldefaults {
+ idlflags += -Sa -St
+
+ IDL_Files {
+ Test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*Server): taoserver, naming, iortable {
+ after += *idl
+ macros += TEST_OUTPUT_HAS_DLL=0
+ Source_Files {
+ Test_Output.cpp
+ TestS.cpp
+ TestC.cpp
+ Hello.cpp
+ server.cpp
+ }
+ Header_Files {
+ ../test_config.h
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): taoclient {
+ after += *idl
+ macros += TEST_OUTPUT_HAS_DLL=0
+ Source_Files {
+ Test_Output.cpp
+ TestC.cpp
+ client.cpp
+ }
+ Header_Files {
+ ../test_config.h
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/Hello.cpp b/TAO/orbsvcs/tests/HTIOP/Hello/Hello.cpp
new file mode 100644
index 00000000000..b6f13134438
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/Hello.cpp
@@ -0,0 +1,27 @@
+//
+// $Id$
+//
+#include "Hello.h"
+
+ACE_RCSID(Hello, Hello, "$Id$")
+
+Hello::Hello (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+char *
+Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "in get_string\n"));
+ return CORBA::string_dup ("Hello there!");
+}
+
+void
+Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_DEBUG ((LM_DEBUG,"in shutdown\n"));
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/Hello.h b/TAO/orbsvcs/tests/HTIOP/Hello/Hello.h
new file mode 100644
index 00000000000..68311a6634e
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/Hello.h
@@ -0,0 +1,42 @@
+//
+// $Id$
+//
+
+#ifndef HELLO_H
+#define HELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+/// Implement the Test::Hello interface
+class Hello
+ : public virtual POA_Test::Hello
+{
+public:
+ /// Constructor
+ Hello (CORBA::ORB_ptr orb);
+
+ // = The skeleton methods
+ virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to conver strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* HELLO_H */
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/Makefile.am b/TAO/orbsvcs/tests/HTIOP/Hello/Makefile.am
new file mode 100644
index 00000000000..18a98bc6fc4
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/Makefile.am
@@ -0,0 +1,105 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.HTIOP_Hello_Idl.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.HTIOP_Hello_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DTEST_OUTPUT_HAS_DLL=0
+
+client_SOURCES = \
+ TestC.cpp \
+ Test_Output.cpp \
+ client.cpp \
+ ../test_config.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.HTIOP_Hello_Server.am
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTEST_OUTPUT_HAS_DLL=0
+
+server_SOURCES = \
+ Hello.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ Test_Output.cpp \
+ server.cpp \
+ ../test_config.h \
+ Hello.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/README b/TAO/orbsvcs/tests/HTIOP/Hello/README
new file mode 100644
index 00000000000..52221e74599
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/README
@@ -0,0 +1,22 @@
+/**
+
+@page Hello Test README File
+
+Simple Test to test the functionality and usage of HTIOP protocol
+
+ Please refrain from "improving", extending or expanding this
+test, if you need to change
+
+ To run the test use the run_test.pl script:
+
+$ ./run_test.pl
+
+ the script returns 0 if the test was successful.
+
+
+This test also demonstrates how one could use HTIOP with the corbaloc
+or corbaname syntax. Note that corbaloc support requires the server register
+the object reference with the IOR table internally, the corbaname support
+requires the NamingService running.
+
+*/
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/Test.idl b/TAO/orbsvcs/tests/HTIOP/Hello/Test.idl
new file mode 100644
index 00000000000..d6002892314
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/Test.idl
@@ -0,0 +1,20 @@
+//
+// $Id$
+//
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ /// A very simple interface
+ interface Hello
+ {
+ /// Return a simple string
+ string get_string ();
+
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ void shutdown ();
+ };
+};
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/Test_Output.cpp b/TAO/orbsvcs/tests/HTIOP/Hello/Test_Output.cpp
new file mode 100644
index 00000000000..8ab1d029463
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/Test_Output.cpp
@@ -0,0 +1,230 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file Test_Output.cpp
+ *
+ * $Id$
+ *
+ * This file factors out common macros and other utilities used by the
+ * ACE automated regression tests.
+ *
+ * @author Prashant Jain <pjain@cs.wustl.edu>
+ * @author Tim Harrison <harrison@cs.wustl.edu>
+ * @author David Levine <levine@cs.wustl.edu>
+ * @author Don Hinton <dhinton@dresystems.com>
+ */
+// ============================================================================
+
+#include "tests/test_config.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_sys_stat.h"
+#include "ace/Guard_T.h"
+#include "ace/Object_Manager.h"
+
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+
+#include "ace/Framework_Component.h"
+#include "ace/Log_Msg.h"
+#include "ace/ACE.h"
+
+#if defined (VXWORKS)
+# include "ace/OS_NS_unistd.h"
+# include "ace/OS_NS_fcntl.h"
+#endif /* VXWORKS */
+
+ACE_Test_Output *ACE_Test_Output::instance_ = 0;
+
+ACE_Test_Output::ACE_Test_Output (void)
+ : output_file_ (0)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_ = new OFSTREAM;
+#endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+ACE_Test_Output::~ACE_Test_Output (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_PSOS)
+ ACE_LOG_MSG->msg_ostream (&cerr);
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY && ! ACE_PSOS */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::OSTREAM);
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR);
+
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_HAS_PHARLAP)
+ delete this->output_file_;
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+OFSTREAM *
+ACE_Test_Output::output_file (void)
+{
+ return this->output_file_;
+}
+
+int
+ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
+{
+#if defined (ACE_HAS_PHARLAP)
+ // For PharLap, just send it all to the host console for now - redirect
+ // to a file there for saving/analysis.
+ EtsSelectConsole(ETS_CO_HOST);
+ ACE_LOG_MSG->msg_ostream (&cout);
+
+#else
+ ACE_TCHAR temp[MAXPATHLEN];
+ // Ignore the error value since the directory may already exist.
+ const ACE_TCHAR *test_dir;
+
+#if !defined (ACE_HAS_WINCE)
+# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
+ test_dir = ACE_OS::getenv (ACE_TEXT ("ACE_TEST_DIR"));
+# else
+ ACE_TCHAR tempenv[MAXPATHLEN];
+ char *test_dir_n = ACE_OS::getenv ("ACE_TEST_DIR");
+ if (test_dir_n == 0)
+ test_dir = 0;
+ else
+ {
+ ACE_OS::strcpy (tempenv, ACE_TEXT_CHAR_TO_TCHAR (test_dir_n));
+ test_dir = tempenv;
+ }
+# endif /* ACE_WIN32 || !ACE_USES_WCHAR */
+
+ if (test_dir == 0)
+#endif /* ACE_HAS_WINCE */
+ test_dir = ACE_TEXT ("");
+
+ // This could be done with ACE_OS::sprintf() but it requires different
+ // format strings for wide-char POSIX vs. narrow-char POSIX and Windows.
+ // Easier to keep straight like this.
+ ACE_OS_String::strcpy (temp, test_dir);
+ ACE_OS_String::strcat (temp, ACE_LOG_DIRECTORY);
+ ACE_OS_String::strcat
+ (temp, ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR));
+ ACE_OS_String::strcat (temp, ACE_LOG_FILE_EXT_NAME);
+
+#if defined (VXWORKS)
+ // This is the only way I could figure out to avoid a console
+ // warning about opening an existing file (w/o O_CREAT), or
+ // attempting to unlink a non-existant one.
+ ACE_HANDLE fd = ACE_OS::open (temp,
+ O_WRONLY|O_CREAT,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if (fd != ERROR)
+ {
+ ACE_OS::close (fd);
+ ACE_OS::unlink (temp);
+ }
+# else /* ! VXWORKS */
+ // This doesn't seem to work on VxWorks if the directory doesn't
+ // exist: it creates a plain file instead of a directory. If the
+ // directory does exist, it causes a wierd console error message
+ // about "cat: input error on standard input: Is a directory". So,
+ // VxWorks users must create the directory manually.
+# if defined (ACE_HAS_WINCE)
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY_FOR_MKDIR);
+# else
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY);
+# endif // ACE_HAS_WINCE
+# endif /* ! VXWORKS */
+
+# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->open (ACE_TEXT_ALWAYS_CHAR (temp),
+ ios::out | (append ? ios::app : ios::trunc));
+ if (this->output_file_->bad ())
+ return -1;
+#else /* when ACE_LACKS_IOSTREAM_TOTALLY */
+ ACE_TCHAR *fmode = 0;
+ if (append)
+ fmode = ACE_TEXT ("a");
+ else
+ fmode = ACE_TEXT ("w");
+ this->output_file_ = ACE_OS::fopen (temp, fmode);
+# endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+
+ ACE_LOG_MSG->msg_ostream (this->output_file ());
+#endif /* ACE_HAS_PHARLAP */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER );
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
+
+ return 0;
+}
+
+void
+ACE_Test_Output::close (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->flush ();
+ this->output_file_->close ();
+#else
+ ACE_OS::fflush (this->output_file_);
+ ACE_OS::fclose (this->output_file_);
+#endif /* !ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+ACE_Test_Output*
+ACE_Test_Output::instance ()
+{
+ if (ACE_Test_Output::instance_ == 0)
+ {
+ // Perform Double-Checked Locking Optimization.
+ ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
+ *ACE_Static_Object_Lock::instance (), 0));
+
+ if (ACE_Test_Output::instance_ == 0)
+ {
+ ACE_NEW_RETURN (ACE_Test_Output::instance_,
+ ACE_Test_Output,
+ 0);
+ ACE_REGISTER_FRAMEWORK_COMPONENT(ACE_Test_Output, ACE_Test_Output::instance_)
+ }
+ }
+ return ACE_Test_Output::instance_;
+}
+
+const ACE_TCHAR *
+ACE_Test_Output::dll_name (void)
+{
+ return ACE_TEXT ("Test_Output");
+}
+
+const ACE_TCHAR *
+ACE_Test_Output::name (void)
+{
+ return ACE_TEXT ("ACE_Test_Output");
+}
+
+void
+ACE_Test_Output::close_singleton (void)
+{
+ delete ACE_Test_Output::instance_;
+ ACE_Test_Output::instance_ = 0;
+}
+
+void
+randomize (int array[], size_t size)
+{
+ size_t i;
+
+ for (i = 0; i < size; i++)
+ array [i] = static_cast<int> (i);
+
+ // See with a fixed number so that we can produce "repeatable"
+ // random numbers.
+ ACE_OS::srand (0);
+
+ // Generate an array of random numbers from 0 .. size - 1.
+
+ for (i = 0; i < size; i++)
+ {
+ size_t index = ACE_OS::rand() % size--;
+ int temp = array [index];
+ array [index] = array [size];
+ array [size] = temp;
+ }
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/client.cpp b/TAO/orbsvcs/tests/HTIOP/Hello/client.cpp
new file mode 100644
index 00000000000..e8d3ff65f68
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/client.cpp
@@ -0,0 +1,94 @@
+// $Id$
+
+#include "TestC.h"
+
+#include "tests/test_config.h"
+#include <ace/Get_Opt.h>
+
+
+ACE_RCSID(Hello, client, "$Id$")
+
+const char *ior = "file://test.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_START_TEST (ACE_TEXT ("Hello_client"));
+
+ ACE_TRY_NEW_ENV
+ {
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ CORBA::String_var the_string =
+ hello->get_string (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client Main - string returned <%s>\n",
+ the_string.in ()));
+
+ hello->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client Main - shutdown returned\n"));
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_END_TEST;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/outside.conf b/TAO/orbsvcs/tests/HTIOP/Hello/outside.conf
new file mode 100644
index 00000000000..219a83417be
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/outside.conf
@@ -0,0 +1,8 @@
+# $Id$
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory ()
+ "-env_persist outside.mmf"
+
+static Resource_Factory
+ "-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/run_test.pl b/TAO/orbsvcs/tests/HTIOP/Hello/run_test.pl
new file mode 100755
index 00000000000..110aff57e38
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/run_test.pl
@@ -0,0 +1,91 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+use Sys::Hostname;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+
+unlink $iorfile;
+unlink $nsiorfile;
+
+$status = 0;
+$host = hostname();
+
+$ior = "file://$iorfile";
+$server_port = 8088;
+$name_port = 8087;
+$server_config = PerlACE::LocalFile ("outside.conf");
+
+foreach $i (@ARGV) {
+ if ($i eq '-corbaloc') {
+ $ior = "corbaloc:htiop:$host:$server_port/HelloObj";
+ }
+ elsif ($i eq '-corbaname') {
+ $ior = "corbaname:htiop:$host:$name_port#HelloObj";
+ $use_ns = 1;
+ }
+}
+
+$NS =
+ new PerlACE::Process ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service",
+ "-ORBSvcConf $server_config "
+ . "-ORBEndpoint 'iiop://;htiop://$host:$name_port' "
+ . "-o $nsiorfile");
+
+$NS->IgnoreExeSubDir ();
+$NS->Spawn ();
+print "Waiting for Name Service to start\n";
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: nameserver not started\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+
+$SV =
+ new PerlACE::Process ("server",
+ "-o $iorfile "
+ . "-ORBInitRef NameService=file://$nsiorfile "
+ . "-ORBSvcConf $server_config "
+ . "-ORBEndpoint htiop://$host:$server_port");
+
+$CL = new PerlACE::Process ("client", " -k $ior");
+
+$SV->Spawn ();
+print "Waiting for server to start\n";
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+print "Running Client\n";
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ $SV->Kill(); $SV->TimedWait (1);
+}
+else {
+ $server = $SV->WaitKill (10);
+
+ if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+ }
+}
+
+$NS->Kill ();
+$NS->TimedWait (1);
+
+unlink $nsiorfile;
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/server.cpp b/TAO/orbsvcs/tests/HTIOP/Hello/server.cpp
new file mode 100644
index 00000000000..e3ba7544ee9
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/server.cpp
@@ -0,0 +1,167 @@
+// $Id$
+
+#include "Hello.h"
+
+#include "tests/test_config.h"
+
+#include "ace/Get_Opt.h"
+#include "tao/IORTable/IORTable.h"
+#include "orbsvcs/CosNamingC.h"
+
+ACE_RCSID (Hello,
+ server,
+ "$Id$")
+
+const char *ior_output_file = "test.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_START_TEST (ACE_TEXT ("Hello_server"));
+
+ ACE_TRY_NEW_ENV
+ {
+ ACE_DEBUG ((LM_DEBUG, "Begin of Hello_Server test\n"));
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //------ Get Root POA & POA Manager references
+
+ CORBA::Object_var obj =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //------- Get IOR Table reference to support CORBALOC URLs
+
+ obj =
+ orb->resolve_initial_references("IORTable" ACE_ENV_ARG_PARAMETER);
+
+ IORTable::Table_var ior_table =
+ IORTable::Table::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+
+
+ //------- Get NameService Root Context
+
+ obj =
+ orb->resolve_initial_references("NameService" ACE_ENV_ARG_PARAMETER);
+
+ CosNaming::NamingContextExt_var root_nc =
+ CosNaming::NamingContextExt::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+
+ //-------- Prepare Servant
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Hello *hello_impl;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (orb.in ()),
+ 1);
+ PortableServer::ServantBase_var owner_transfer(hello_impl);
+
+ Test::Hello_var hello =
+ hello_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //--------- Publish IOR using various means
+
+ if (!CORBA::is_nil(root_nc.in()))
+ {
+ CosNaming::Name_var objname= root_nc->to_name("HelloObj");
+ root_nc->rebind (objname.in(),hello.in());
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,"Could not initialize name service\n"));
+ }
+
+ if (!CORBA::is_nil(ior_table.in()))
+ ior_table->bind("HelloObj", ior.in() ACE_ENV_ARG_PARAMETER);
+
+ // Output the IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - Root poa destroyed\n"));
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - orb destroyed\n"));
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "server exiting\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_END_TEST;
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_END_TEST;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/HTIOP/Hello/svc.conf b/TAO/orbsvcs/tests/HTIOP/Hello/svc.conf
new file mode 100644
index 00000000000..13a0987cc86
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Hello/svc.conf
@@ -0,0 +1,7 @@
+# $Id$
+
+dynamic HTIOP_Factory Service_Object *
+ TAO_HTIOP:_make_TAO_HTIOP_Protocol_Factory ()
+ "-config ../HT_Config.conf"
+
+static Resource_Factory "-ORBProtocolFactory HTIOP_Factory"
diff --git a/TAO/orbsvcs/tests/HTIOP/Makefile.am b/TAO/orbsvcs/tests/HTIOP/Makefile.am
new file mode 100644
index 00000000000..8493fa2444c
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/Makefile.am
@@ -0,0 +1,15 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ AMI \
+ BiDirectional \
+ Hello
+
diff --git a/TAO/orbsvcs/tests/HTIOP/test_config.h b/TAO/orbsvcs/tests/HTIOP/test_config.h
new file mode 100644
index 00000000000..c87f7c6ecb4
--- /dev/null
+++ b/TAO/orbsvcs/tests/HTIOP/test_config.h
@@ -0,0 +1,319 @@
+// -*- C++ -*-
+
+
+// ============================================================================
+/**
+ * @file test_config.h
+ *
+ * $Id$
+ *
+ * This file factors out common macros and other utilities used by the
+ * ACE automated regression tests.
+ *
+ * @author Prashant Jain <pjain@cs.wustl.edu>
+ * @author Tim Harrison <harrison@cs.wustl.edu>
+ * @author David Levine <levine@cs.wustl.edu>
+ */
+// ============================================================================
+
+#ifndef ACE_TEST_CONFIG_H
+#define ACE_TEST_CONFIG_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_NLOGGING)
+// ACE_NLOGGING must not be set if the tests are to produce any output.
+#undef ACE_NLOGGING
+#endif /* ACE_NLOGGING */
+
+// This first #undef protects against command-line definitions.
+#undef ACE_NDEBUG
+#include "ace/OS.h"
+#include "ace/streams.h"
+#include "ace/Singleton.h"
+#include "ace/Synch.h"
+#include "ace/Log_Msg.h"
+#include "ace/ACE.h"
+
+// The second #undef protects against being reset in a config.h file.
+#undef ACE_NDEBUG
+
+#undef ACE_TEXT
+#define ACE_TEXT ACE_LIB_TEXT
+
+#if defined (ACE_HAS_WINCE)
+// Note that Pocket PC 2002 will NOT create a directory if it does not start with a leading '\'.
+// PPC 2002 only accepts '\log' as a valid directory name, while 'log\' works under WinCE 3.0.
+# define ACE_LOG_DIRECTORY_FOR_MKDIR ACE_TEXT ("\\log")
+# define ACE_LOG_DIRECTORY ACE_TEXT ("\\log\\")
+# define MAKE_PIPE_NAME(X) ACE_TEXT ("\\\\.\\pipe\\"#X)
+#elif defined (ACE_WIN32)
+# define ACE_LOG_DIRECTORY ACE_TEXT ("..\\..\\log\\")
+# define MAKE_PIPE_NAME(X) ACE_TEXT ("\\\\..\\..\\.\\pipe\\"#X)
+#else
+# define ACE_LOG_DIRECTORY ACE_TEXT ("log/")
+# define MAKE_PIPE_NAME(X) ACE_TEXT (X)
+#endif /* ACE_WIN32 */
+
+#if defined (ACE_HAS_WINCE)
+#define ACE_LOG_FILE_EXT_NAME ACE_TEXT (".txt")
+#else
+#define ACE_LOG_FILE_EXT_NAME ACE_TEXT (".log")
+#endif /* ACE_HAS_WINCE */
+
+#if defined (ACE_HAS_WINCE) || defined (ACE_HAS_PHARLAP)
+const size_t ACE_MAX_CLIENTS = 4;
+#else
+const size_t ACE_MAX_CLIENTS = 30;
+#endif /* ACE_HAS_WINCE */
+
+const size_t ACE_NS_MAX_ENTRIES = 1000;
+const size_t ACE_DEFAULT_USECS = 1000;
+const size_t ACE_MAX_TIMERS = 4;
+const size_t ACE_MAX_DELAY = 10;
+const size_t ACE_MAX_INTERVAL = 0;
+const size_t ACE_MAX_ITERATIONS = 10;
+const size_t ACE_MAX_PROCESSES = 10;
+const size_t ACE_MAX_THREADS = 4;
+
+#define ACE_START_TEST(NAME) \
+ const ACE_TCHAR *program = NAME; \
+ ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE); \
+ if (ace_file_stream::instance()->set_output (program) != 0) \
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program))
+
+#define ACE_END_TEST \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %D\n"), program)); \
+ ace_file_stream::instance()->close ()
+
+#define ACE_CLOSE_TEST_LOG ace_file_stream::instance()->close ()
+
+#if !defined (ACE_WIN32)
+#define ACE_APPEND_LOG(NAME) \
+ const ACE_TCHAR *program = NAME; \
+ ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE); \
+ ace_file_stream::instance()->close (); \
+ if (ace_file_stream::instance()->set_output (program, 1) != 0) \
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program));
+#else /* ACE_WIN32 */
+#define ACE_APPEND_LOG(NAME) \
+ const ACE_TCHAR *program = NAME; \
+ ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE); \
+ if (ace_file_stream::instance()->set_output (program, 1) != 0) \
+ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program));
+#endif /* ACE_WIN32 */
+
+#define ACE_END_LOG \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %D\n\n"), program)); \
+ ACE_LOG_MSG->set_flags(ACE_Log_Msg::SILENT); \
+ ace_file_stream::instance()->close ();
+
+#if defined (VXWORKS)
+ // This is the only way I could figure out to avoid an error
+ // about attempting to unlink a non-existant file.
+#define ACE_INIT_LOG(NAME) \
+ ACE_TCHAR temp[MAXPATHLEN]; \
+ ACE_OS::sprintf (temp, ACE_TEXT ("%s%s%s"), \
+ ACE_LOG_DIRECTORY, \
+ ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \
+ ACE_LOG_FILE_EXT_NAME); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Deleting old log file %s (if any)\n\n"), temp)); \
+ int fd_init_log; \
+ if ((fd_init_log = ACE_OS::open (temp, \
+ O_WRONLY|O_CREAT, \
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) != ERROR) \
+ { \
+ ACE_OS::close (fd_init_log); \
+ ACE_OS::unlink (temp); \
+ }
+
+#if defined (ghs)
+# // Rename main to ace_main for compatibility with run_tests.vxworks.
+# undef ACE_MAIN
+# define ACE_MAIN ace_main
+#endif /* ghs */
+#else /* ! VXWORKS */
+#define ACE_INIT_LOG(NAME) \
+ ACE_TCHAR temp[MAXPATHLEN]; \
+ ACE_OS::sprintf (temp, ACE_TEXT ("%s%s%s"), \
+ ACE_LOG_DIRECTORY, \
+ ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \
+ ACE_LOG_FILE_EXT_NAME); \
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Deleting old log file %s (if any)\n\n"), temp)); \
+ ACE_OS::unlink (temp);
+#endif /* ! VXWORKS */
+
+#if defined (ACE_LACKS_IOSTREAM_TOTALLY)
+#define OFSTREAM FILE
+#else
+#define OFSTREAM ofstream
+#endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+
+class ACE_Test_Output
+{
+public:
+ ACE_Test_Output (void);
+ ~ACE_Test_Output (void);
+ int set_output (const ACE_TCHAR *filename, int append = 0);
+ OFSTREAM *output_file (void);
+ void close (void);
+
+private:
+ OFSTREAM *output_file_;
+};
+
+inline ACE_Test_Output::ACE_Test_Output (void)
+ : output_file_ (0)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_ = new OFSTREAM;
+#endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+inline ACE_Test_Output::~ACE_Test_Output (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_PSOS)
+ ACE_LOG_MSG->msg_ostream (&cerr);
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY && ! ACE_PSOS */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::OSTREAM);
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR);
+
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_HAS_PHARLAP)
+ delete this->output_file_;
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
+}
+
+inline OFSTREAM *
+ACE_Test_Output::output_file (void)
+{
+ return this->output_file_;
+}
+
+inline int
+ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append)
+{
+#if defined (ACE_HAS_PHARLAP)
+ // For PharLap, just send it all to the host console for now - redirect
+ // to a file there for saving/analysis.
+ EtsSelectConsole(ETS_CO_HOST);
+ ACE_LOG_MSG->msg_ostream (&cout);
+
+#else
+ ACE_TCHAR temp[MAXPATHLEN];
+ // Ignore the error value since the directory may already exist.
+ const ACE_TCHAR *test_dir;
+
+#if !defined (ACE_HAS_WINCE)
+ test_dir = ACE_OS::getenv (ACE_TEXT ("ACE_TEST_DIR"));
+
+ if (test_dir == 0)
+#endif /* ACE_HAS_WINCE */
+ test_dir = ACE_TEXT ("");
+
+ ACE_OS::sprintf (temp,
+ ACE_TEXT ("%s%s%s%s"),
+ test_dir,
+ ACE_LOG_DIRECTORY,
+ ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR),
+ ACE_LOG_FILE_EXT_NAME);
+
+#if defined (VXWORKS)
+ // This is the only way I could figure out to avoid a console
+ // warning about opening an existing file (w/o O_CREAT), or
+ // attempting to unlink a non-existant one.
+ ACE_HANDLE fd = ACE_OS::open (temp,
+ O_WRONLY|O_CREAT,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if (fd != ERROR)
+ {
+ ACE_OS::close (fd);
+ ACE_OS::unlink (temp);
+ }
+# else /* ! VXWORKS */
+ // This doesn't seem to work on VxWorks if the directory doesn't
+ // exist: it creates a plain file instead of a directory. If the
+ // directory does exist, it causes a wierd console error message
+ // about "cat: input error on standard input: Is a directory". So,
+ // VxWorks users must create the directory manually.
+# if defined (ACE_HAS_WINCE)
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY_FOR_MKDIR);
+# else
+ ACE_OS::mkdir (ACE_LOG_DIRECTORY);
+# endif // ACE_HAS_WINCE
+# endif /* ! VXWORKS */
+
+# if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->open (ACE_TEXT_ALWAYS_CHAR (temp),
+ ios::out | (append ? ios::app : ios::trunc));
+ if (this->output_file_->bad ())
+ return -1;
+#else /* when ACE_LACKS_IOSTREAM_TOTALLY */
+ ACE_TCHAR *fmode = 0;
+ if (append)
+ fmode = ACE_TEXT ("a");
+ else
+ fmode = ACE_TEXT ("w");
+ this->output_file_ = ACE_OS::fopen (temp, fmode);
+# endif /* ACE_LACKS_IOSTREAM_TOTALLY */
+
+ ACE_LOG_MSG->msg_ostream (this->output_file ());
+#endif /* ACE_HAS_PHARLAP */
+
+ ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER );
+ ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
+
+ return 0;
+}
+
+inline void
+ACE_Test_Output::close (void)
+{
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ this->output_file_->flush ();
+ this->output_file_->close ();
+#else
+ ACE_OS::fflush (this->output_file_);
+ ACE_OS::fclose (this->output_file_);
+#endif /* !ACE_LACKS_IOSTREAM_TOTALLY */
+ ACE_LOG_MSG->msg_ostream (0);
+}
+
+inline void
+randomize (int array[], size_t size)
+{
+ size_t i;
+
+ for (i = 0; i < size; i++)
+ array [i] = static_cast<int> (i);
+
+ // See with a fixed number so that we can produce "repeatable"
+ // random numbers.
+ ACE_OS::srand (0);
+
+ // Generate an array of random numbers from 0 .. size - 1.
+
+ for (i = 0; i < size; i++)
+ {
+ size_t index = ACE_OS::rand() % size--;
+ int temp = array [index];
+ array [index] = array [size];
+ array [size] = temp;
+ }
+}
+
+typedef ACE_Singleton<ACE_Test_Output, ACE_Null_Mutex> ace_file_stream;
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Singleton<ACE_Test_Output, ACE_Null_Mutex> *
+ ACE_Singleton<ACE_Test_Output, ACE_Null_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
+
+#endif /* ACE_TEST_CONFIG_H */
diff --git a/TAO/orbsvcs/tests/IOR_MCast/IOR_MCast.mpc b/TAO/orbsvcs/tests/IOR_MCast/IOR_MCast.mpc
new file mode 100644
index 00000000000..01fcb2cd41a
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/IOR_MCast.mpc
@@ -0,0 +1,40 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ MCast.idl
+ }
+ custom_only = 1
+}
+
+project(*server): namingexe, iortable, svc_utils {
+ exename = server
+
+ after += *idl
+ Source_Files {
+ server_i.cpp
+ MCast_Server_i.cpp
+ MCastS.cpp
+ MCastC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*client): namingexe, iortable, svc_utils {
+ exename = client
+
+ after += *idl
+ Source_Files {
+ ior_mcast_client_i.cpp
+ server_i.cpp
+ MCast_Server_i.cpp
+ MCastS.cpp
+ MCastC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/IOR_MCast/MCast.idl b/TAO/orbsvcs/tests/IOR_MCast/MCast.idl
new file mode 100644
index 00000000000..bd46594a6f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/MCast.idl
@@ -0,0 +1,19 @@
+// $Id$
+
+module MCast
+{
+
+ interface Server
+ {
+ // = TITLE
+ //
+ // = DESCRIPTION
+ // Prints out the status.
+
+ boolean connect_server ();
+ // Return <true> if the server received the
+ // request from the client.
+
+ };
+
+};
diff --git a/TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.cpp b/TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.cpp
new file mode 100644
index 00000000000..0639cfcefeb
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.cpp
@@ -0,0 +1,15 @@
+// $Id$
+
+#include "MCast_Server_i.h"
+
+MCast_Server_i::MCast_Server_i (void)
+{
+ //Constructor.
+}
+
+CORBA::Boolean
+MCast_Server_i::connect_server (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.h b/TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.h
new file mode 100644
index 00000000000..1056dc77929
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/MCast_Server_i.h
@@ -0,0 +1,18 @@
+// $Id$
+
+#ifndef MCAST_SERVER_I_H
+#define MCAST_SERVER_I_H
+
+#include "MCastS.h"
+
+class MCast_Server_i : public POA_MCast::Server {
+public:
+ MCast_Server_i ();
+
+ // Simple method just to see that the client contacted the
+ // server. If does contact, a '0' is returned.
+ CORBA::Boolean connect_server (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+#endif /* MCAST_SERVER_I_H */
diff --git a/TAO/orbsvcs/tests/IOR_MCast/Makefile.am b/TAO/orbsvcs/tests/IOR_MCast/Makefile.am
new file mode 100644
index 00000000000..2bc7d3d8d76
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/Makefile.am
@@ -0,0 +1,116 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.IOR_MCast_Idl.am
+
+BUILT_SOURCES = \
+ MCastC.cpp \
+ MCastC.h \
+ MCastC.inl \
+ MCastS.cpp \
+ MCastS.h \
+ MCastS.inl
+
+CLEANFILES = \
+ MCast-stamp \
+ MCastC.cpp \
+ MCastC.h \
+ MCastC.inl \
+ MCastS.cpp \
+ MCastS.h \
+ MCastS.inl
+
+MCastC.cpp MCastC.h MCastC.inl MCastS.cpp MCastS.h MCastS.inl: MCast-stamp
+
+MCast-stamp: $(srcdir)/MCast.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/MCast.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ MCast.idl
+
+## Makefile.IOR_MCast_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ MCastC.cpp \
+ MCastS.cpp \
+ MCast_Server_i.cpp \
+ client.cpp \
+ ior_mcast_client_i.cpp \
+ server_i.cpp \
+ MCast_Server_i.h \
+ ior_mcast_client_i.h \
+ server_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.IOR_MCast_Server.am
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ MCastC.cpp \
+ MCastS.cpp \
+ MCast_Server_i.cpp \
+ server.cpp \
+ server_i.cpp \
+ MCast_Server_i.h \
+ server_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/IOR_MCast/README b/TAO/orbsvcs/tests/IOR_MCast/README
new file mode 100644
index 00000000000..c1ba4a88b3a
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/README
@@ -0,0 +1,20 @@
+// $Id$
+
+This is a simple test for testing the multicast ior parser with format
+mcast://multicast_address:port:nicaddress:ttl
+
+The Client requests for the IOR of a service that is multicasted.
+The Server helps get this ior with the use of the TAO_IOR_Multicast
+class in the libTAO_Svc_Utils library.
+
+It should test the nic address and ttl parts too of the mcast format.
+
+You can run the test as:
+
+% ./server -a 224.0.1.27:12345 -ORBEndpoint iiop://doc.ece.uci.edu:23456
+
+ The '-a' option is to give the multicast address to which the
+requests to the server should be directed to.
+
+% ./client -ORBInitRef MCASTServer=mcast://224.0.1.27:12345:eth0:2/MCASTServer
+
diff --git a/TAO/orbsvcs/tests/IOR_MCast/client.cpp b/TAO/orbsvcs/tests/IOR_MCast/client.cpp
new file mode 100644
index 00000000000..7a79bec47bc
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/client.cpp
@@ -0,0 +1,33 @@
+// $Id$
+
+#include "ior_mcast_client_i.h"
+
+int main (int argc, char *argv [])
+{
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+
+ ior_mcast_Client_i client;
+
+ int init_result;
+ init_result = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ //
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.cpp b/TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.cpp
new file mode 100644
index 00000000000..26a0d6c3e12
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.cpp
@@ -0,0 +1,80 @@
+// $Id$
+
+#include "ior_mcast_client_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+
+ior_mcast_Client_i::ior_mcast_Client_i (void)
+{
+ // Constructor
+}
+
+ior_mcast_Client_i::~ior_mcast_Client_i (void)
+{
+}
+
+int
+ior_mcast_Client_i::init (int& argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+
+ ACE_TRY
+ {
+ // First initialize the ORB, that will remove some arguments...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ "" /* the ORB name, it can be anything! */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var mcast_server_object =
+ orb->resolve_initial_references ("MCASTServer" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (mcast_server_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot resolve MCast Server\n : client"),
+ -1);
+
+ MCast::Server_var mcast_srvr =
+ MCast::Server::_narrow (mcast_server_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (mcast_srvr.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot narrow MCast Service\n :client"),
+ -1);
+
+ // Invoke a request on the server
+ CORBA::Boolean ret_value =
+ mcast_srvr->connect_server (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ret_value != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "The server has not been contacted. Error!!\n"),
+ -1);
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "The server has been successfully contacted!\n"));
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "client");
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.h b/TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.h
new file mode 100644
index 00000000000..6602be6a96e
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/ior_mcast_client_i.h
@@ -0,0 +1,36 @@
+// -*- C++ -*-
+// $Id$
+
+#if !defined (IOR_MCAST_CLIENT_I_H)
+#define IOR_MCAST_CLIENT_I_H
+
+#include "MCastC.h"
+#include "ace/SString.h"
+
+class ior_mcast_Client_i
+{
+ // = TITLE
+ // ior_mcast_client_i.h
+ //
+ // = DESCRIPTION
+ // Helper class for the client which uses the mcast ior type to
+ // get reference to the server.
+
+ public:
+ // = COnstructor and destructor.
+ ior_mcast_Client_i (void);
+ ~ior_mcast_Client_i (void);
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Execute the client example code.
+
+ int init (int& argc, char *argv[] ACE_ENV_ARG_DECL);
+ // Initialize the client communication endpoint with the server.
+
+ private:
+ // mcast_ior
+ ACE_CString mcast_url_;
+
+};
+
+#endif /* IOR_MCAST_CLIENT_I_H */
diff --git a/TAO/orbsvcs/tests/IOR_MCast/run_test_ipv6.pl b/TAO/orbsvcs/tests/IOR_MCast/run_test_ipv6.pl
new file mode 100755
index 00000000000..11d2385a18c
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/run_test_ipv6.pl
@@ -0,0 +1,34 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+if (PerlACE::is_vxworks_test()) {
+ $SV = new PerlACE::ProcessVX ("server", "-a [ff01::1]:12345 -ORBEndpoint iiop://[::1]:23456");
+}
+else {
+ $SV = new PerlACE::Process ("server", "-a [ff01::1]:12345 -ORBEndpoint iiop://[::1]:23456");
+}
+$CL = new PerlACE::Process ("client", "-ORBInitRef MCASTServer=mcast://[ff01::1]:12345::2/MCASTServer");
+
+$SV->Spawn ();
+
+sleep 3;
+
+$client = $CL->SpawnWaitKill (20);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->TerminateWaitKill (10);
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/IOR_MCast/server.cpp b/TAO/orbsvcs/tests/IOR_MCast/server.cpp
new file mode 100644
index 00000000000..be8c6ab97c8
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/server.cpp
@@ -0,0 +1,28 @@
+// $Id$
+
+#include "server_i.h"
+
+int main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ Server_i svr_i;
+
+ const int init_result = svr_i.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (init_result != 0)
+ return 1;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CORBA exception raised in server!");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/IOR_MCast/server_i.cpp b/TAO/orbsvcs/tests/IOR_MCast/server_i.cpp
new file mode 100644
index 00000000000..e9a12f65dc5
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/server_i.cpp
@@ -0,0 +1,185 @@
+// $Id$
+
+#include "MCastC.h"
+#include "MCastS.h"
+#include "server_i.h"
+#include "MCast_Server_i.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/IORTable/IORTable.h"
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+
+Server_i::Server_i (void)
+ : argc_ (0),
+ argv_ (0),
+ orb_ (),
+ ior_multicast_ (0),
+ service_ior_ (),
+ mcast_address_ ()
+{
+}
+
+Server_i::~Server_i (void)
+{
+ delete this->ior_multicast_;
+}
+
+int
+Server_i::init (int &argc,
+ char **&argv
+ ACE_ENV_ARG_DECL)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_TRY
+ {
+ // First initialize the ORB, that will remove some arguments...
+ this->orb_ =
+ CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "" /* the ORB name, it can be anything! */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get a reference to the RootPOA.
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow down to the correct reference.
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set a POA Manager.
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Activate the POA Manager.
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior;
+
+ // Create the servant
+ MCast_Server_i server_i;
+
+ // Activate it to obtain the reference
+ MCast::Server_var mcast_server =
+ server_i._this ();
+
+ CORBA::Object_var table_object =
+ this->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 ((LM_ERROR, "Nil IORTable\n"));
+ }
+ else
+ {
+ ior =
+ this->orb_->object_to_string (mcast_server.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ adapter->bind ("MCASTServer", ior.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Enable such that the server can listen for multicast requests
+ // at the specified address.
+ if (this->enable_multicast (ior.in ()) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: Unable to enable multicast "
+ "on specified address.\n"));
+
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+
+ // Run the ORB
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //Destroy the POA, waiting until the destruction terminates.
+ poa->destroy (1, 1);
+ this->orb_->destroy ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Server_i::enable_multicast (const char *ior)
+{
+ if (this->parse_args (this->argc_, this->argv_) != 0)
+ return -1;
+
+ // Get reactor instance from TAO.
+ ACE_Reactor *reactor =
+ this->orb_->orb_core ()->reactor ();
+
+ // Instantiate a handler which will handle client requests for the
+ // bootstrappable service, received on the multicast port.
+ ACE_NEW_RETURN (this->ior_multicast_,
+ TAO_IOR_Multicast (),
+ -1);
+
+ if (this->ior_multicast_->init (ior,
+ this->mcast_address_.in (),
+ TAO_SERVICEID_MCASTSERVER) == -1)
+ return -1;
+
+ // Register event handler for the ior multicast.
+ if (reactor->register_handler (this->ior_multicast_,
+ ACE_Event_Handler::READ_MASK) == -1)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "MCast_Server: cannot register Event handler\n"));
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+Server_i::parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opts (argc, argv, "a:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'a':
+ this->mcast_address_ = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-a <mcast_address>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/IOR_MCast/server_i.h b/TAO/orbsvcs/tests/IOR_MCast/server_i.h
new file mode 100644
index 00000000000..35844172cac
--- /dev/null
+++ b/TAO/orbsvcs/tests/IOR_MCast/server_i.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef SERVER_I_H
+#define SERVER_I_H
+
+#include "orbsvcs/IOR_Multicast.h"
+
+class Server_i
+{
+ // = TITLE
+ // Server_i
+ //
+ // = DESCRIPTION
+ // Helper class for the server implementation.
+
+public:
+ // = Constructor and destructor.
+ Server_i (void);
+ ~Server_i (void);
+
+ int init (int &argc, char **&argv ACE_ENV_ARG_DECL);
+ // Initialize the server multicast.
+
+private:
+
+ /// Sets the IOR_Multicast class to listen for multicast requests
+ // for this server.
+ int enable_multicast (const char *ior);
+
+ /// Parse the command line arguments.
+ int parse_args (int argc, char *argv[]);
+
+private:
+
+ int argc_;
+ // # of arguments on the command line.
+
+ char **argv_;
+ // arguments from command line.
+
+ CORBA::ORB_var orb_;
+ // ORB
+
+ TAO_IOR_Multicast *ior_multicast_;
+ // The ior_multicast event handler.
+
+ CORBA::String_var service_ior_;
+ // The IOR string of the service.
+
+ CORBA::String_var mcast_address_;
+ // Address of the multicast address where to listen for requests for */
+ // the server. */
+
+
+};
+
+#endif /* SERVER_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/Airplane.idl b/TAO/orbsvcs/tests/ImplRepo/Airplane.idl
new file mode 100644
index 00000000000..ecc38afa7c5
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/Airplane.idl
@@ -0,0 +1,7 @@
+// $Id$
+
+interface Paper_Airplane_Server
+{
+ string get_plane ();
+ // Returns the plane of the moment.
+};
diff --git a/TAO/orbsvcs/tests/ImplRepo/ImplRepo.mpc b/TAO/orbsvcs/tests/ImplRepo/ImplRepo.mpc
new file mode 100644
index 00000000000..848b239d9ee
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/ImplRepo.mpc
@@ -0,0 +1,90 @@
+// -*- MPC -*-
+// $Id$
+
+project(airplane_idl) : taoidldefaults {
+ IDL_Files {
+ Airplane.idl
+ }
+ custom_only = 1
+}
+
+
+project(airplane server) : portableserver, orbsvcsexe, minimum_corba, iortable, imr_client {
+ after += airplane_idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AirplaneC.cpp
+ AirplaneS.cpp
+ airplane_i.cpp
+ airplane_server_i.cpp
+ airplane_server.cpp
+ }
+}
+
+project(airplane client) : portableserver, orbsvcsexe, minimum_corba, iortable {
+ after += airplane_idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ AirplaneC.cpp
+ AirplaneS.cpp
+ airplane_client_i.cpp
+ airplane_client.cpp
+ }
+}
+
+project(nestea_idl): taoidldefaults {
+ IDL_Files {
+ Nestea.idl
+ }
+
+ custom_only = 1
+}
+
+project(nestea server) : portableserver, orbsvcsexe, minimum_corba, iortable, imr_client {
+ avoids += ace_for_tao
+ after += nestea_idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ NesteaC.cpp
+ NesteaS.cpp
+ nestea_i.cpp
+ nestea_server_i.cpp
+ nestea_server.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/nestea_server/
+ }
+}
+
+project(nestea client) : portableserver, orbsvcsexe, minimum_corba, iortable {
+ after += nestea_idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ NesteaC.cpp
+ NesteaS.cpp
+ nestea_client_i.cpp
+ nestea_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/nestea_client/
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/ImplRepo/Makefile.am b/TAO/orbsvcs/tests/ImplRepo/Makefile.am
new file mode 100644
index 00000000000..15e3b659ff7
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/Makefile.am
@@ -0,0 +1,210 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+SUBDIRS = \
+ . \
+ NameService \
+ scale
+
+noinst_PROGRAMS =
+
+## Makefile.airplane_idl.am
+
+BUILT_SOURCES = \
+ AirplaneC.cpp \
+ AirplaneC.h \
+ AirplaneC.inl \
+ AirplaneS.cpp \
+ AirplaneS.h \
+ AirplaneS.inl
+
+CLEANFILES = \
+ Airplane-stamp \
+ AirplaneC.cpp \
+ AirplaneC.h \
+ AirplaneC.inl \
+ AirplaneS.cpp \
+ AirplaneS.h \
+ AirplaneS.inl
+
+AirplaneC.cpp AirplaneC.h AirplaneC.inl AirplaneS.cpp AirplaneS.h AirplaneS.inl: Airplane-stamp
+
+Airplane-stamp: $(srcdir)/Airplane.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Airplane.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Airplane.idl
+
+## Makefile.airplane_client.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += airplane_client
+
+airplane_client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+airplane_client_SOURCES = \
+ AirplaneC.cpp \
+ AirplaneS.cpp \
+ airplane_client.cpp \
+ airplane_client_i.cpp \
+ airplane_client_i.h
+
+airplane_client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.airplane_server.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += airplane_server
+
+airplane_server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+airplane_server_SOURCES = \
+ AirplaneC.cpp \
+ AirplaneS.cpp \
+ airplane_i.cpp \
+ airplane_server.cpp \
+ airplane_server_i.cpp \
+ airplane_i.h \
+ airplane_server_i.h
+
+airplane_server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.nestea_idl.am
+
+BUILT_SOURCES += \
+ NesteaC.cpp \
+ NesteaC.h \
+ NesteaC.inl \
+ NesteaS.cpp \
+ NesteaS.h \
+ NesteaS.inl
+
+CLEANFILES += \
+ Nestea-stamp \
+ NesteaC.cpp \
+ NesteaC.h \
+ NesteaC.inl \
+ NesteaS.cpp \
+ NesteaS.h \
+ NesteaS.inl
+
+NesteaC.cpp NesteaC.h NesteaC.inl NesteaS.cpp NesteaS.h NesteaS.inl: Nestea-stamp
+
+Nestea-stamp: $(srcdir)/Nestea.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Nestea.idl
+ @touch $@
+
+
+noinst_HEADERS += \
+ Nestea.idl
+
+## Makefile.nestea_client.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += nestea_client
+
+nestea_client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+nestea_client_SOURCES = \
+ NesteaC.cpp \
+ NesteaS.cpp \
+ nestea_client.cpp \
+ nestea_client_i.cpp \
+ nestea_client_i.h
+
+nestea_client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.nestea_server.am
+
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += nestea_server
+
+nestea_server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+nestea_server_SOURCES = \
+ NesteaC.cpp \
+ NesteaS.cpp \
+ nestea_i.cpp \
+ nestea_server.cpp \
+ nestea_server_i.cpp \
+ nestea_i.h \
+ nestea_server_i.h
+
+nestea_server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/ImplRepo_NameService.mpc b/TAO/orbsvcs/tests/ImplRepo/NameService/ImplRepo_NameService.mpc
new file mode 100644
index 00000000000..fe939b060c5
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/NameService/ImplRepo_NameService.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project: namingexe, minimum_corba {
+}
+
diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/Makefile.am b/TAO/orbsvcs/tests/ImplRepo/NameService/Makefile.am
new file mode 100644
index 00000000000..038d3a8f254
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/NameService/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.ImplRepo_NameService.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = test
+
+test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+test_SOURCES = \
+ test.cpp
+
+test_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/README b/TAO/orbsvcs/tests/ImplRepo/NameService/README
new file mode 100644
index 00000000000..b89a2d8e93d
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/NameService/README
@@ -0,0 +1,3 @@
+================================================================================
+Soon there will be a test to show off how the Implementation Repository can
+automatically activate the NameService and other common services.
diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
new file mode 100755
index 00000000000..e8e91200bb0
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
@@ -0,0 +1,139 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+################################################################################
+# Program locations
+
+$imr_ior = PerlACE::LocalFile ("imr.ior");
+$name_ior = PerlACE::LocalFile ("name.ior");
+$activator_ior = PerlACE::LocalFile("activator.ior");
+
+$IMR = new PerlACE::Process ("../../../ImplRepo_Service/ImplRepo_Service");
+$ACTIVATOR = new PerlACE::Process("../../../ImplRepo_Service/ImR_Activator");
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service");
+$TAO_IMR = new PerlACE::Process ("../../../../../bin/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.
+
+$TAO_IMR->IgnoreExeSubDir (1);
+
+$TEST = new PerlACE::Process ("test");
+
+$imr_init_ref = "-ORBInitRef ImplRepoService=file://$imr_ior";
+
+################################################################################
+
+$errors = 0;
+
+unlink $imr_ior;
+unlink $name_ior;
+unlink $activator_ior;
+
+################################################################################
+## Start the implementation Repository
+
+$IMR->Arguments ("-o $imr_ior -d 2");
+$IMR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($imr_ior, 10) == -1) {
+ print STDERR "ERROR: waiting for $imr_ior\n";
+ $IMR->Kill ();
+ exit 1;
+}
+
+$ACTIVATOR->Arguments("-d 1 -o $activator_ior $imr_init_ref");
+$ACTIVATOR->Spawn();
+
+if (PerlACE::waitforfile_timed ($activator_ior, 10) == -1) {
+ print STDERR "ERROR: waiting for $activator_ior\n";
+ $IMR->Kill ();
+ $ACTIVATOR->Kill();
+ exit 1;
+}
+
+################################################################################
+## Register the NameService
+
+$TAO_IMR->Arguments("$imr_init_ref"
+ . " add NameService "
+ ." -c \"" . $NS->Executable ()
+ ." $imr_init_ref"
+ ." -ORBUseIMR 1 .\"");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (60);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (add) returned $taoimr\n";
+ ++$errors;
+}
+
+################################################################################
+## Create IOR for NameService
+
+$TAO_IMR->Arguments ("$imr_init_ref ior NameService -f $name_ior");
+
+
+$taoimr = $TAO_IMR->SpawnWaitKill (60);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (ior) returned $taoimr\n";
+ ++$errors;
+}
+
+################################################################################
+## Run the test
+
+$TEST->Arguments ("-ORBInitRef NameService=file://$name_ior");
+
+$test = $TEST->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ ++$errors;
+}
+
+
+################################################################################
+## Shutdown the NameService
+
+$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$imr_ior shutdown "
+ . "NameService ");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (60);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (shutdown) returned $taoimr\n";
+ ++$errors;
+}
+
+################################################################################
+## Kill the IMR
+
+$iserver = $ACTIVATOR->TerminateWaitKill (5);
+
+if ($iserver != 0) {
+ print STDERR "ERROR: ImR_Activator returned $iserver\n";
+ ++$errors;
+}
+
+$iserver = $IMR->TerminateWaitKill (5);
+
+if ($iserver != 0) {
+ print STDERR "ERROR: IMR returned $iserver\n";
+ ++$errors;
+}
+
+unlink $imr_ior;
+unlink $name_ior;
+unlink $activator_ior;
+
+exit $errors;
diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp b/TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp
new file mode 100644
index 00000000000..b885f1b28ed
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/NameService/test.cpp
@@ -0,0 +1,52 @@
+//
+// $Id$
+//
+
+#include "orbsvcs/CosNamingC.h"
+
+#include "ace/Log_Msg.h"
+
+int main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var ns_obj =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (ns_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Naming Service"),
+ 1);
+
+ CosNaming::NamingContext_var inc =
+ CosNaming::NamingContext::_narrow (ns_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (inc.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve Naming Service"),
+ 1);
+
+ CosNaming::Name name;
+ name.length (1);
+ name[0].id = CORBA::string_dup ("yourself");
+
+ inc->bind (name, ns_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Test Successful\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Test");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/Nestea.idl b/TAO/orbsvcs/tests/ImplRepo/Nestea.idl
new file mode 100644
index 00000000000..b101254bfe4
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/Nestea.idl
@@ -0,0 +1,19 @@
+// $Id$
+
+// Just implements a nice little Nestea server
+interface Nestea_Bookshelf
+{
+ void drink (in long cans);
+ // Add a number of cans to the bookshelf.
+
+ void crush (in long cans);
+ // Crush some of those cans.
+
+ long bookshelf_size ();
+ // How many cans are in the collection?
+
+ string get_praise ();
+ // What does the server think of your collection?
+
+ oneway void shutdown();
+};
diff --git a/TAO/orbsvcs/tests/ImplRepo/README b/TAO/orbsvcs/tests/ImplRepo/README
new file mode 100644
index 00000000000..82647bcdb19
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/README
@@ -0,0 +1,75 @@
+$Id$
+
+Here are a few tests for the ImplRepo. The best way to test is to
+use the run_test.pl passing it one of the following arguments:
+
+airplane runs airplane client and server without ImplRepo.
+airplane_ir same as above but uses ImplRepo.
+nt_service_ir same as above but runs ImplRepo as an NT service.
+nestea runs nestea client and server without ImplRepo.
+nestea_ir same as above but uses ImplRepo.
+both_ir combines airplane_ir and nestea_ir.
+persistent_ir same as airplane_ir, but using persistent ImplRepo.
+
+The nt_service_ir test will work only on Win32 platforms. For the test to
+run successfully, these conditions must be met:
+
+-- The user must be logged in as administrator, or have administrative
+ priveleges (in order to register an NT service).
+
+-- ACE_ROOT must be set to the ACE_wrappers directory in the system
+ environment.
+
+-- ACE_ROOT/bin must be in the system path.
+
+How to use NT ImR Services
+==================================
+
+The first step is to install one or both ImplRepo applications as NT
+services. To do this run:
+
+ImplRepo_Service -c install
+ImR_Activator -c install
+
+If you want to reinstall or change the installed settings then you
+must first use:
+
+ImplRepo_Service -c remove
+ImR_Activator -c remove
+
+Any extra command line options, will be saved in the Windows registry,
+and used when the service is actually started.
+
+In the following example I start the activator service, and then the
+ImplRepo itself on port 8888 using iiop. I also tell the activator to use
+xml as its persistence format, and to timeout unresponsive servers in 60 seconds.
+I disable debug output for both, as there seems to be no way to access it anyway.
+
+* copy the exe's to the same location as their dll's
+cd %ace_root%\lib
+copy %tao_root%\orbsvcs\ImplRepo_Service\*.exe .\
+
+* Register the services. (You may have to remove them first)
+ImR_Activator -c install -x activator.xml -t 60 -d 0 -orbinitref ImplRepoService=corbaloc::localhost:8888/ImplRepoService
+ImplRepo_Service -c install -d 0 -orbendpoint iiop://:8888
+
+* Start both services.
+net start taoimrlocator
+net start taoimractivator
+
+* Register a server
+cd %tao_root%\orbsvcs\tests\ImplRepo
+%tao_root%\orbsvcs\ImplRepo_service\tao_imr add airplane_server -orbuseimr 1 -orbinitref ImplRepoService=corbaloc::localhost:8888/ImplRepoService
+
+* Run the server
+airplane_server -o airplane.ior -orbuseimr 1 -orbinitref ImplRepoService=corbaloc::localhost:8888/ImplRepoService
+
+* Run the client
+airplane_client -k file://airplane.ior
+--or--
+airplane_client -k corbaloc::localhost:8888/airplane_server
+
+
+More information about the Implementation Repository can be found in
+TAO/docs.
+
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_client.cpp b/TAO/orbsvcs/tests/ImplRepo/airplane_client.cpp
new file mode 100644
index 00000000000..1bee519f70d
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_client.cpp
@@ -0,0 +1,24 @@
+// $Id$
+
+#include "airplane_client_i.h"
+
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (ImplRepo,
+ airplane_client,
+ "$Id$")
+
+// This function runs the test.
+
+int
+main (int argc, char **argv)
+{
+ Airplane_Client_i client;
+
+ ACE_DEBUG ((LM_DEBUG, "\n\tPaper Airplane Client\n\n"));
+
+ if (client.init (argc, argv) == -1)
+ return 1;
+ else
+ return client.run ();
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_client_i.cpp b/TAO/orbsvcs/tests/ImplRepo/airplane_client_i.cpp
new file mode 100644
index 00000000000..079c8e9b4e1
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_client_i.cpp
@@ -0,0 +1,146 @@
+// $Id$
+
+#include "airplane_client_i.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/ACE.h"
+
+ACE_RCSID(ImplRepo, airplane_client_i, "$Id$")
+
+// Constructor.
+Airplane_Client_i::Airplane_Client_i (void)
+ : server_key_ (ACE::strnew ("key0")),
+ loop_count_ (10),
+ server_ (Paper_Airplane_Server::_nil ())
+{
+}
+
+
+// Parses the command line arguments and returns an error status.
+
+int
+Airplane_Client_i::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "dn:k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case 'n': // loop count
+ this->loop_count_ = (u_int) ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'k': // ior provide on command line
+ this->server_key_ = ACE::strnew (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-n loopcount]"
+ " [-k server-obj-key]"
+ "\n",
+ this->argv_ [0]),
+ -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Retreives <count> paper airplanes from the server.
+
+void
+Airplane_Client_i::get_planes (size_t count)
+{
+ for (size_t i = 0; i < count; i++)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::String_var response =
+ this->server_->get_plane (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Plane %d is %s\n", i, response.in ()));
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR, "Plane %d exception:\n", i));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "get_planes");
+ }
+ ACE_ENDTRY;
+ }
+}
+
+
+// Execute client example code.
+
+int
+Airplane_Client_i::run ()
+{
+ this->get_planes (this->loop_count_);
+
+ return 0;
+}
+
+Airplane_Client_i::~Airplane_Client_i (void)
+{
+ // Free resources
+ CORBA::release (this->server_);
+
+ delete [] this->server_key_;
+}
+
+
+int
+Airplane_Client_i::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Retrieve the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "internet"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse command line and verify parameters.
+ if (this->parse_args () == -1)
+ return -1;
+
+ if (this->server_key_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: no server key specified\n",
+ this->argv_[0]),
+ -1);
+
+ CORBA::Object_var server_object =
+ this->orb_->string_to_object (this->server_key_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->server_ = Paper_Airplane_Server::_narrow (server_object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error: invalid server key <%s>\n", this->server_key_), -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Airplane_Client_i::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_client_i.h b/TAO/orbsvcs/tests/ImplRepo/airplane_client_i.h
new file mode 100644
index 00000000000..864c750fd67
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_client_i.h
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file airplane_client_i.h
+ *
+ * $Id$
+ *
+ * This class implements a simple CORBA client which returns a random
+ * paper airplane from the paper airplane server.
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#if !defined (AIRPLANE_CLIENT_I_H)
+#define AIRPLANE_CLIENT_I_H
+
+#include "AirplaneC.h"
+
+/**
+ * @class Airplane_Client_i
+ *
+ * @brief Paper Airplane Client Implementation
+ *
+ * Class wrapper for a client which gets the server IOR and then makes
+ * a couple of calls to the server.
+ */
+class Airplane_Client_i
+{
+public:
+ // = Constructor and destructor.
+ Airplane_Client_i (void);
+ ~Airplane_Client_i (void);
+
+ /// Execute client example code.
+ int run ();
+
+ /// Initialize the client communication endpoint with server.
+ int init (int argc, char **argv);
+
+private:
+ /// Parses the arguments passed on the command line.
+ int parse_args (void);
+
+ /// Ask the Paper Airplane Server for <count> planes.
+ void get_planes (size_t count);
+
+ /// # of arguments on the command line.
+ int argc_;
+
+ /// arguments from command line.
+ char **argv_;
+
+ /// Key of the obj ref of the server.
+ char *server_key_;
+
+ /// Number of airplanes to query for.
+ size_t loop_count_;
+
+ /// Server object ptr.
+ Paper_Airplane_Server_ptr server_;
+
+ /// Remember our orb.
+ CORBA::ORB_var orb_;
+};
+
+#endif /* AIRPLANE_CLIENT_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_i.cpp b/TAO/orbsvcs/tests/ImplRepo/airplane_i.cpp
new file mode 100644
index 00000000000..90f93c31e54
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_i.cpp
@@ -0,0 +1,91 @@
+// $Id$
+
+#include "airplane_i.h"
+
+#include "tao/debug.h"
+#include "ace/OS_NS_time.h"
+
+ACE_RCSID (ImplRepo,
+ airplane_i,
+ "$Id$")
+
+// Constructor
+
+ Airplane_i::Airplane_i ()
+{
+ // Seed the random number generator
+ ACE_OS::srand (ACE_OS::time (0L));
+}
+
+
+// Destructor
+
+Airplane_i::~Airplane_i (void)
+{
+ // Nothing
+}
+
+
+// Returns a random plane and page number
+
+char *
+Airplane_i::get_plane (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Airplane_i::get_plane\n"));
+
+ switch (ACE_OS::rand () % 24)
+ {
+ case 0:
+ return CORBA::string_dup ("Seagull, page 2");
+ case 1:
+ return CORBA::string_dup ("Albatross, page 7");
+ case 2:
+ return CORBA::string_dup ("Owl, page 13");
+ case 3:
+ return CORBA::string_dup ("Falcon, page 19");
+ case 4:
+ return CORBA::string_dup ("Sparrow, page 24");
+ case 5:
+ return CORBA::string_dup ("Condor, page 31");
+ case 6:
+ return CORBA::string_dup ("Basic wing-flapper, page 36");
+ case 7:
+ return CORBA::string_dup ("Butterfly, page 42");
+ case 8:
+ return CORBA::string_dup ("Moth, page 49");
+ case 9:
+ return CORBA::string_dup ("Bat, page 54");
+ case 10:
+ return CORBA::string_dup ("Wind rider, page 62");
+ case 11:
+ return CORBA::string_dup ("Bobber, page 67");
+ case 12:
+ return CORBA::string_dup ("Thunderbird, page 72");
+ case 13:
+ return CORBA::string_dup ("Oddbird, page 77");
+ case 14:
+ return CORBA::string_dup ("Another oddbird, page 81");
+ case 15:
+ return CORBA::string_dup ("Asymmetric plane, page 86");
+ case 16:
+ return CORBA::string_dup ("Flying spectacles, page 90");
+ case 17:
+ return CORBA::string_dup ("UFO, page 100");
+ case 18:
+ return CORBA::string_dup ("Space fighter #1, page 105");
+ case 19:
+ return CORBA::string_dup ("Space fighter #2, page 110");
+ case 20:
+ return CORBA::string_dup ("Pinwheel, page 120");
+ case 21:
+ return CORBA::string_dup ("Flying saucer, page 128");
+ case 22:
+ return CORBA::string_dup ("Flying teacup, page 134");
+ case 23:
+ return CORBA::string_dup ("Tumbler, page 138");
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_i.h b/TAO/orbsvcs/tests/ImplRepo/airplane_i.h
new file mode 100644
index 00000000000..10982838106
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_i.h
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file airplane_i.h
+ *
+ * $Id$
+ *
+ * This class implements a simple CORBA server which returns a random
+ * paper airplane from the book "Oddballs, Wing-Flappers, & Spinners:
+ * Great Paper Airplanes" by John Bringhurst. ISBN: 0-07-067910-X (pbk.)
+ * An excellent book to have! I personally recommend getting it just
+ * for the wing-flappers.
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#if !defined (AIRPLANE_I_H)
+#define AIRPLANE_I_H
+
+#include "AirplaneS.h"
+
+// Forward declarations.
+class Airplane_i;
+
+// Typedefs.
+typedef Airplane_i *Airplane_i_ptr;
+typedef Airplane_i_ptr Airplane_i_ref;
+
+/**
+ * @class Airplane_i:
+ *
+ * @brief Paper Airplane Server Implementation
+ *
+ * This server has one method that returns the featured paper airplane
+ * at this moment (in other words, a random airplane).
+ */
+class Airplane_i: public POA_Paper_Airplane_Server
+{
+public:
+ /// Constructor
+ Airplane_i ();
+
+ /// Destructor
+ ~Airplane_i (void);
+
+ /// Returns a random plane.
+ virtual char *get_plane (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+#endif /* AIRPLANE_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_server.cpp b/TAO/orbsvcs/tests/ImplRepo/airplane_server.cpp
new file mode 100644
index 00000000000..45f4bd9bca3
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_server.cpp
@@ -0,0 +1,44 @@
+// $Id$
+
+#include "airplane_server_i.h"
+
+ACE_RCSID (ImplRepo,
+ airplane_server,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ Airplane_Server_i server;
+
+ ACE_DEBUG ((LM_DEBUG, "\n\tPaper Airplane Server\n\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int retval = server.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval == -1)
+ return -1;
+
+
+ retval = server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Paper Airplane Server says goodnight\n"));
+
+ return retval;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "System Exception");
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex, "User Exception");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp
new file mode 100644
index 00000000000..92ffd886c0f
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp
@@ -0,0 +1,227 @@
+// $Id$
+
+#include "airplane_server_i.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/ImR_Client/ImR_Client.h"
+#include "tao/debug.h"
+#include "tao/PortableServer/Root_POA.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID (ImplRepo,
+ airplane_server_i,
+ "$Id$")
+
+// The server name of the Aiprlane Server
+const char SERVER_NAME[] = "airplane_server";
+
+Airplane_Server_i::Airplane_Server_i (void)
+ : server_impl_ (0),
+ ior_output_file_ (0)
+{
+ // Nothing
+}
+
+int
+Airplane_Server_i::parse_args (void)
+{
+ ACE_Get_Opt get_opts (this->argc_, this->argv_, "do:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag.
+ TAO_debug_level++;
+ break;
+ case 'o': // output the IOR to a file.
+ this->ior_output_file_ = ACE_OS::fopen (get_opts.opt_arg (), "w");
+ if (this->ior_output_file_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ get_opts.opt_arg ()), -1);
+ break;
+ case '?': // display help for use of the server.
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-o] <ior_output_file>"
+ "\n",
+ argv_ [0]),
+ 1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+int
+Airplane_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL)
+{
+ // Since the Implementation Repository keys off of the POA name, we need
+ // to use the SERVER_NAME as the POA's name.
+ const char *poa_name = SERVER_NAME;
+
+ ACE_TRY
+ {
+ // Initialize the ORB
+ this->orb_ = CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Save pointers to the command line arguments
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ // Now check the arguments for our options
+ int retval = this->parse_args ();
+
+ if (retval != 0)
+ return retval;
+
+ // Get the POA from the ORB.
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (obj.in ()));
+
+ // Narrow the object to a POA.
+ root_poa_ = PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POA_Manager.
+ this->poa_manager_ = this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We now need to create a POA with the persistent and user_id policies,
+ // since they are need for use with the Implementation Repository.
+
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->airplane_poa_ =
+ this->root_poa_->create_POA (poa_name,
+ this->poa_manager_.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of the new POA is over, so destroy the Policy_ptr's.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_NEW_RETURN (this->server_impl_, Airplane_i, -1);
+
+ PortableServer::ObjectId_var server_id =
+ PortableServer::string_to_ObjectId ("server");
+
+ this->airplane_poa_->activate_object_with_id (server_id.in (),
+ this->server_impl_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj = this->airplane_poa_->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::String_var ior =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "The ImRified IOR is: <%s>\n", ior.in ()));
+
+ TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(airplane_poa_.in());
+ obj = tmp_poa->id_to_reference_i (server_id.in (), false ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::String_var plain_ior =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "The plain IOR is: <%s>\n", plain_ior.in ()));
+
+ // Note : The IORTable will only be used for those clients who try to
+ // invoke indirectly using a simple object_key reference
+ // like "corbaloc::localhost:8888/airplane_server".
+ obj = this->orb_->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (adapter.in ()));
+ adapter->bind (poa_name, plain_ior.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->poa_manager_->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->ior_output_file_)
+ {
+ ACE_OS::fprintf (this->ior_output_file_, "%s", ior.in ());
+ ACE_OS::fclose (this->ior_output_file_);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Airplane_Server_i::init");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Airplane_Server_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ ACE_Time_Value tv(60);
+ ACE_Time_Value tvStart = ACE_OS::gettimeofday();
+
+ this->orb_->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Time_Value tvEnd = ACE_OS::gettimeofday();
+
+ this->root_poa_->destroy(1, 1);
+ this->orb_->destroy();
+
+ if (tvEnd - tvStart > tv - ACE_Time_Value(5))
+ return 1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Airplane_Server_i::run");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+Airplane_Server_i::~Airplane_Server_i (void)
+{
+ delete this->server_impl_;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h
new file mode 100644
index 00000000000..3b9a1b1131e
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file airplane_server_i.h
+ *
+ * $Id$
+ *
+ * Server that sets up the ORB and handles the registration and execution
+ * of the Paper Airplane Server.
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#if !defined (AIRPLANE_SERVER_I_H)
+#define AIRPLANE_SERVER_I_H
+
+#include "airplane_i.h"
+
+/**
+ * @class Airplane_Server_i
+ *
+ * @brief Paper Airplane Server Implementation Class
+ *
+ * Sets up everything necessary to get the Paper Airplane Server
+ * running.
+ */
+class Airplane_Server_i
+{
+public:
+ // = Initialization and termination methods.
+ /// Default constructor
+ Airplane_Server_i (void);
+
+ /// Destructor
+ ~Airplane_Server_i (void);
+
+ /// Initialize the Server state - parsing arguments and waiting
+ int init (int argc, char **argv ACE_ENV_ARG_DECL);
+
+ /// Run the orb
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// Parses the commandline arguments.
+ int parse_args (void);
+
+ /// Number of command line arguments.
+ int argc_;
+
+ /// The command line arguments.
+ char **argv_;
+
+ /// The ORB.
+ CORBA::ORB_var orb_;
+
+ PortableServer::POA_var root_poa_;
+
+ /// The POA for the Airplane Server.
+ PortableServer::POA_var airplane_poa_;
+
+ /// The POA manager.
+ PortableServer::POAManager_var poa_manager_;
+
+ /// The Paper Airplane Server Implementation.
+ Airplane_i *server_impl_;
+
+ /// File where the IOR of the server object is stored.
+ FILE *ior_output_file_;
+};
+
+#endif /* AIRPLANE_SERVER_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl
new file mode 100755
index 00000000000..9f570603f1f
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl
@@ -0,0 +1,188 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+################################################################################
+# Program locations
+
+$imr_locator_ior = PerlACE::LocalFile ("imr_locator.ior");
+$pfile = PerlACE::LocalFile ("persistence.dat");
+
+$IMR_LOCATOR = new PerlACE::Process ("../../../ImplRepo_Service/ImplRepo_Service");
+$TAO_IMR = new PerlACE::Process ("../../../../../bin/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.
+
+$TAO_IMR->IgnoreExeSubDir (1);
+
+################################################################################
+
+$errors = 0;
+
+unlink $imr_locator_ior;
+unlink $pfile;
+
+################################################################################
+## Start the implementation Repository Locator
+
+$IMR_LOCATOR->Arguments ("-p $pfile -o $imr_locator_ior -d 2");
+$IMR_LOCATOR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($imr_locator_ior, 20) == -1) {
+ print STDERR "ERROR: waiting for $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ exit 1;
+}
+
+################################################################################
+## Test out commands on the IMR
+
+print "===== Adding a server\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " add Foo -c foobarbaz");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (add) returned $taoimr\n";
+ ++$errors;
+}
+
+print "===== Updating a server\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " update Foo -w foodir" );
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (update) returned $taoimr\n";
+ ++$errors;
+}
+
+print "===== Removing a server\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " remove Foo");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (remove) returned $taoimr\n";
+ ++$errors;
+}
+
+print "===== Re-adding a server\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " add Foo -c foobarbaz");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (add) returned $taoimr\n";
+ ++$errors;
+}
+
+################################################################################
+## Kill the IMR
+print "===== Killing the ImR and restarting in locked mode.\n";
+
+$iserver = $IMR_LOCATOR->TerminateWaitKill (5);
+
+if ($iserver != 0) {
+ print STDERR "ERROR: IMR returned $iserver\n";
+ ++$errors;
+}
+
+unlink $imr_locator_ior;
+
+################################################################################
+## Restart the Implementation Repository in locked mode.
+
+$IMR_LOCATOR->Arguments ("-l -p $pfile -o $imr_locator_ior -d 2");
+$IMR_LOCATOR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: waiting for $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ exit 1;
+}
+
+################################################################################
+## Test out commands on the IMR
+
+print "===== Listing registered servers.\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " list");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+if ($taoimr != 0) {
+ print STDERR "ERROR: tao_imr (list) returned $taoimr\n";
+ ++$errors;
+}
+
+print "===== Adding a server (should fail)\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " add Foo2 -c foobarbaz");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+## Note : If you receive a 5 (NOT_FOUND) then it's likely that
+## persistence isn't working correctly.
+if ($taoimr != 2) { # NO_PERMISSION
+ print STDERR "ERROR: tao_imr (add) returned $taoimr\n";
+ ++$errors;
+}
+
+print "===== Updating a server (should fail)\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " update Foo -w foodir");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+if ($taoimr != 2) { # NO_PERMISSION
+ print STDERR "ERROR: tao_imr (update) returned $taoimr\n";
+ ++$errors;
+}
+
+print "===== Removing a server (should fail)\n";
+
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_locator_ior"
+ . " remove Foo");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (10);
+
+if ($taoimr != 2) { # NO_PERMISSION
+ print STDERR "ERROR: tao_imr (remove) returned $taoimr\n";
+ ++$errors;
+}
+
+################################################################################
+## Kill the IMR
+
+$iserver = $IMR_LOCATOR->TerminateWaitKill (5);
+
+if ($iserver != 0) {
+ print STDERR "ERROR: IMR returned $iserver\n";
+ ++$errors;
+}
+
+unlink $imr_locator_ior;
+
+unlink $pfile;
+
+exit $errors;
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_client.cpp b/TAO/orbsvcs/tests/ImplRepo/nestea_client.cpp
new file mode 100644
index 00000000000..60d05c63a82
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_client.cpp
@@ -0,0 +1,25 @@
+// $Id$
+
+#include "nestea_client_i.h"
+
+#include "ace/Log_Msg.h"
+
+ACE_RCSID (ImplRepo,
+ nestea_client,
+ "$Id$")
+
+// This function runs the test.
+
+int
+main (int argc, char **argv)
+{
+ Nestea_Client_i client;
+
+ ACE_DEBUG ((LM_DEBUG, "\n\tNestea Bookshelf Client\n\n"));
+
+ if (client.init (argc, argv) == -1)
+ return 1;
+ else
+ return client.run ();
+}
+
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_client_i.cpp b/TAO/orbsvcs/tests/ImplRepo/nestea_client_i.cpp
new file mode 100644
index 00000000000..a92bf39e6c8
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_client_i.cpp
@@ -0,0 +1,138 @@
+// $Id$
+
+#include "nestea_client_i.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/ACE.h"
+
+ACE_RCSID(ImplRepo, nestea_client_i, "$Id$")
+
+// Constructor.
+Nestea_Client_i::Nestea_Client_i (void)
+ : server_key_ (ACE::strnew ("key0"))
+ , server_ (Nestea_Bookshelf::_nil ())
+ , shutdown_server_(false)
+{
+}
+
+
+// Parses the command line arguments and returns an error status.
+
+int
+Nestea_Client_i::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "dsn:k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case 'k': // ior provide on command line
+ this->server_key_ = ACE::strnew (get_opts.opt_arg ());
+ break;
+ case 's': // shutdown server before exiting
+ this->shutdown_server_ = true;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-n loopcount]"
+ " [-s]"
+ " [-k server-object-key]"
+ "\n",
+ this->argv_ [0]),
+ -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Execute client example code.
+
+int
+Nestea_Client_i::run ()
+{
+ this->server_->drink (40);
+ this->server_->drink (100);
+
+ ACE_DEBUG ((LM_DEBUG, "Cans: %d\n"
+ "Praise: %s\n",
+ this->server_->bookshelf_size (),
+ this->server_->get_praise ()));
+
+ this->server_->drink (500);
+ this->server_->crush (200);
+
+ ACE_DEBUG ((LM_DEBUG, "Cans: %d\n"
+ "Praise: %s\n",
+ this->server_->bookshelf_size (),
+ this->server_->get_praise ()));
+
+ if (shutdown_server_)
+ server_->shutdown();
+
+ return 0;
+}
+
+Nestea_Client_i::~Nestea_Client_i (void)
+{
+ // Free resources
+ CORBA::release (this->server_);
+
+ delete [] this->server_key_;
+}
+
+
+int
+Nestea_Client_i::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Retrieve the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "internet"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse command line and verify parameters.
+ if (this->parse_args () == -1)
+ return -1;
+
+ if (this->server_key_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%s: no server key specified\n",
+ this->argv_[0]),
+ -1);
+
+ CORBA::Object_var server_object =
+ this->orb_->string_to_object (this->server_key_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->server_ = Nestea_Bookshelf::_narrow (server_object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Error: invalid server key <%s>\n", this->server_key_), -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Nestea_Client_i::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_client_i.h b/TAO/orbsvcs/tests/ImplRepo/nestea_client_i.h
new file mode 100644
index 00000000000..866641d1656
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_client_i.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file nestea_client_i.h
+ *
+ * $Id$
+ *
+ * This class implements a simple CORBA client which controls a Nestea
+ * can database
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#if !defined (NESTEA_CLIENT_I_H)
+#define NESTEA_CLIENT_I_H
+
+#include "NesteaC.h"
+
+/**
+ * @class Nestea_Client_i
+ *
+ * @brief Nestea Bookshelf Client Implementation
+ *
+ * Class wrapper for a client which gets the server IOR and then makes
+ * a couple of calls to the server.
+ */
+class Nestea_Client_i
+{
+public:
+ // = Constructor and destructor.
+ Nestea_Client_i (void);
+ ~Nestea_Client_i (void);
+
+ /// Execute client example code.
+ int run ();
+
+ /// Initialize the client communication endpoint with server.
+ int init (int argc, char **argv);
+
+private:
+ /// Parses the arguments passed on the command line.
+ int parse_args (void);
+
+ /// # of arguments on the command line.
+ int argc_;
+
+ /// arguments from command line.
+ char **argv_;
+
+ /// Key of the obj ref of the server.
+ char *server_key_;
+
+ /// Server object ptr.
+ Nestea_Bookshelf_ptr server_;
+
+ /// Remember our orb.
+ CORBA::ORB_var orb_;
+
+ bool shutdown_server_;
+};
+
+#endif /* NESTEA_CLIENT_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_i.cpp b/TAO/orbsvcs/tests/ImplRepo/nestea_i.cpp
new file mode 100644
index 00000000000..4706cf0304d
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_i.cpp
@@ -0,0 +1,166 @@
+// $Id$
+
+#include "nestea_i.h"
+#include "tao/debug.h"
+#include "ace/ACE.h"
+#include "ace/FILE_Addr.h"
+#include "ace/FILE_Connector.h"
+#include "ace/FILE_IO.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+const size_t MAX_UINT32_STR_LEN = 11; // Largest UINT32 is 8589934591 + NUL is 11 characters
+
+ACE_RCSID(ImplRepo, nestea_i, "$Id$")
+
+Nestea_i::Nestea_i (CORBA::ORB_ptr orb, const char *filename)
+: cans_ (0)
+{
+ orb_ = CORBA::ORB::_duplicate(orb);
+
+ this->data_filename_ = ACE::strnew (filename);
+
+ // @@ This should probably be called from somewhere else
+ this->load_data ();
+}
+
+
+Nestea_i::~Nestea_i (void)
+{
+ delete [] this->data_filename_;
+}
+
+
+// Add <cans> number of cans to the bookshelf.
+
+void
+Nestea_i::drink (CORBA::Long cans
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Nestea_i::drink %d cans\n", cans));
+
+ this->cans_ += cans;
+
+ this->save_data ();
+}
+
+
+// Removes <cans> number of cans from the bookshelf.
+
+void
+Nestea_i::crush (CORBA::Long cans
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Nestea_i::crush %d cans\n", cans));
+
+ if (static_cast<ACE_UINT32> (cans) > this->cans_)
+ this->cans_ = 0;
+ else
+ this->cans_ -= cans;
+
+ this->save_data ();
+}
+
+
+// Returns the number of cans in the bookshelf.
+
+CORBA::Long
+Nestea_i::bookshelf_size (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Nestea_i::bookshelf_size\n"));
+
+ return this->cans_;
+}
+
+// Returns comments about your collection.
+
+char *
+Nestea_i::get_praise (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Nestea_i::get_praise\n"));
+
+ if (this->cans_ > 500)
+ return CORBA::string_dup ("Man, that is one excellent Nestea Collection!");
+ else if (this->cans_ > 250)
+ return CORBA::string_dup ("We are getting into the big leagues now!");
+ else if (this->cans_ > 100)
+ return CORBA::string_dup ("Things are looking up!");
+ else if (this->cans_ > 0)
+ return CORBA::string_dup ("Well, it is a start. Drink more Nestea!");
+ else
+ return CORBA::string_dup ("No cans, no praise.");
+}
+
+void
+Nestea_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Nestea_i::shutdown\n"));
+
+ orb_->shutdown(0);
+}
+
+// Saves bookshelf data to a file.
+
+int
+Nestea_i::save_data (void)
+{
+ ACE_FILE_IO file;
+ ACE_FILE_Connector connector;
+
+ if (connector.connect (file,
+ ACE_FILE_Addr (this->data_filename_),
+ 0,
+ ACE_Addr::sap_any) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n to %s",
+ "connect",
+ this->data_filename_),
+ -1);
+
+ char str[MAX_UINT32_STR_LEN];
+
+ ACE_OS::sprintf (str, "%d", this->cans_);
+
+ return file.send_n (str, ACE_OS::strlen (str) + 1);
+}
+
+
+// Loads bookshelf data from a file.
+
+int
+Nestea_i::load_data (void)
+{
+ ACE_FILE_IO file;
+ ACE_FILE_Connector connector;
+
+ if (connector.connect (file,
+ ACE_FILE_Addr (this->data_filename_),
+ 0,
+ ACE_Addr::sap_any) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n to %s",
+ "connect",
+ this->data_filename_),
+ -1);
+
+ char str[MAX_UINT32_STR_LEN];
+
+ int len = file.recv (str, MAX_UINT32_STR_LEN);
+ str[len] = 0;
+
+ if (len > 0)
+ this->cans_ = ACE_OS::atoi (str);
+ else
+ this->cans_ = 0;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_i.h b/TAO/orbsvcs/tests/ImplRepo/nestea_i.h
new file mode 100644
index 00000000000..3e9aa019ff6
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_i.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file nestea_i.h
+ *
+ * $Id$
+ *
+ * This class is an implementation of the Nestea Bookshelf interface.
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#if !defined (NESTEA_I_H)
+#define NESTEA_I_H
+
+#include "NesteaS.h"
+
+// Forward declarations.
+class Nestea_i;
+
+// Typedefs.
+typedef Nestea_i *Nestea_i_ptr;
+typedef Nestea_i_ptr Nestea_i_ref;
+
+/**
+ * @class Nestea_i:
+ *
+ * @brief Nestea Bookshelf Implementation
+ *
+ * Implements the Nestea Bookshelf server, which keeps track of the
+ * number of nestea cans in a bookshelf. You can drink Nestea to add
+ * it to the bookshelf or crush the cans to remove them.
+ */
+class Nestea_i: public POA_Nestea_Bookshelf
+{
+public:
+ /// Constructor
+ Nestea_i (CORBA::ORB_ptr orb, const char *filename = "nestea.dat");
+
+ /// Destructor
+ virtual ~Nestea_i (void);
+
+ /// Add <cans> number of cans to the bookshelf.
+ virtual void drink (CORBA::Long cans
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Removes <cans> number of cans from the bookshelf.
+ virtual void crush (CORBA::Long cans
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns the number of cans in the bookshelf.
+ virtual CORBA::Long bookshelf_size (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Returns comments about your collection.
+ virtual char *get_praise (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown(ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+private:
+ /// Saves bookshelf data to a file.
+ int save_data (void);
+
+ /// Loads bookshelf data from a file.
+ int load_data (void);
+
+ /// The name of the file to store the data in.
+ char *data_filename_;
+
+ /// Number of cans in the bookshelf.
+ ACE_UINT32 cans_;
+
+ CORBA::ORB_var orb_;
+};
+
+#endif /* NESTEA_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_server.cpp b/TAO/orbsvcs/tests/ImplRepo/nestea_server.cpp
new file mode 100644
index 00000000000..51a8ec71ebe
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_server.cpp
@@ -0,0 +1,43 @@
+// $Id$
+
+#include "nestea_server_i.h"
+
+ACE_RCSID(ImplRepo, nestea_server, "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ Nestea_Server_i server;
+
+ ACE_DEBUG ((LM_DEBUG, "\n\tNestea Bookshelf Server\n\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ int retval = server.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval == -1)
+ return -1;
+ else
+ {
+ server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "System Exception");
+ return -1;
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex, "User Exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG, "Nestea Bookshelf Server says goodnight\n"));
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp
new file mode 100644
index 00000000000..f3278167081
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp
@@ -0,0 +1,239 @@
+// $Id$
+
+#include "nestea_server_i.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/ImR_Client/ImR_Client.h"
+#include "tao/debug.h"
+#include "tao/PortableServer/Root_POA.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID(ImplRepo, nestea_server_i, "$Id$")
+
+// The file to save the persistent state to.
+const char NESTEA_DATA_FILENAME[] = "nestea.dat";
+
+// The server name of the Nestea Server
+const char SERVER_NAME[] = "nestea_server";
+
+const int SELF_DESTRUCT_SECS = 8; // Must coordinate with run_test.pl
+
+Nestea_Server_i::Nestea_Server_i (const char * /*filename*/)
+ : server_impl_ (0),
+ ior_output_file_ (0)
+{
+ // Nothing
+}
+
+Nestea_Server_i::~Nestea_Server_i (void)
+{
+ delete this->server_impl_;
+}
+
+int
+Nestea_Server_i::parse_args (void)
+{
+ ACE_Get_Opt get_opts (this->argc_, this->argv_, "do:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag.
+ TAO_debug_level++;
+ break;
+ case 'o': // output the IOR to a file.
+ this->ior_output_file_ = ACE_OS::fopen (get_opts.opt_arg (), "w");
+ if (this->ior_output_file_ == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ get_opts.opt_arg ()), -1);
+ break;
+ case '?': // display help for use of the server.
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-r]"
+ " [-o] <ior_output_file>"
+ "\n",
+ argv_ [0]),
+ 1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+
+// The init() method does quite a few things.
+//
+// - Initialize the ORB
+// - Create a persistent POA for the server
+// - Activate the POA Manager
+// - Activate the servant under the POA
+// - Uses the IR helper class to alter the object
+// - Creates an IOR from the servant and outputs it to a file
+
+static void printEnvVars() {
+ char* useimr = ACE_OS::getenv("TAO_USE_IMR");
+ char* ior = ACE_OS::getenv("ImplRepoServiceIOR");
+ ACE_OS::printf("nestea_server: TAO_USE_IMR=%s\n", useimr != 0 ? useimr : "<null>");
+ ACE_OS::printf("nestea_server: ImplRepoServiceIOR=%s\n", ior != 0 ? ior : "<null>");
+}
+
+int
+Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL)
+{
+ printEnvVars();
+ // Since the Implementation Repository keys off of the POA name, we need
+ // to use the SERVER_NAME as the POA's name.
+ const char *poa_name = SERVER_NAME;
+
+ ACE_TRY
+ {
+ // Initialize the ORB
+ this->orb_ = CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Save pointers to the command line arguments
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ // Now check the arguments for our options
+ int retval = this->parse_args ();
+
+ if (retval != 0)
+ return retval;
+
+ // Get the POA from the ORB.
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (obj.in ()));
+
+ this->root_poa_ = PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->poa_manager_ = this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We now need to create a POA with the persistent and user_id policies,
+ // since they are need for use with the Implementation Repository.
+
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ policies[1] =
+ this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->nestea_poa_ =
+ this->root_poa_->create_POA (poa_name,
+ this->poa_manager_.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of the new POA is over, so destroy the Policy_ptr's.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_NEW_RETURN (this->server_impl_,
+ Nestea_i (orb_.in(), NESTEA_DATA_FILENAME),
+ -1);
+
+ PortableServer::ObjectId_var server_id =
+ PortableServer::string_to_ObjectId ("server");
+
+ this->nestea_poa_->activate_object_with_id (server_id.in (),
+ this->server_impl_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj = this->nestea_poa_->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::String_var ior =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "The IOR is: <%s>\n", ior.in ()));
+
+ TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(nestea_poa_.in());
+ obj = tmp_poa->id_to_reference_i (server_id.in (), false ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::String_var rawior =
+ this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj = this->orb_->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (adapter.in ()));
+
+ adapter->bind (poa_name, rawior.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->poa_manager_->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->ior_output_file_)
+ {
+ ACE_OS::fprintf (this->ior_output_file_, "%s", ior.in ());
+ ACE_OS::fclose (this->ior_output_file_);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Nestea_i::init");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Nestea_Server_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int status = 0;
+
+ ACE_TRY
+ {
+ ACE_Time_Value tv(SELF_DESTRUCT_SECS);
+
+ this->orb_->run (tv ACE_ENV_ARG_PARAMETER);
+
+ this->root_poa_->destroy(1, 1);
+ this->orb_->destroy();
+ }
+ ACE_CATCHANY
+ {
+ status = -1;
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Nestea_i::run");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.h b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.h
new file mode 100644
index 00000000000..ff3aee780de
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.h
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file nestea_server_i.h
+ *
+ * $Id$
+ *
+ * Server that sets up the ORB and handles the registration and execution
+ * of the Nestea Bookshelf Server.
+ *
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ */
+//=============================================================================
+
+
+#if !defined (NESTEA_SERVER_I_H)
+#define NESTEA_SERVER_I_H
+
+#include "nestea_i.h"
+
+/**
+ * @class Nestea_Server_i
+ *
+ * @brief Nestea Bookshelf Server Implementation Class
+ *
+ * Sets up everything necessary to get the Nestea Bookshelf Server
+ * running.
+ */
+class Nestea_Server_i
+{
+public:
+ // = Initialization and termination methods.
+ /// Default constructor
+ Nestea_Server_i (const char *filename = "nestea.dat");
+
+ /// Destructor
+ ~Nestea_Server_i (void);
+
+ /// Initialize the Server state - parsing arguments and waiting
+ int init (int argc, char **argv ACE_ENV_ARG_DECL);
+
+ /// Run the orb
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// Parses the commandline arguments.
+ int parse_args (void);
+
+ /// Number of command line arguments.
+ int argc_;
+
+ /// The command line arguments.
+ char **argv_;
+
+ CORBA::ORB_var orb_;
+
+ PortableServer::POA_var root_poa_;
+
+ /// The POA for the Nestea Server.
+ PortableServer::POA_var nestea_poa_;
+
+ /// The POA manager.
+ PortableServer::POAManager_var poa_manager_;
+
+ /// The Nestea Bookshelf Server Implementation.
+ Nestea_i *server_impl_;
+
+ /// File where the IOR of the server object is stored.
+ FILE *ior_output_file_;
+};
+
+#endif /* NESTEA_SERVER_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
new file mode 100755
index 00000000000..db82e5938fa
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
@@ -0,0 +1,1001 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+###############################################################################
+
+use strict;
+
+use lib "../../../../bin";
+use PerlACE::Run_Test;
+use Cwd;
+use Sys::Hostname;
+use File::Copy;
+
+my $cwd = getcwd();
+
+my $ACE_ROOT = $ENV{ACE_ROOT};
+
+if (!defined $ACE_ROOT) {
+ chdir ('../../../../');
+ $ACE_ROOT = getcwd ();
+ chdir ($cwd);
+ print "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT\n";
+}
+
+my $airplane_ior = PerlACE::LocalFile ("airplane.ior");
+my $nestea_ior = PerlACE::LocalFile ("nestea.ior");
+my $imr_activator_ior = PerlACE::LocalFile ("imr_activator.ior");
+my $imr_locator_ior = PerlACE::LocalFile ("imr_locator.ior");
+
+my $refstyle = " -ORBObjRefStyle URL";
+
+my $backing_store = "imr_backing_store.xml";
+my $P_SVR = new PerlACE::Process (PerlACE::LocalFile("persist server"));
+my $nestea_dat = "nestea.dat";
+
+my $protocol = "iiop";
+my $host = hostname();
+my $port = 12345;
+my $endpoint = "-ORBEndpoint " . "$protocol" . "://:" . $port;
+
+
+my $IMR_LOCATOR = new PerlACE::Process ("../../ImplRepo_Service/ImplRepo_Service");
+my $IMR_ACTIVATOR = new PerlACE::Process ("../../ImplRepo_Service/ImR_Activator");
+my $TAO_IMR = new PerlACE::Process("../../../../bin/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.
+
+$TAO_IMR->IgnoreExeSubDir (1);
+
+sub create_acli {
+ return new PerlACE::Process (PerlACE::LocalFile ("airplane_client"), " -k file://$airplane_ior");
+}
+
+sub create_ncli {
+ return new PerlACE::Process (PerlACE::LocalFile ("nestea_client"), " -k file://$nestea_ior");
+}
+
+my $A_SVR = new PerlACE::Process (PerlACE::LocalFile ("airplane_server"));
+my $A_CLI = create_acli();
+my $N_SVR = new PerlACE::Process (PerlACE::LocalFile ("nestea_server"));
+my $N_CLI = create_ncli();
+
+# Make sure the files are gone, so we can wait on them.
+unlink $airplane_ior;
+unlink $nestea_ior;
+unlink $imr_locator_ior;
+unlink $imr_activator_ior;
+unlink $backing_store;
+unlink $nestea_dat;
+unlink $P_SVR->Executable();
+
+
+
+# The Tests
+
+###############################################################################
+
+sub airplane_test
+{
+ my $status = 0;
+
+ $A_SVR->Arguments ("-o $airplane_ior $refstyle");
+ $A_SVR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $A_SVR->Kill ();
+ return 1;
+ }
+
+ my $client = $A_CLI->SpawnWaitKill (10);
+
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
+
+ my $server = $A_SVR->TerminateWaitKill (5);
+
+ if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+ }
+
+ return $status;
+}
+
+###############################################################################
+
+sub nestea_test
+{
+ my $status = 0;
+
+ $N_SVR->Arguments ("-o $nestea_ior $refstyle");
+ $N_SVR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $N_SVR->Kill ();
+ return 1;
+ }
+
+ my $client = $N_CLI->SpawnWaitKill (10);
+
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
+
+ my $server = $N_SVR->TerminateWaitKill (5);
+
+ if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+ }
+
+ return $status;
+}
+
+sub nt_service_test_i
+{
+ my ($imr_initref, $BIN_IMR_ACTIVATOR, $BIN_IMR_LOCATOR) = @_;
+
+ print "Installing TAO ImR Services\n";
+ $BIN_IMR_ACTIVATOR->Arguments ("-c install $imr_initref -d 0");
+ $BIN_IMR_LOCATOR->Arguments ("-c install -d 0 -orbendpoint iiop://:8888");
+
+ my $result = $BIN_IMR_LOCATOR->SpawnWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: IMR Locator installation returned $result\n";
+ return 1;
+ }
+
+ $result = $BIN_IMR_ACTIVATOR->SpawnWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: IMR Activator installation returned $result\n";
+ return 1;
+ }
+
+ # Starting the activator will also start the locator
+ print "Starting TAO Implementation Repository Services\n";
+ # Starting the activator should start the ImR automatically
+ #system("net start taoimr 2>&1");
+ system("net start taoimractivator 2>&1");
+
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TAO_IMR->Arguments ("$imr_initref add airplane_server -c \""
+ . $A_SVR->Executable() .
+ "\" -w \"$ACE_ROOT/lib\"");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr add airplane_server returned $result\n";
+ return 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref list -v");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr list -v returned $result\n";
+ return 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref ior airplane_server -f $airplane_ior");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr ior airplane_server returned $result\n";
+ return 1;
+ }
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $A_SVR->Kill ();
+ return 1;
+ }
+
+ $result = $A_CLI->SpawnWaitKill (20);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client returned $result\n";
+ return 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown airplane_server");
+ $result = $TAO_IMR->SpawnWaitKill (20);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr shutdown airplane_server returned $result\n";
+ return 1;
+ }
+
+ return 0;
+}
+
+sub nt_service_test
+{
+ my $result = 0;
+
+ # Just to show that it's possible, this test uses corbaloc instead of ior file.
+ my $imr_initref = "-orbinitref ImplRepoService=corbaloc::localhost:8888/ImplRepoService";
+
+ # To avoid having to ensure that they LocalSystem account has the correct path
+ # we simply copy the imr executables to the same directory as the DLL's.
+ my $BIN_IMR_LOCATOR = new PerlACE::Process ("$ACE_ROOT/lib/ImplRepo_Service","");
+ my $BIN_IMR_ACTIVATOR = new PerlACE::Process ("$ACE_ROOT/lib/ImR_Activator","");
+ $BIN_IMR_LOCATOR->IgnoreExeSubDir(1);
+ $BIN_IMR_ACTIVATOR->IgnoreExeSubDir(1);
+
+ print "Copying ImplRepo services to the same location as the dlls.\n";
+ unlink $BIN_IMR_LOCATOR->Executable ();
+ copy ($IMR_LOCATOR->Executable (), $BIN_IMR_LOCATOR->Executable ());
+ unlink $BIN_IMR_ACTIVATOR->Executable ();
+ copy ($IMR_ACTIVATOR->Executable (), $BIN_IMR_ACTIVATOR->Executable ());
+
+ print "Stopping any existing TAO ImR Services\n";
+ system("net stop taoimractivator > nul 2>&1");
+ system("net stop taoimr > nul 2>&1");
+
+ print "Removing any existing TAO ImR Services\n";
+ $BIN_IMR_ACTIVATOR->Arguments ("-c remove");
+ $BIN_IMR_LOCATOR->Arguments ("-c remove");
+ $BIN_IMR_ACTIVATOR->SpawnWaitKill (5);
+ $BIN_IMR_LOCATOR->SpawnWaitKill (5);
+
+ $result = nt_service_test_i ($imr_initref, $BIN_IMR_ACTIVATOR, $BIN_IMR_LOCATOR);
+
+ print "Stopping TAO Implementation Repository Service\n";
+ system("net stop taoimractivator 2>&1");
+ system("net stop taoimr 2>&1");
+
+ print "Removing TAO ImR Services\n";
+ $BIN_IMR_ACTIVATOR->Arguments ("-c remove");
+ $BIN_IMR_ACTIVATOR->SpawnWaitKill (5);
+ $BIN_IMR_LOCATOR->Arguments ("-c remove");
+ $BIN_IMR_LOCATOR->SpawnWaitKill (5);
+
+ print "Removing ImplRepo_Service copy.\n";
+ unlink $BIN_IMR_ACTIVATOR->Executable ();
+ unlink $BIN_IMR_LOCATOR->Executable ();
+
+ return $result;
+}
+
+###############################################################################
+
+sub airplane_ir_test
+{
+ my $status = 0;
+ my $result = 0;
+
+ my $imr_initref = "-ORBInitRef ImplRepoService=file://$imr_locator_ior";
+
+ $IMR_LOCATOR->Arguments ("-d 2 -o $imr_locator_ior");
+ $IMR_LOCATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $IMR_ACTIVATOR->Arguments ("-d 2 -o $imr_activator_ior $imr_initref");
+ $IMR_ACTIVATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_activator_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find $imr_activator_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ # Can use update to add servers.
+ $TAO_IMR->Arguments ("$imr_initref update airplane_server -c \""
+ . $A_SVR->Executable ()
+ . " -o $airplane_ior \"");
+
+ $result = $TAO_IMR->SpawnWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $A_SVR->Arguments ("-ORBUseIMR 1 -o $airplane_ior $imr_initref");
+ $A_SVR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ $A_SVR->Kill ();
+ return 1;
+ }
+
+ $result = $A_CLI->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane_client 1 returned $result\n";
+ $status = 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown airplane_server");
+
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 1 returned $result\n";
+ $status = 1;
+ }
+
+ # This client should force a new airplane_server to be started
+ $result = $A_CLI->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane_client 2 returned $result\n";
+ $status = 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 2 returned $result\n";
+ $status = 1;
+ }
+
+ my $server = $A_SVR->WaitKill (5);
+ if ($server != 0) {
+ print STDERR "ERROR: airplane server returned $server\n";
+ $status = 1;
+ }
+
+ my $imr_activator = $IMR_ACTIVATOR->TerminateWaitKill (5);
+ if ($imr_activator != 0) {
+ print STDERR "ERROR: Activator returned $imr_activator\n";
+ $status = 1;
+ }
+
+ my $imr_locator = $IMR_LOCATOR->TerminateWaitKill (5);
+ if ($imr_locator != 0) {
+ print STDERR "ERROR: ImR returned $imr_locator\n";
+ $status = 1;
+ }
+
+ return $status;
+}
+
+###############################################################################
+
+sub nestea_ir_test
+{
+ my $status = 0;
+ my $result = 0;
+
+ my $imr_initref = "-orbobjrefstyle URL -ORBInitRef ImplRepoService=file://$imr_locator_ior";
+
+ $IMR_LOCATOR->Arguments ("-d 2 -o $imr_locator_ior");
+ $IMR_LOCATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $IMR_ACTIVATOR->Arguments ("-d 2 -o $imr_activator_ior $imr_initref");
+ $IMR_ACTIVATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_activator_ior, 30) == -1) {
+ print STDERR "ERROR: cannot find $imr_activator_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $N_SVR->Arguments ("-ORBUseIMR 1 -o $nestea_ior $imr_initref");
+ $N_SVR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $N_SVR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $result = $N_CLI->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: nestea client 1 returned $result\n";
+ $status = 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown nestea_server");
+
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 1 returned $result\n";
+ $status = 1;
+ }
+
+ my $server = $N_SVR->WaitKill (5);
+ if ($server != 0) {
+ print STDERR "ERROR: nestea server returned $server\n";
+ $status = 1;
+ }
+
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TAO_IMR->Arguments ("$imr_initref update nestea_server -l $host -c \""
+ . $N_SVR->Executable ()
+ . " -o $nestea_ior\"");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ # This should cause the activator to spawn another server.
+ $result = $N_CLI->SpawnWaitKill (20);
+ if ($result != 0) {
+ print STDERR "ERROR: nestea client 2 returned $result\n";
+ $status = 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown nestea_server");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 1 returned $result\n";
+ $status = 1;
+ }
+
+ # This should destroy the POA, causing another to be created the next time
+ # the server is spawned.
+ $TAO_IMR->Arguments ("$imr_initref remove nestea_server");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 1 returned $result\n";
+ $status = 1;
+ }
+
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TAO_IMR->Arguments ("$imr_initref add nestea_server -c \""
+ . $N_SVR->Executable ()
+ . " -o $nestea_ior\"");
+
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ # This should cause the activator to spawn another server.
+ $result = $N_CLI->SpawnWaitKill (20);
+ if ($result != 0) {
+ print STDERR "ERROR: nestea client 2 returned $result\n";
+ $status = 1;
+ }
+
+ # This call should block until the server shuts down
+ $TAO_IMR->Arguments ("$imr_initref shutdown nestea_server");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 1 returned $result\n";
+ $status = 1;
+ }
+
+ my $implrepo = $IMR_ACTIVATOR->TerminateWaitKill (5);
+ if ($implrepo != 0) {
+ print STDERR "ERROR: IMR_Activator returned $implrepo\n";
+ $status = 1;
+ }
+
+ $implrepo = $IMR_LOCATOR->TerminateWaitKill (5);
+ if ($implrepo != 0) {
+ print STDERR "ERROR: IMR_Locator returned $implrepo\n";
+ $status = 1;
+ }
+
+ return $status;
+}
+
+###############################################################################
+
+sub perclient
+{
+ my $status = 0;
+ my $result = 0;
+
+ my $imr_initref = "-orbobjrefstyle URL -ORBInitRef ImplRepoService=file://$imr_locator_ior";
+
+ # specify an endpoint so that we can use corbaloc url for the client.
+ $IMR_LOCATOR->Arguments ("-d 2 -orbendpoint iiop://:8888 -o $imr_locator_ior");
+ $IMR_LOCATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $IMR_ACTIVATOR->Arguments ("-d 2 -o $imr_activator_ior $imr_initref");
+ $IMR_ACTIVATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_activator_ior, 30) == -1) {
+ print STDERR "ERROR: cannot find $imr_activator_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TAO_IMR->Arguments ("$imr_initref add nestea_server -a PER_CLIENT -c \""
+ . $N_SVR->Executable ()
+ . " -o $nestea_ior\"");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $N_CLI->Arguments("-k corbaloc::localhost:8888/nestea_server");
+
+ # Running the client should start a server instance
+ $result = $N_CLI->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: nestea client 1 returned $result\n";
+ $status = 1;
+ }
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ unlink $nestea_ior;
+
+ $N_CLI->Arguments("-s -k corbaloc::localhost:8888/nestea_server");
+
+ # Running the client again should start another server instance
+ $result = $N_CLI->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: nestea client 2 returned $result\n";
+ $status = 1;
+ }
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ # Note : We have to wait long enough for the first server to self-destruct
+ # or it will print out an exception when it can't notify the imr of its shutdown.
+ sleep 10;
+
+ my $implrepo = $IMR_ACTIVATOR->TerminateWaitKill (5);
+ if ($implrepo != 0) {
+ print STDERR "ERROR: IMR_Activator returned $implrepo\n";
+ $status = 1;
+ }
+
+ $implrepo = $IMR_LOCATOR->TerminateWaitKill (5);
+ if ($implrepo != 0) {
+ print STDERR "ERROR: IMR_Locator returned $implrepo\n";
+ $status = 1;
+ }
+
+ return $status;
+}
+
+###############################################################################
+
+sub shutdown_repo
+{
+ my $status = 0;
+ my $result = 0;
+
+ my $imr_initref = "-orbobjrefstyle URL -ORBInitRef ImplRepoService=file://$imr_locator_ior";
+
+ unlink "test.repo";
+
+ # Specify an endpoint so that we can restart on the same port.
+ # Specify persistence so that we can test that shutdown-repo -a works after reconnect
+ $IMR_LOCATOR->Arguments ("-p test.repo -d 1 -orbendpoint iiop://:8888 -o $imr_locator_ior");
+
+ unlink $imr_locator_ior;
+ $IMR_LOCATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $IMR_ACTIVATOR->Arguments ("-d 1 -o $imr_activator_ior $imr_initref");
+ $IMR_ACTIVATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_activator_ior, 30) == -1) {
+ print STDERR "ERROR: cannot find $imr_activator_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ # Kill the ImR, but leave the activator running
+ $TAO_IMR->Arguments ("$imr_initref shutdown-repo");
+ $result = $TAO_IMR->SpawnWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ my $imr_result = $IMR_LOCATOR->WaitKill (5);
+ if ($imr_result != 0) {
+ print STDERR "ERROR: ImR returned $imr_result\n";
+ return 1;
+ }
+
+ unlink $imr_locator_ior;
+ $IMR_LOCATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown-repo -a");
+ $result = $TAO_IMR->SpawnWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $imr_result = $IMR_ACTIVATOR->WaitKill (5);
+ if ($imr_result != 0) {
+ print STDERR "ERROR: IMR_Activator returned $imr_result\n";
+ return 1;
+ }
+
+ $imr_result = $IMR_LOCATOR->WaitKill (5);
+ if ($imr_result != 0) {
+ print STDERR "ERROR: IMR_Locator returned $imr_result\n";
+ return 1;
+ }
+
+ unlink "test.repo";
+
+ return $status;
+}
+
+###############################################################################
+
+sub persistent_ir_test
+{
+ my $result = 0;
+
+ my $imr_initref = "-ORBInitRef ImplRepoService=file://$imr_locator_ior";
+
+ unlink $imr_locator_ior;
+ ## Be sure to start the ImR on a consistent endpoint, so that any created IORs
+ ## remain valid even if the ImR restarts.
+ $IMR_LOCATOR->Arguments ("-orbendpoint iiop://:8888 -x $backing_store -d 2 -o $imr_locator_ior");
+ $IMR_LOCATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ unlink $imr_activator_ior;
+ $IMR_ACTIVATOR->Arguments ("-d 2 -o $imr_activator_ior $imr_initref");
+ $IMR_ACTIVATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_activator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_activator_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ unlink $P_SVR->Executable();
+ # Copy the server to a path with spaces to ensure that these
+ # work corrrectly.
+ copy ($A_SVR->Executable(), $P_SVR->Executable());
+ chmod(0755, $P_SVR->Executable());
+
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TAO_IMR->Arguments ("$imr_initref add airplane_server -c \""
+ . '\"' . $P_SVR->Executable() . '\"' . "\" " . $refstyle);
+ $result = $TAO_IMR->SpawnWaitKill (10);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ unlink $P_SVR->Executable();
+ return 1;
+ }
+
+ unlink $airplane_ior;
+ ## This will write out the imr-ified IOR. Note : If you don't use -orbendpoint
+ ## when starting the ImR, then this IOR will no longer be valid when the ImR
+ ## restarts below. You can fix this by creating a new valid IOR, or starting
+ ## the ImR on a consistent endpoint.
+ $A_SVR->Arguments ("-o $airplane_ior -ORBUseIMR 1 $refstyle $imr_initref");
+ $A_SVR->Spawn ();
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ $A_SVR->Kill ();
+ return 1;
+ }
+
+ $result = $A_CLI->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ $A_SVR->Kill ();
+ return 1;
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown airplane_server");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr shutdown returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ $A_SVR->Kill ();
+ return 1;
+ }
+
+ $result = $A_SVR->WaitKill (1);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane server returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ # Should cause the activator to spawn another server.
+ $result = $A_CLI->SpawnWaitKill (20);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client 2 returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ # Shutdown airplane_server
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr shutdown 2 returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ my $implrepo = $IMR_LOCATOR->TerminateWaitKill (5);
+ if ($implrepo != 0) {
+ print STDERR "ERROR: IMR_Locator returned $implrepo\n";
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ # Unlink so that we can wait on them again to know the server started.
+ unlink $imr_locator_ior;
+ print "Restarting Implementation Repository.\n";
+ $IMR_LOCATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ # Should cause the activator to spawn another server.
+ $result = $A_CLI->SpawnWaitKill (20);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client 3 returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ # Shutdown airplane_server
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr shutdown 3 returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ $result = $IMR_ACTIVATOR->TerminateWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: IMR_Activator returned $result\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $result = $IMR_LOCATOR->TerminateWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: IMR_Locator returned $result\n";
+ return 1;
+ }
+
+ unlink $P_SVR->Executable();
+ unlink $imr_locator_ior;
+ unlink $imr_activator_ior;
+ unlink $airplane_ior;
+
+ return 0;
+}
+
+###############################################################################
+
+sub both_ir_test
+{
+ my $status = 0;
+
+ my $imr_initref = "-ORBInitRef ImplRepoService=file://$imr_locator_ior";
+
+ $IMR_LOCATOR->Arguments ("-d 2 -t 5 -o $imr_locator_ior $refstyle");
+ $IMR_LOCATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ $IMR_ACTIVATOR->Arguments ("-o $imr_activator_ior $imr_initref $refstyle -d 2");
+ $IMR_ACTIVATOR->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($imr_activator_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $imr_activator_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ ## Note : It's crucial NOT to write out an IOR file when the activator
+ ## starts the server, or at least to write out a different file name
+ ## than the IOR files we're using for the clients. Otherwise a client
+ ## may attempt to use a partially written file.
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TAO_IMR->Arguments ("$imr_initref add nestea_server -c \""
+ . $N_SVR->Executable ()
+ . " $refstyle\"");
+ $TAO_IMR->SpawnWaitKill (10);
+
+ # No need to specify imr_initref or -orbuseimr 1 for servers spawned by activator
+ $TAO_IMR->Arguments ("$imr_initref add airplane_server -c \""
+ . $A_SVR->Executable ()
+ . " $refstyle\"");
+ $TAO_IMR->SpawnWaitKill (10);
+
+ $N_SVR->Arguments (" -o $nestea_ior -ORBUseIMR 1 $imr_initref $refstyle");
+ $N_SVR->Spawn ();
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ $A_SVR->Kill ();
+ $N_SVR->Kill ();
+ return 1;
+ }
+
+ $A_SVR->Arguments (" -o $airplane_ior -ORBUseIMR 1 $imr_initref $refstyle");
+ $A_SVR->Spawn ();
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ $A_SVR->Kill ();
+ $N_SVR->Kill ();
+ return 1;
+ }
+
+ my @clients;
+
+ for (1 .. 5) {
+ push @clients, &create_acli();
+ push @clients, &create_ncli();
+ }
+
+ print "\n## Spawning multiple simultaneous clients with both servers running.\n";
+ map $_->Spawn(), @clients;
+ map $_->WaitKill(30), @clients;
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown nestea_server");
+ $TAO_IMR->SpawnWaitKill (15);
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown airplane_server");
+ $TAO_IMR->SpawnWaitKill (15);
+
+ $A_SVR->WaitKill(1);
+ $N_SVR->WaitKill(1);
+
+ print "\n\n\n\n## Spawning multiple simultaneous clients with no servers running.\n";
+
+ map $_->Spawn(), @clients;
+ map $_->WaitKill(30), @clients;
+
+ $TAO_IMR->Arguments ("$imr_initref shutdown nestea_server");
+ $TAO_IMR->SpawnWaitKill (15);
+ $TAO_IMR->Arguments ("$imr_initref shutdown airplane_server");
+ $TAO_IMR->SpawnWaitKill (15);
+
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+}
+
+###############################################################################
+###############################################################################
+
+# Parse the arguments
+
+my $ret = 0;
+
+if ($#ARGV >= 0) {
+for (my $i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
+ print "run_test test\n";
+ print "\n";
+ print "test -- Runs a specific test:\n";
+ print " airplane, airplane_ir, nt_service_ir, ",
+ "nestea, nestea_ir,\n";
+ print " both_ir, persistent_ir\n";
+ exit 1;
+ }
+ elsif ($ARGV[$i] eq "airplane") {
+ $ret = airplane_test ();
+ }
+ elsif ($ARGV[$i] eq "airplane_ir") {
+ $ret = airplane_ir_test ();
+ }
+ elsif ($ARGV[$i] eq "nt_service_ir") {
+ $ret = nt_service_test ();
+ }
+ elsif ($ARGV[$i] eq "nestea") {
+ $ret = nestea_test ();
+ }
+ elsif ($ARGV[$i] eq "nestea_ir") {
+ $ret = nestea_ir_test ();
+ }
+ elsif ($ARGV[$i] eq "both_ir") {
+ $ret = both_ir_test ();
+ }
+ elsif ($ARGV[$i] eq "persistent_ir") {
+ $ret = persistent_ir_test ();
+ }
+ elsif ($ARGV[$i] eq "perclient") {
+ $ret = perclient();
+ }
+ elsif ($ARGV[$i] eq "shutdown") {
+ $ret = shutdown_repo();
+ }
+ else {
+ print "run_test: Unknown Option: ".$ARGV[$i]."\n";
+ }
+}
+} else {
+ $ret = both_ir_test();
+}
+
+
+# Make sure the files are gone, so we can wait on them.
+unlink $airplane_ior;
+unlink $nestea_ior;
+unlink $imr_locator_ior;
+unlink $imr_activator_ior;
+unlink $backing_store;
+unlink $nestea_dat;
+unlink $P_SVR->Executable();
+
+exit $ret;
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/Makefile.am b/TAO/orbsvcs/tests/ImplRepo/scale/Makefile.am
new file mode 100644
index 00000000000..7b336b7db96
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/Makefile.am
@@ -0,0 +1,112 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.scaletest_idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.scaletest_client.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ client.cpp \
+ testC.cpp \
+ testS.cpp \
+ server_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.scaletest_server.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+server_SOURCES = \
+ server.cpp \
+ server_i.cpp \
+ testC.cpp \
+ testS.cpp \
+ server_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_ImR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/client.conf b/TAO/orbsvcs/tests/ImplRepo/scale/client.conf
new file mode 100644
index 00000000000..87e77efbd29
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/client.conf
@@ -0,0 +1,4 @@
+# This file is here just in case you want to run some of the tests manually
+# and don't want the client to jump back in the reactor during the
+# invocation.
+static Client_Strategy_Factory "-ORBClientConnectionHandler rw"
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/client.cpp b/TAO/orbsvcs/tests/ImplRepo/scale/client.cpp
new file mode 100644
index 00000000000..f5e1e660533
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/client.cpp
@@ -0,0 +1,41 @@
+// $Id$
+// This is a simple test of an ImR using the corba interfaces
+// Start with -orbinitref Test=...
+
+#include "testC.h"
+#include "ace/Log_Msg.h"
+
+using namespace CORBA;
+
+int main(int argc, char* argv[]) {
+
+ ACE_TRY_NEW_ENV
+ {
+
+ ORB_var orb = ORB_init(argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Object_var obj = orb->resolve_initial_references("Test" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ test_var test = test::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! is_nil(test.in()));
+
+ Long n = test->get(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ Long m = test->get(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (m == n + 1)
+ ACE_DEBUG((LM_DEBUG, "Client: All tests ran successfully.\n"));
+ else
+ ACE_DEBUG((LM_DEBUG, "Error: Client Expected %d = %d + 1.\n", m, n));
+
+ return 0;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client:");
+ }
+ ACE_ENDTRY;
+ return -1;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/scale/run_test.pl
new file mode 100755
index 00000000000..ccbc5f6ba44
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/run_test.pl
@@ -0,0 +1,217 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+###############################################################################
+my $ACE_ROOT = $ENV{ACE_ROOT};
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+use Cwd;
+use Sys::Hostname;
+use File::Copy;
+
+use strict;
+
+my $cwd = getcwd();
+
+if (!defined $ACE_ROOT) {
+ print "Error: ACE_ROOT not defined.\n";
+ return 1;
+}
+
+my $imr_activator_ior = PerlACE::LocalFile ("imr_activator.ior");
+my $imr_locator_ior = PerlACE::LocalFile ("imr_locator.ior");
+
+my $refstyle = " -ORBobjrefstyle URL";
+
+my $persistxml = PerlACE::LocalFile ("persist.xml");
+my $persist = PerlACE::LocalFile ("persist.dat");
+
+my $IMR_LOCATOR = new PerlACE::Process ("$ACE_ROOT/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service");
+my $IMR_ACTIVATOR = new PerlACE::Process ("$ACE_ROOT/TAO/orbsvcs/ImplRepo_Service/ImR_Activator");
+my $TAO_IMR = new PerlACE::Process("$ACE_ROOT/bin/tao_imr");
+
+my $SVR = new PerlACE::Process (PerlACE::LocalFile ("server"));
+my $CLI = new PerlACE::Process (PerlACE::LocalFile ("client"));
+
+my $servers_count = 1;
+my $obj_count = 1;
+my $use_activator = 0;
+
+my $objprefix = "TstObj";
+my $client_wait_time = 5;
+
+# Make sure the files are gone, so we can wait on them.
+unlink $imr_locator_ior;
+unlink $imr_activator_ior;
+unlink $persistxml;
+unlink $persist;
+
+sub scale_test
+{
+ print "Running scale test with $servers_count servers and $obj_count objects.\n";
+
+ my $status = 0;
+ my $result = 0;
+ my $start_time = time();
+
+ my $imr_initref = "-ORBInitRef ImplRepoService=file://$imr_locator_ior";
+
+ $IMR_LOCATOR->Arguments ("-d 1 -o $imr_locator_ior -orbendpoint iiop://:9876");
+ $IMR_LOCATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_locator_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find $imr_locator_ior\n";
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+
+ if ($use_activator) {
+
+ $IMR_ACTIVATOR->Arguments ("-d 1 -o $imr_activator_ior $imr_initref");
+ $IMR_ACTIVATOR->Spawn ();
+ if (PerlACE::waitforfile_timed ($imr_activator_ior, 5) == -1) {
+ print STDERR "ERROR: cannot find $imr_activator_ior\n";
+ $IMR_ACTIVATOR->Kill ();
+ return 1;
+ }
+
+ for(my $i = 0; $i < $servers_count; $i++) {
+ for (my $j = 0; $j < $obj_count; $j++) {
+ $TAO_IMR->Arguments ("$imr_initref add $objprefix" . '_' . $i . "_" . $j . " -c \""
+ . $SVR->Executable ()
+ . " -ORBUseIMR 1 -p $objprefix" . '_' . "$i -c $obj_count $imr_initref\"");
+
+ $result = $TAO_IMR->SpawnWaitKill (5);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+ }
+ }
+
+ $TAO_IMR->Arguments ("$imr_initref list");
+ $result = $TAO_IMR->SpawnWaitKill (25);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr list returned $result\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ return 1;
+ }
+ }
+
+ for(my $i = 0; $i < $servers_count; $i++ ) {
+
+ my $server_start_file = PerlACE::LocalFile ($objprefix . "_$i.status");
+ unlink $server_start_file;
+
+ if (! $use_activator) {
+ $SVR->Arguments ("-ORBUseIMR 1 -p $objprefix" . '_' . "$i -c $obj_count $imr_initref");
+ $SVR->Spawn ();
+ if (PerlACE::waitforfile_timed ($server_start_file, 10) == -1) {
+ print STDERR "ERROR: cannot find $server_start_file\n";
+ $IMR_ACTIVATOR->Kill ();
+ $IMR_LOCATOR->Kill ();
+ $SVR->Kill ();
+ return 1;
+ }
+ } else {
+ # For some reason the servers take forever to spawn when using the activator
+ $client_wait_time *= $obj_count;
+ }
+ unlink $server_start_file;
+
+ for (my $j = 0; $j < $obj_count; $j++) {
+ $CLI->Arguments ("-orbinitref Test=corbaloc::localhost:9876/$objprefix" . '_' . $i . '_' . $j);
+ $result = $CLI->SpawnWaitKill ($client_wait_time);
+ if ($result != 0) {
+ print STDERR "ERROR: client returned $result\n";
+ $status = 1;
+ last;
+ }
+ }
+
+ # Shutting down any server object within the server will shutdown the whole server
+ $TAO_IMR->Arguments ("$imr_initref shutdown $objprefix" . '_' . $i . "_0");
+ $result = $TAO_IMR->SpawnWaitKill (10);
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr shutdown returned $result\n";
+ $status = 1;
+ last;
+ }
+ if (! $use_activator) {
+ $result = $SVR->WaitKill(5);
+ if ($result != 0) {
+ print STDERR "ERROR: server not shutdown correctly.\n";
+ $status = 1;
+ last;
+ }
+ }
+
+ if ($status == 1) {
+ last;
+ }
+ }
+
+ if ($use_activator) {
+ my $imr_activator = $IMR_ACTIVATOR->TerminateWaitKill (5);
+ if ($imr_activator != 0) {
+ print STDERR "ERROR: IMR returned $imr_activator\n";
+ $status = 1;
+ }
+ }
+
+ my $imr_locator = $IMR_LOCATOR->TerminateWaitKill (5);
+ if ($imr_locator != 0) {
+ print STDERR "ERROR: IMR returned $imr_locator\n";
+ $status = 1;
+ }
+
+ my $test_time = time() - $start_time;
+ my $total_objs = $obj_count * $servers_count;
+
+ print "\nFinished. The test took $test_time seconds for $total_objs imr-ified objects.\n";
+
+ return $status;
+}
+
+sub usage() {
+ print "Usage: run_test.pl [-servers <num=1>] [-objects <num=1>] [-use_activator]\n";
+}
+
+###############################################################################
+###############################################################################
+
+if ($#ARGV >= 0) {
+ for (my $i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-servers") {
+ $i++;
+ $servers_count = $ARGV[$i];
+ }
+ elsif ($ARGV[$i] eq "-objects") {
+ $i++;
+ $obj_count = $ARGV[$i];
+ }
+ elsif ($ARGV[$i] eq "-use_activator") {
+ $use_activator = 1;
+ }
+ else {
+ usage();
+ exit 1;
+ }
+ }
+}
+
+my $ret = scale_test();
+
+unlink $imr_locator_ior;
+unlink $imr_activator_ior;
+unlink $persistxml;
+unlink $persist;
+
+exit $ret;
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/scaletest.mpc b/TAO/orbsvcs/tests/ImplRepo/scale/scaletest.mpc
new file mode 100644
index 00000000000..5e8640bf068
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/scaletest.mpc
@@ -0,0 +1,35 @@
+// $Id$
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+
+ custom_only = 1
+}
+
+project(*server) : portableserver, orbsvcsexe, minimum_corba, iortable, imr_client {
+ after += *idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ testC.cpp
+ testS.cpp
+ server_i.cpp
+ server.cpp
+ }
+}
+
+project(*client) : portableserver, orbsvcsexe, minimum_corba, iortable {
+ after += *idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ testC.cpp
+ testS.cpp
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/server.cpp b/TAO/orbsvcs/tests/ImplRepo/scale/server.cpp
new file mode 100644
index 00000000000..769d8126ae4
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/server.cpp
@@ -0,0 +1,37 @@
+// $Id$
+
+#include "server_i.h"
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ Server_i server;
+
+ int retval = server.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval == -1)
+ return -1;
+ else
+ {
+ server.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "Server: System Exception");
+ return -1;
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex, "Server: User Exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp
new file mode 100644
index 00000000000..21edebb203f
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp
@@ -0,0 +1,230 @@
+// $Id$
+
+#include "server_i.h"
+
+#include "tao/IORTable/IORTable.h"
+#include "tao/PortableServer/Root_POA.h"
+#include "tao/ImR_Client/ImR_Client.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/streams.h"
+
+class test_i
+ : public virtual POA_test
+{
+ int n_;
+ CORBA::ORB_var orb_;
+public:
+ test_i (CORBA::ORB_ptr orb)
+ : n_(0)
+ , orb_(CORBA::ORB::_duplicate(orb))
+ {
+ }
+ virtual ~test_i () {
+ }
+ virtual CORBA::Long get (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) {
+ ++n_;
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ PortableServer::Current_var cur = PortableServer::Current::_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ ACE_ASSERT(! CORBA::is_nil(cur.in()));
+ PortableServer::POA_var poa = cur->get_POA(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ CORBA::String_var poaname = poa->the_name(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ ACE_DEBUG((LM_DEBUG, "%s: get() %d\n", poaname.in(), n_));
+ return n_;
+ }
+};
+
+// The server name of the Aiprlane Server
+static const char DEFAULT_SERVER_NAME[] = "TestObject";
+
+Server_i::Server_i (void)
+: server_name_(DEFAULT_SERVER_NAME)
+, count_(1)
+{
+}
+
+Server_i::~Server_i()
+{
+}
+
+int
+Server_i::parse_args (int argc, char* argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "p:c:h");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'p': // prefix for all created objects
+ this->server_name_ = get_opts.opt_arg ();
+ break;
+ case 'c': // Number of imr-ified objects to create.
+ this->count_ = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+ case '?': // display help for use of the server.
+ case 'h':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-c] <count=1> ImR-ified objects."
+ " [-p] <prefix=%s> To all ImR-ified object names."
+ "\n",
+ argv[0],
+ DEFAULT_SERVER_NAME),1);
+ }
+ }
+
+ return 0;
+}
+
+namespace
+{
+ ACE_CString toStr(int n)
+ {
+ char buf[20];
+ return ACE_OS::itoa(n, buf, 10);
+ }
+}
+
+int
+Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ this->orb_ = CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int retval = this->parse_args (argc, argv);
+ if (retval != 0)
+ return retval;
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ this->root_poa_ =
+ PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil(this->root_poa_.in()));
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj = this->orb_->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ IORTable::Table_var ior_table =
+ IORTable::Table::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil(ior_table.in()));
+
+ // If -orbuseimr 1 is specified then all persistent poas will be
+ // registered with the imr.
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+ policies[0] = this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policies[1] = this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ test_i* test_svt;
+ ACE_NEW_RETURN (test_svt, test_i(orb_.in()), -1);
+ PortableServer::ServantBase_var scoped_svt(test_svt);
+
+ PortableServer::ObjectId_var server_id =
+ PortableServer::string_to_ObjectId ("Test");
+
+ // Create count_ POAs, activate an object in each, and register the object with
+ // the IORTable.
+ for (int i = 0; i < this->count_; ++i)
+ {
+ ACE_CString name = this->server_name_ + "_" + toStr(i);
+
+ PortableServer::POA_var poa =
+ this->root_poa_->create_POA (name.c_str(),
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa->activate_object_with_id (server_id.in (), test_svt ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(poa.in());
+ obj = tmp_poa->id_to_reference_i (server_id.in (), false ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior = this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ior_table->bind (name.c_str(), ior.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ policies[0]->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ policies[1]->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Server_i::init");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Server_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // We have potentially lots of IORs, so just write out a simple text
+ // file that the run_test.pl can use to know we're done.
+ {
+ ACE_CString status = this->server_name_ + ACE_CString(".status");
+ ofstream out(status.c_str());
+ out << "started" << endl;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n Started Server %s with %d imr-ified objects.\n\n",
+ this->server_name_.c_str(),
+ this->count_));
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->root_poa_->destroy(1, 1);
+ this->orb_->destroy();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Server_i::run");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/server_i.h b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.h
new file mode 100644
index 00000000000..222b179634a
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.h
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+// $Id$
+
+#if !defined (SERVER_I_H)
+#define SERVER_I_H
+
+#include "testS.h"
+
+#include "ace/Auto_Ptr.h"
+#include "ace/SString.h"
+
+class Server_i
+{
+public:
+ Server_i (void);
+ ~Server_i (void);
+
+ int init (int argc, char **argv ACE_ENV_ARG_DECL);
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ int parse_args (int argc, char* argv[]);
+
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+
+ ACE_CString server_name_;
+ int count_;
+};
+
+#endif /* SERVER_I_H */
diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/test.idl b/TAO/orbsvcs/tests/ImplRepo/scale/test.idl
new file mode 100644
index 00000000000..9ff40e9c6a9
--- /dev/null
+++ b/TAO/orbsvcs/tests/ImplRepo/scale/test.idl
@@ -0,0 +1,4 @@
+// $Id$
+interface test {
+ long get();
+};
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/IFR_Application_Test.mpc b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/IFR_Application_Test.mpc
new file mode 100644
index 00000000000..3396f7a98fe
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/IFR_Application_Test.mpc
@@ -0,0 +1,21 @@
+// -*- MPC -*-
+// $Id$
+
+project(*server): taoexe, portableserver, ifr_client, minimum_corba {
+
+ Source_Files {
+ test_i.cpp
+ server.cpp
+ }
+}
+
+project(*client): taoexe, portableserver, ifr_client, dynamicinterface, minimum_corba {
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ ifr_dii_client.cpp
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/Makefile.am b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/Makefile.am
new file mode 100644
index 00000000000..7e6f5e5bdcf
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/Makefile.am
@@ -0,0 +1,115 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.IFR_Application_Test_Client.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ client.cpp \
+ ifr_dii_client.cpp \
+ ifr_dii_client.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.IFR_Application_Test_Server.am
+
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) $(srcdir)/test.idl
+ @touch $@
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+server_SOURCES = \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ testC.h \
+ testC.inl \
+ testS.h \
+ testS.inl \
+ test_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/README b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/README
new file mode 100644
index 00000000000..113da0997f8
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/README
@@ -0,0 +1,111 @@
+$Id$
+
+The test in this directory utilizes the Interface Repository
+as might be done in an application. This test is also the
+only one in this suite that makes use of the Interface
+Repository administration executable 'tao_ifr'.
+
+The test must be run by executing the Perl scrip 'run_test.pl'.
+The order of events is as follows:
+
+(1) The Interface Repository service is started.
+
+(2) The server proces is started. The server makes
+ available an object reference to an interface
+ called 'inventory', which exists in a namespace
+ called 'warehouse', and contains an operation
+ called 'getCDinfo'. The operation takes an IN
+ argument which is a string representing the
+ artist's name, and INOUT argument which is a
+ string representing the album title, and an OUT
+ argument which is a float representing the price.
+ The operation returns a boolean value indicating
+ whether or not the particular CD is in stock. All
+ this iformation is contained in the IDL file
+ 'test.idl'.
+
+(3) The Interface Repository administration executable
+ 'tao_ifr' is executed on test.idl, which adds the
+ information in test.idl to the repository.
+
+(4) The client process is started. The client performs
+ the following actions:
+
+ (a) Locates the Interface Repository by calling
+ resolve_initial_references ("InterfaceRepository"),
+ and narrowing.
+
+ (b) Gets the IOR of the target object. In a real
+ application, this would probably be done
+ through the Naming Service, but here the
+ IOR is read from the file where it was
+ stored by the server.
+
+ (c) The client then makes several calls to the
+ repository, first searching for an object
+ with the name 'warehouse'. Once this is
+ found, the client checks to see if 'warehouse'
+ may contain other objects. If so, it gets a
+ list of all the objects 'contained' by
+ warehouse which are interfaces. Each inteface's
+ name is checked to find one called 'inventory'.
+ Then the client gets a list of all inventory's
+ operations. Each of these is checked to find
+ one called 'getCDinfo'. The client then gets
+ the return type and a list of the operation's
+ parameters by querying the operation repository
+ object.
+
+ (d) The client creates a DII request pseudo-object,
+ sets its return type and adds parameters
+ according to the information extracted from
+ the operation repository object. Notice that
+ the client does not have the correct string for
+ the album title, but one that is commonly used
+ by people when referring to that album. The
+ server will try to be smart about this, and
+ match a substring of the given album title with
+ a substring of the real album title, returning
+ the corrected album title if it finds a match.
+
+ (e) The client invokes the DII request and displays
+ the results.
+
+(5) The server is shut down.
+
+(6) tao_ifr is again invoked on test.idl, this time with
+ the '-r' option, which removes the objects coresponding
+ to the contents of the IDL file from the repository.
+
+(7) The repository is shut down.
+
+By default, the client will call _get_interface() on the target
+object to get its InterfaceDef from the respository, and then
+query the IntefaceDef object to get information about its
+operations and their parameters. If the command line option -n
+is passed to the client (or to the Perl script), the client will
+resolve the repository by a call to
+orb->resolve_initial_references ("InterfaceRepository") and use
+information it has (through some unspecified means) about the
+local name of the interface and of its containing module,
+to search the repository for the InterfaceDef of the target object,
+and from there acquire the rest of the information the same way as
+in the default case.
+
+If the default method is used, the call to CORBA::Object::_get_interface()
+requires that the server (specifically the generated skeleton code)
+know about the TAO_IFR_Client library, since the implementation of
+this method is not found in the TAO library, requiring as it does the
+knowledge of the rather large IFR client interface. To dynamically load
+the TAO_IFR_Client library (assuming it has been compiled), the
+header file ACE_ROOT/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.h is
+included in the application (in test_i.h) and TAO_IFR_Client added to
+the list of linked libraries. This will force the static Initializer
+function in the library to initialize all the IFR typecodes and to
+load the library. Applications that don't need to call _get_interface
+don't need to link this library and can thus keep the server-side
+footprint smaller.
+
+More information about the Interface Repository can be found in
+TAO/docs/releasenotes/index.html.
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/client.cpp
new file mode 100644
index 00000000000..3e16668c65b
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/client.cpp
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+// $Id$
+
+#include "ifr_dii_client.h"
+
+ACE_RCSID (Application_Test,
+ client,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ IFR_DII_Client client;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (client.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER)
+ == -1)
+ {
+ return 1;
+ }
+ else
+ {
+ int status = client.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ {
+ return 1;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Client Exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp
new file mode 100644
index 00000000000..f6dd2238e12
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.cpp
@@ -0,0 +1,418 @@
+// -*- C++ -*-
+// $Id$
+
+#include "ifr_dii_client.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (Application_Test,
+ ifr_dii_client,
+ "$Id$")
+
+IFR_DII_Client::IFR_DII_Client (void)
+ : namespace_name (CORBA::string_dup ("warehouse")),
+ interface_name (CORBA::string_dup ("inventory")),
+ op_name (CORBA::string_dup ("getCDinfo")),
+ lookup_by_name_ (false),
+ debug_ (false)
+{
+}
+
+IFR_DII_Client::~IFR_DII_Client (void)
+{
+}
+
+int
+IFR_DII_Client::init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // In a reall application, we would get the scoped or
+ // local name from the Interface Repository and use that
+ // to get the object reference of the target via the Naming
+ // Service. Since we're not testing the Naming Service here,
+ // we just use the IOR which is stored in a file by the server.
+ this->target_ =
+ this->orb_->string_to_object ("file://iorfile"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ if (CORBA::is_nil (this->target_.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ "Unable to find interface repository in: file://iorfile\n"),
+ -1);
+ }
+
+ if (this->parse_args (argc, argv) == -1)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+IFR_DII_Client::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = 0;
+
+ if (this->lookup_by_name_)
+ {
+ result = this->lookup_interface_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result == -1)
+ {
+ return -1;
+ }
+ }
+ else
+ {
+ result = this->find_interface_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (result == -1)
+ {
+ return (-1);
+ }
+ }
+
+ this->get_operation_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->create_dii_request (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->invoke_and_display (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+IFR_DII_Client::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Get_Opt opts (argc, argv, "dn");
+ int c;
+
+ while ((c = opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ this->debug_ = true;
+ break;
+ case 'n': // Select lookup by name.
+ this->lookup_by_name_ = true;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-n]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+IFR_DII_Client::find_interface_def (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->target_def_ =
+ this->target_->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->target_def_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to find interface def\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+IFR_DII_Client::lookup_interface_def (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("InterfaceRepository"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ this->repo_ = CORBA::Repository::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ // Is there a contained object of some kind at any level in the
+ // repository called "warehouse"?
+ CORBA::ContainedSeq_var candidates =
+ this->repo_->lookup_name (this->namespace_name.in (),
+ -1, // Unlimited level recursion.
+ CORBA::dk_all, // Any type of contained object.
+ 1 // Exclude parents of interfaces.
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ CORBA::ULong length = candidates->length ();
+ CORBA::Container_var candidate;
+ CORBA::ContainedSeq_var interfaces;
+ CORBA::ULong n_interfaces = 0;
+ CORBA::String_var name;
+
+ // No point continuing; theres nothing to look at.
+ if (length == 0)
+ {
+ return -1;
+ }
+
+ // The length is 1 in this case, but in general, it could
+ // be any length.
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ candidate =
+ CORBA::Container::_narrow (candidates[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ // Is this contained item itself a container?
+ if (!CORBA::is_nil (candidate.in ()))
+ {
+ // Does this container contain any interfaces?
+ interfaces = candidate->contents (CORBA::dk_Interface,
+ 1 // Exclude parents.
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ n_interfaces = interfaces->length ();
+
+ // Here we are just getting out of the loop (which
+ // only has length 1 anyway) when we see the first
+ // container that contains at least one interface.
+ // In a real application, we'd probably have a more
+ // useful criterion,
+ if (n_interfaces > 0)
+ {
+ break;
+ }
+ }
+ }
+
+ // The length is 1 in this case, but in general, it could
+ // be any length.
+ for (CORBA::ULong j = 0; j < n_interfaces ; ++j)
+ {
+ name = interfaces[j]->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ if (!ACE_OS::strcmp (name.in (), this->interface_name.in ()))
+ {
+ this->target_def_ =
+ CORBA::InterfaceDef::_narrow (interfaces[j]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ }
+ }
+ return 0;
+}
+
+void
+IFR_DII_Client::get_operation_def (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // What operation(s) does this interface contain?
+ CORBA::ContainedSeq_var operations =
+ this->target_def_->contents (CORBA::dk_Operation,
+ 0 // Do not exclude inherited operations.
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong n_operations = operations->length ();
+ CORBA::String_var operation_name;
+
+ // The length is 1 in this case, but in general, it could
+ // be any length.
+ for (CORBA::ULong i = 0; i < n_operations; ++i)
+ {
+ operation_name = operations[i]->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (!ACE_OS::strcmp (operation_name.in (), this->op_name.in ()))
+ {
+ this->op_ =
+ CORBA::OperationDef::_narrow (operations[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ break;
+ }
+ }
+}
+
+void
+IFR_DII_Client::create_dii_request (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->req_ = this->target_->_request (this->op_name.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->result_ = this->op_->result (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->req_->set_return_type (this->result_.in ());
+
+ CORBA::ParDescriptionSeq_var params =
+ this->op_->params (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong length = params->length ();
+
+ // This example of the discovery of parameter information is
+ // purposely contrived for the sake of brevity. A real
+ // application would have more versatile code here, and much
+ // more of it.
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ CORBA::TCKind const kind =
+ params[i].type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ switch (params[i].mode)
+ {
+ case CORBA::PARAM_IN:
+ if (kind == CORBA::tk_string
+ && ACE_OS::strcmp (params[i].name.in (), "artist") == 0)
+ {
+ // The servant will match the substring 'Beatles'.
+ this->req_->add_in_arg (params[i].name.in ()) <<= "the Beatles";
+ }
+
+ break;
+ case CORBA::PARAM_INOUT:
+ if (kind == CORBA::tk_string
+ && ACE_OS::strcmp (params[i].name.in (), "title") == 0)
+ {
+ // This isn't the exact title, but the servant will find the
+ // partial match, and return the full, correct title.
+ this->req_->add_inout_arg (params[i].name.in ()) <<= "Sgt. Pepper's";
+ }
+
+ break;
+ case CORBA::PARAM_OUT:
+ {
+ if (kind == CORBA::tk_float
+ && ACE_OS::strcmp (params[i].name.in (), "price") == 0)
+ {
+ CORBA::Float tmp = -1.0f;
+ CORBA::Any any;
+ any <<= tmp;
+
+ // The servant will return 0.0 if the title is not found.
+ this->req_->arguments ()->add_value (params[i].name.in (),
+ any,
+ CORBA::ARG_OUT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ break;
+ }
+ }
+ }
+}
+
+void
+IFR_DII_Client::invoke_and_display (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->req_->invoke (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TypeCode_var tc = this->req_->return_value ().type ();
+
+ CORBA::TCKind const kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (kind == CORBA::tk_boolean)
+ {
+ CORBA::NVList_ptr args = this->req_->arguments ();
+
+ const char *artist = 0;
+
+# if (defined (_MSC_VER) && (_MSC_VER < 1310))
+ ACE_ASSERT ((*args->item (0)->value () >>= artist) == 1);
+# else
+ ACE_ASSERT ((*args->item (0)->value () >>= artist) == true);
+# endif /* _MSC_VER <= 1310 */
+
+ ACE_ASSERT (ACE_OS::strcmp (artist, "the Beatles") == 0);
+
+ const char *title = 0;
+
+# if (defined (_MSC_VER) && (_MSC_VER < 1310))
+ ACE_ASSERT ((*args->item (1)->value () >>= title) == 1);
+# else
+ ACE_ASSERT ((*args->item (1)->value () >>= title) == true);
+# endif /* _MSC_VER <= 1310 */
+
+ const char *correct = "Sgt. Pepper's Lonely Hearts Club Band";
+ ACE_ASSERT (ACE_OS::strcmp (title, correct) == 0);
+ ACE_UNUSED_ARG (correct);
+
+ CORBA::Float price = 0.0f;
+
+# if (defined (_MSC_VER) && (_MSC_VER < 1310))
+ ACE_ASSERT ((*args->item (2)->value () >>= price) == 1);
+# else
+ ACE_ASSERT ((*args->item (2)->value () >>= price) == true);
+# endif /* _MSC_VER <= 1310 */
+
+ ACE_ASSERT (price == 13.49f);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("%s:\t%s\n")
+ ACE_TEXT ("%s:\t%s\n")
+ ACE_TEXT ("%s:\t$%2.2f\n"),
+ args->item (0)->name (),
+ artist,
+ args->item (1)->name (),
+ title,
+ args->item (2)->name (),
+ price));
+ }
+
+ CORBA::Boolean in_stock = 0;
+
+ CORBA::Boolean ret_status =
+ (this->req_->return_value () >>= CORBA::Any::to_boolean (in_stock));
+ ACE_UNUSED_ARG (ret_status);
+
+ ACE_ASSERT (ret_status == 1);
+ ACE_ASSERT (in_stock == 1);
+
+ if (this->debug_)
+ {
+ if (in_stock)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("status: in stock\n")));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("status: out of stock\n")));
+ }
+ }
+ }
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h
new file mode 100644
index 00000000000..a362e0053cc
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/ifr_dii_client.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef IFR_DII_CLIENT_H
+#define IFR_DII_CLIENT_H
+
+#include "tao/DynamicInterface/Request.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+
+class IFR_DII_Client
+{
+public:
+ IFR_DII_Client (void);
+ ~IFR_DII_Client (void);
+
+ int init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initialize the client.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the client.
+
+private:
+ int parse_args (int argc,
+ char *argv[]);
+ // Process the command line arguments.
+
+ int find_interface_def (ACE_ENV_SINGLE_ARG_DECL);
+ // Query the object reference to get its InterfaceDef in the IFR.
+
+ int lookup_interface_def (ACE_ENV_SINGLE_ARG_DECL);
+ // Look up the InterfaceDef by name in the IFR.
+
+ void get_operation_def (ACE_ENV_SINGLE_ARG_DECL);
+ // Find the desired operation in the interface definition.
+
+ void create_dii_request (ACE_ENV_SINGLE_ARG_DECL);
+ // Query the interface definition to get the info needed
+ // to construct a CORBA::Request.
+
+ void invoke_and_display (ACE_ENV_SINGLE_ARG_DECL);
+ // Do the invocation and display the results.
+
+ CORBA::ORB_var orb_;
+ // Reference to our ORB.
+
+ CORBA::Repository_var repo_;
+ // Reference to the Interface Repository.
+
+ CORBA::Object_var target_;
+ // Reference to the target object.
+
+ CORBA::InterfaceDef_var target_def_;
+ // Repository entry corresponding to target_.
+
+ CORBA::OperationDef_var op_;
+ // Reference to the discovered operation.
+
+ CORBA::TypeCode_var result_;
+ // Type of the return value, if any.
+
+ CORBA::Request_var req_;
+ // DII request holder.
+
+ CORBA::String_var namespace_name;
+ CORBA::String_var interface_name;
+ CORBA::String_var op_name;
+ // Things that we will be searching for in the repository.
+
+ bool lookup_by_name_;
+ // Are we looking up info on the target object by querying the
+ // IFR directly with the target's name, or indirectly
+ // by calling _get_interface() on the target object?
+
+ bool debug_;
+ // Display results and debugging info?
+};
+
+#endif /* IFR_DII_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
new file mode 100755
index 00000000000..901935cfa40
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
@@ -0,0 +1,112 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$ifr_iorfile= "if_repo.ior";
+$svr_iorfile = "iorfile";
+$test_idl = PerlACE::LocalFile ("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 ("../../../../../bin/tao_ifr");
+
+# 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);
+
+$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " -o $ifr_iorfile");
+$SV = new PerlACE::Process ("server", "-ORBInitRef InterfaceRepository=file://$ifr_iorfile");
+$CL = new PerlACE::Process ("client", "-ORBInitRef InterfaceRepository=file://$ifr_iorfile"
+ . " $lookup_by_name");
+$CL2 = new PerlACE::Process ("client", "-ORBInitRef InterfaceRepository=file://$ifr_iorfile -n");
+
+unlink $ifr_iorfile;
+unlink $svr_iorfile;
+
+$IFR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ifr_iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ifr_iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
+}
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($svr_iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$svr_iorfile>\n";
+ $IFR->Kill ();
+ $SV->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";
+ $status = 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$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;
+}
+
+# Do another lookup to check it really has been removed.
+$client = $CL2->SpawnWaitKill (60);
+
+if ($client == 0) {
+ print STDERR "ERROR: second client run returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+$server = $IFR->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: IFR returned $server\n";
+ $status = 1;
+}
+
+unlink $ifr_iorfile;
+unlink $svr_iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp
new file mode 100644
index 00000000000..7cfe8d9c287
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/server.cpp
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+// $Id$
+
+#include "test_i.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID(Application_Test, server, "$Id$")
+
+static const char *ior_output_file = "iorfile";
+
+static int
+write_ior_to_file (const char *ior)
+{
+ FILE *output_file = ACE_OS::fopen (ior_output_file, "w");
+
+ if (output_file == 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output files for writing IOR: %s\n",
+ ior_output_file),
+ -1);
+ }
+
+ int result = ACE_OS::fprintf (output_file,
+ "%s",
+ ior);
+ if (result < 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ACE_OS::fprintf failed while writing %s to %s\n",
+ ior,
+ ior_output_file),
+ -1);
+ }
+
+ ACE_OS::fclose (output_file);
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ inventory_i servant_impl;
+
+ warehouse::inventory_var servant =
+ servant_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (servant.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int write_result = write_ior_to_file (ior.in ());
+
+ if (write_result != 0)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "%p\n",
+ "write_ior_to_file"),
+ -1);
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa->destroy (1,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "server exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test.idl b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test.idl
new file mode 100644
index 00000000000..8ac11a758fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/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/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp
new file mode 100644
index 00000000000..45214149850
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.cpp
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+// $Id$
+
+#include "test_i.h"
+
+#include "ace/SString.h"
+
+
+ACE_RCSID (Application_Test,
+ test_i,
+ "$Id$")
+
+
+CORBA::Boolean
+inventory_i::getCDinfo (const char * artist,
+ char *& title,
+ CORBA::Float_out price
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Boolean in_stock = 0;
+ price = 0.0f;
+ ACE_CString name_key ("Beatles");
+ ACE_CString name (artist);
+
+ if (name.strstr (name_key) != ACE_CString::npos)
+ {
+ ACE_CString title_key ("Sgt. Pepper");
+ ACE_CString working_title (title);
+
+ if (working_title.strstr (title_key) != ACE_CString::npos)
+ {
+ title =
+ CORBA::string_dup ("Sgt. Pepper's Lonely Hearts Club Band");
+
+ price = 13.49f;
+
+ in_stock = 1;
+ }
+ else
+ {
+ title = CORBA::string_dup ("not found");
+ }
+ }
+ else
+ {
+ title = CORBA::string_dup ("not found");
+ }
+
+ return in_stock;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.h b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.h
new file mode 100644
index 00000000000..2e3a4164285
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/test_i.h
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+// $Id$
+
+#include "testS.h"
+
+// Must include this header file and link to TAO_IFR_Client.lib
+// to dynamically load this necessary library.
+#include "tao/IFR_Client/IFR_Client_Adapter_Impl.h"
+
+class inventory_i : public POA_warehouse::inventory
+{
+public:
+ CORBA::Boolean getCDinfo (const char * artist,
+ char *& title,
+ CORBA::Float_out price
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/IFR_IDL3_Test.mpc b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/IFR_IDL3_Test.mpc
new file mode 100644
index 00000000000..e1f0a71cc46
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/IFR_IDL3_Test.mpc
@@ -0,0 +1,14 @@
+// -*- MPC -*-
+// $Id$
+
+project: taoexe, ifr_client, minimum_corba {
+ exename = IDL3_Test
+
+ Source_Files {
+ client.cpp
+ idl3_client.cpp
+ }
+
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/Makefile.am b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/Makefile.am
new file mode 100644
index 00000000000..34c2f1abb7d
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.IFR_IDL3_Test.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = IDL3_Test
+
+IDL3_Test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+IDL3_Test_SOURCES = \
+ client.cpp \
+ idl3_client.cpp \
+ idl3_client.h
+
+IDL3_Test_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/README b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/README
new file mode 100644
index 00000000000..98b048231ad
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/README
@@ -0,0 +1,33 @@
+$Id$
+
+This test specializes in the Interface Repository support of
+valuetypes and the IDL extensions that were added to
+support the CORBA Component Model (CCM). Testing of most of
+the other IDL types can be found in the nearby IFR_Test
+directory.
+
+The test can be run automatically by executing the provided
+Perl script run_test.pl. If debugging of one or more of
+the processes is desired, each can be run by hand, in the
+same order that they are found in the script. The script
+also shows reasonable command line arguments for each process.
+
+No code is generated from the IDL file. It is there only to
+have its contents loaded into the IFR by the Interface
+Repository loader, tao_ifr.
+
+The -d option may be passed to the client, which will then
+output detailed messages in the event of a test error.
+Otherwise, only test success or failure will be output.
+
+All the numeric and string constants, storing the names, flags,
+and sequence lengths found in test.idl, appear at the top of
+idl3_client.cpp. This allows the test to be easily extended
+to cover more complicated use cases.
+
+More information about the Interface Repository can be found in
+TAO/docs/releasenotes/index.html.
+
+
+
+- Jeff Parsons \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp
new file mode 100644
index 00000000000..410ad1fd4f3
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/client.cpp
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+// $Id$
+
+#include "idl3_client.h"
+
+ACE_RCSID (Application_Test,
+ client,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ IDL3_Client client;
+
+ ACE_TRY_NEW_ENV
+ {
+ if (client.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER)
+ == -1)
+ {
+ return 1;
+ }
+ else
+ {
+ int status = client.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == -1)
+ {
+ return 1;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Client Exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
new file mode 100644
index 00000000000..9c9a0a21607
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.cpp
@@ -0,0 +1,1894 @@
+// -*- C++ -*-
+// $Id$
+
+#include "idl3_client.h"
+#include "tao/ORB.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID (Application_Test,
+ ifr_dii_client,
+ "$Id$")
+
+// All the magic quantities are here at the top.
+
+const char *COMPONENT_ID = "IDL:mod/test_component:1.0";
+const char *COMPONENT_SCOPED_NAME = "::mod::test_component";
+const char *COMP_BASE_ID = "IDL:help/c_base:1.0";
+
+const char *VALUETYPE_ID = "IDL:mod/test_valuetype:1.0";
+const char *VALUETYPE_SCOPED_NAME = "::mod::test_valuetype";
+const char *VT_BASE_ID = "IDL:help/v_base:1.0";
+
+const char *HOME_ID = "IDL:mod/test_home:1.0";
+const char *HOME_SCOPED_NAME = "::mod::test_home";
+const char *HOME_BASE_ID = "IDL:help/h_base:1.0";
+const char *HOME_KEY_ID = "IDL:help/h_key:1.0";
+
+const char *EVENTTYPE_ID = "IDL:mod/test_eventtype:1.0";
+
+const CORBA::ULong ATTRS_LEN = 1;
+const CORBA::ULong OPS_LEN = 1;
+const CORBA::ULong FACTORY_LEN = 2;
+
+const char *ATTR_LOCAL_NAMES[] =
+ {
+ "c_attr1"
+ };
+
+const CORBA::TCKind ATTR_TC_KINDS[] =
+ {
+ CORBA::tk_long
+ };
+
+const CORBA::ULong GET_EXCEP_LEN[] =
+ {
+ 1
+ };
+
+const CORBA::ULong PUT_EXCEP_LEN[] =
+ {
+ 2
+ };
+
+const char *OP_NAMES[] =
+ {
+ "v_op"
+ };
+
+const CORBA::TCKind OP_RET_KINDS[] =
+ {
+ CORBA::tk_string
+ };
+
+const CORBA::ULong PARAMS_LEN[] =
+ {
+ 3
+ };
+
+const char *PARAM_NAMES[] =
+ {
+ "inoutarg",
+ "inarg",
+ "outarg"
+ };
+
+const CORBA::ULong OP_EXCEP_LEN[] =
+ {
+ 2
+ };
+
+const CORBA::ULong COMP_SUPPORTED_LEN = 2;
+
+const char *COMP_SUPPORTED_IDS[] =
+ {
+ "IDL:help/c_supp1:1.0",
+ "IDL:help/c_supp2:1.0"
+ };
+
+const CORBA::ULong PROVIDES_LEN = 1;
+const CORBA::ULong USES_LEN = 2;
+const CORBA::ULong EMITS_LEN = 1;
+const CORBA::ULong PUBLISHES_LEN = 1;
+const CORBA::ULong CONSUMES_LEN = 1;
+
+const char *PROVIDES_NAMES[] =
+ {
+ "test_provides1"
+ };
+
+const char *PROVIDES_TYPE_IDS[] =
+ {
+ "IDL:help/c_provides1:1.0"
+ };
+
+const char *USES_NAMES[] =
+ {
+ "test_uses1",
+ "test_uses2"
+ };
+
+const char *USES_TYPE_IDS[] =
+ {
+ "IDL:help/c_uses1:1.0",
+ "IDL:help/c_uses2:1.0"
+ };
+
+const CORBA::Boolean USES_MULTIPLE_FLAGS[] =
+ {
+ 0,
+ 1
+ };
+
+const char *EMITS_NAMES[] =
+ {
+ "test_emits1"
+ };
+
+const char *PUBLISHES_NAMES[] =
+ {
+ "test_publishes1"
+ };
+
+const char *CONSUMES_NAMES[] =
+ {
+ "test_consumes1"
+ };
+
+const char *EMITS_IDS[] =
+ {
+ "IDL:help/c_emits1:1.0"
+ };
+
+const char *PUBLISHES_IDS[] =
+ {
+ "IDL:help/c_publishes1:1.0"
+ };
+
+const char *CONSUMES_IDS[] =
+ {
+ "IDL:help/c_consumes1:1.0"
+ };
+
+const CORBA::ULong VT_SUPPORTED_LEN = 2;
+
+const char *VT_SUPPORTED_IDS[] =
+ {
+ "IDL:help/v_supp1:1.0",
+ "IDL:help/v_supp2:1.0"
+ };
+
+const CORBA::ULong MEM_LEN = 2;
+
+const CORBA::Visibility MEM_VIS[] =
+ {
+ CORBA::PUBLIC_MEMBER,
+ CORBA::PRIVATE_MEMBER
+ };
+
+const char *MEM_NAMES[] =
+ {
+ "test_mem1",
+ "test_mem2",
+ };
+
+const CORBA::ULong VT_FACTORY_PARAM_LENS[] =
+ {
+ 1,
+ 2
+ };
+
+const CORBA::ULong VT_FACTORY_EXCEP_LENS[] =
+ {
+ 0,
+ 2
+ };
+
+const char *VT_FACTORY_PARAM_NAMES[][2] =
+ {
+ {"set_tm1", 0},
+ {"set_tm1a", "set_tm2"}
+ };
+
+const char *VT_FACTORY_EXCEP_NAMES[][2] =
+ {
+ {0, 0},
+ {"whups", "doh"}
+ };
+
+const CORBA::ULong HOME_SUPPORTED_LEN = 2;
+
+const char *HOME_SUPPORTED_IDS[] =
+ {
+ "IDL:help/h_supp1:1.0",
+ "IDL:help/h_supp2:1.0"
+ };
+
+const CORBA::ULong HOME_FACTORY_LEN = 1;
+const CORBA::ULong HOME_FINDER_LEN = 1;
+
+const CORBA::ULong HOME_FACTORY_PARAM_LENS[] =
+ {
+ 1
+ };
+
+const char *HOME_FACTORY_PARAM_NAMES[][1] =
+ {
+ {"set_uid"}
+ };
+
+const CORBA::ULong HOME_FACTORY_EXCEP_LENS[] =
+ {
+ 1
+ };
+
+const char *HOME_FACTORY_EXCEP_NAMES[][1] =
+ {
+ {"doh"}
+ };
+
+const CORBA::ULong HOME_FINDER_PARAM_LENS[] =
+ {
+ 3
+ };
+
+const char *HOME_FINDER_PARAM_NAMES[][3] =
+ {
+ {"id_number", "id_string", "pkey"}
+ };
+
+const CORBA::ULong HOME_FINDER_EXCEP_LENS[] =
+ {
+ 1
+ };
+
+const char *HOME_FINDER_EXCEP_NAMES[][1] =
+ {
+ {"whups"}
+ };
+
+IDL3_Client::IDL3_Client (void)
+ : debug_ (0)
+{
+}
+
+IDL3_Client::~IDL3_Client (void)
+{
+}
+
+int
+IDL3_Client::init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("InterfaceRepository"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "IDL3_Client - IFR resolution failed\n"),
+ -1);
+ }
+
+ this->repo_ =
+ CORBA::ComponentIR::Repository::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->repo_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "IDL3_Client - IFR narrow failed\n"),
+ -1);
+ }
+
+ if (this->parse_args (argc, argv) == -1)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int status = this->component_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return status;
+ }
+
+ status = this->valuetype_test (VALUETYPE_ID,
+ "value"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return status;
+ }
+
+ status = this->home_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return status;
+ }
+
+ status = this->valuetype_test (EVENTTYPE_ID,
+ "event"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return status;
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Get_Opt opts (argc, argv, "d");
+ int c;
+
+ while ((c = opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // Turn on debugging outoput.
+ this->debug_ = 1;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::component_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Contained_var result =
+ this->repo_->lookup_id (COMPONENT_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (result.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_test: lookup by id failed\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str =
+ result->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ const char *tmp = str.in ();
+
+ if (tmp == 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_test: component has null scoped name\n"));
+ }
+
+ return -1;
+ }
+
+ if (ACE_OS::strcmp (tmp, COMPONENT_SCOPED_NAME) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_test: "
+ "component has incorrect scoped name\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ComponentIR::ComponentDef_var comp_def =
+ CORBA::ComponentIR::ComponentDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::TypeCode_var comp_tc =
+ comp_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (comp_tc.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_test: "
+ "type code creation failed\n"));
+ }
+
+ return -1;
+ }
+
+ tmp = comp_tc->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, COMPONENT_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_test: "
+ "bad id from type code\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription_var desc =
+ comp_def->describe_ext_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (desc.ptr () == 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_test: "
+ "describe_ext_interface return null\n"));
+ }
+
+ return -1;
+ }
+
+ int status = this->component_attribute_test (desc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->component_inheritance_test (comp_def
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->component_port_test (comp_def
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::home_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Contained_var result =
+ this->repo_->lookup_id (HOME_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (result.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: lookup by id failed\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ComponentIR::HomeDef_var home =
+ CORBA::ComponentIR::HomeDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (result.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: home narrow failed\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ComponentIR::ComponentDef_var managed =
+ home->managed_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (managed.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: managed component is null\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str = managed->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), COMPONENT_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: bad id for managed component\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ValueDef_var pkey =
+ home->primary_key (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (pkey.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: primary key is null\n"));
+ }
+
+ return -1;
+ }
+
+ str = pkey->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), HOME_KEY_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: bad id for managed component\n"));
+ }
+
+ return -1;
+ }
+
+ int status = this->home_inheritance_test (home
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ CORBA::Contained::Description_var desc =
+ home->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::HomeDescription *home_desc = 0;
+
+ if ((desc->value >>= home_desc) == 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_test: extraction of HomeDescription failed\n"));
+ }
+
+ return -1;
+ }
+
+ status = this->home_factory_test (home_desc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->home_finder_test (home_desc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::valuetype_test (const char *repo_id,
+ const char *prefix
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::Contained_var result =
+ this->repo_->lookup_id (repo_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (result.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_test: lookup by id failed\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ CORBA::ExtValueDef_var evd =
+ CORBA::ExtValueDef::_narrow (result.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (evd.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_test: narrow to ExtValueDef failed\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ExtValueDef::ExtFullValueDescription_var desc =
+ evd->describe_ext_value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ int status = this->valuetype_attribute_test (desc,
+ prefix
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->valuetype_inheritance_test (evd,
+ prefix
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->valuetype_operation_test (desc,
+ prefix
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->valuetype_member_test (desc,
+ prefix
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->valuetype_factory_test (desc,
+ prefix
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::component_attribute_test (
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription_var &desc
+ ACE_ENV_ARG_DECL
+ )
+{
+ if (desc->attributes.length () != ATTRS_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_attribute_test: wrong number of attrs\n"));
+ }
+
+ return -1;
+ }
+
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < ATTRS_LEN; ++i)
+ {
+ tmp = desc->attributes[i].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, ATTR_LOCAL_NAMES[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_attribute_test: "
+ "wrong local name for attribute #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ CORBA::TCKind kind =
+ desc->attributes[i].type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (kind != ATTR_TC_KINDS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_attribute_test: "
+ "wrong TCKind for attribute #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ if (desc->attributes[i].get_exceptions.length () != GET_EXCEP_LEN[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_attribute_test: "
+ "wrong number of get-exceptions"
+ " for attribute #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ if (desc->attributes[i].put_exceptions.length () != PUT_EXCEP_LEN[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_attribute_test: "
+ "wrong number of put-exceptions"
+ " for attribute #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::component_inheritance_test (
+ CORBA::ComponentIR::ComponentDef_var &comp_def
+ ACE_ENV_ARG_DECL
+ )
+{
+ CORBA::ComponentIR::ComponentDef_var comp_base =
+ comp_def->base_component (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (comp_base.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_inheritance_test: "
+ "base component is null\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str = comp_base->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), COMP_BASE_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_inheritance_test: "
+ "bad id on base component\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::InterfaceDefSeq_var supported =
+ comp_base->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ULong length = supported->length ();
+
+ if (length != COMP_SUPPORTED_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_inheritance_test: "
+ "wrong number of supported interfaces\n"));
+ }
+
+ return -1;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ str = supported[i]->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0
+ || ACE_OS::strcmp (str.in (), COMP_SUPPORTED_IDS[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_inheritance_test: "
+ "bad id on supported interface #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::component_port_test (
+ CORBA::ComponentIR::ComponentDef_var &comp_def
+ ACE_ENV_ARG_DECL
+ )
+{
+ CORBA::Contained::Description_var desc =
+ comp_def->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ComponentIR::ComponentDescription *cd = 0;
+
+ if ((desc->value >>= cd) == 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "component_port_test: "
+ "Any extraction of component description failed\n"));
+ }
+
+ return -1;
+ }
+
+ int status = this->provides_test (cd->provided_interfaces
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->uses_test (cd->used_interfaces
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->event_port_test (cd->emits_events,
+ EMITS_LEN,
+ "emits",
+ EMITS_NAMES,
+ EMITS_IDS
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->event_port_test (cd->publishes_events,
+ PUBLISHES_LEN,
+ "publishes",
+ PUBLISHES_NAMES,
+ PUBLISHES_IDS
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ status = this->event_port_test (cd->consumes_events,
+ CONSUMES_LEN,
+ "consumes",
+ CONSUMES_NAMES,
+ CONSUMES_IDS
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (status != 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::provides_test (CORBA::ComponentIR::ProvidesDescriptionSeq &pds
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (pds.length () != PROVIDES_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "provides_test: "
+ "wrong number of provides interfaces\n"));
+ }
+
+ return -1;
+ }
+
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < PROVIDES_LEN; ++i)
+ {
+ tmp = pds[i].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, PROVIDES_NAMES[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "provides_test: "
+ "wrong local name for provides #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ tmp = pds[i].interface_type.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, PROVIDES_TYPE_IDS[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "provides_test: "
+ "wrong base interface type id for provides #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::uses_test (CORBA::ComponentIR::UsesDescriptionSeq &uds
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (uds.length () != USES_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "uses_test: "
+ "wrong number of uses interfaces\n"));
+ }
+
+ return -1;
+ }
+
+ const char *tmp = 0;
+ CORBA::Boolean mult = 0;
+
+ for (CORBA::ULong i = 0; i < USES_LEN; ++i)
+ {
+ tmp = uds[i].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, USES_NAMES[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "uses_test: "
+ "wrong local name for uses #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ tmp = uds[i].interface_type.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, USES_TYPE_IDS[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "uses_test: "
+ "wrong base interface type id for uses #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ mult = uds[i].is_multiple;
+
+ if (mult != USES_MULTIPLE_FLAGS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "uses_test: "
+ "wrong is_multiple value for uses #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::event_port_test (CORBA::ComponentIR::EventPortDescriptionSeq &eds,
+ CORBA::ULong seq_length,
+ const char *port_type,
+ const char **names,
+ const char **ids
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (eds.length () != seq_length)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "event_port_test: "
+ "wrong number of event %s ports\n",
+ port_type));
+ }
+
+ return -1;
+ }
+
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < seq_length; ++i)
+ {
+ tmp = eds[i].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, names[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "event_port_test: "
+ "wrong local name for %s port #%d\n",
+ port_type,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ tmp = eds[i].event.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, ids[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "event_port_test: "
+ "wrong base event type id for %s port #%d\n",
+ port_type,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::valuetype_inheritance_test (CORBA::ExtValueDef_var &vd,
+ const char *prefix
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ValueDef_var bvd = vd->base_value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (bvd.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_inheritance_test: "
+ "base valuetype is null\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str = bvd->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), VT_BASE_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_inheritance_test: "
+ "wrong repo id for base valuetype\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ CORBA::InterfaceDefSeq_var supported =
+ vd->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ULong length = supported->length ();
+
+ if (length != VT_SUPPORTED_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_inheritance_test: "
+ "wrong number of supported interfaces\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ str = supported[i]->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0
+ || ACE_OS::strcmp (str.in (), VT_SUPPORTED_IDS[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_inheritance_test: "
+ "bad id on supported interface #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::valuetype_attribute_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &desc,
+ const char *prefix
+ ACE_ENV_ARG_DECL
+ )
+{
+ if (desc->attributes.length () != ATTRS_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_attribute_test: wrong number of attrs\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < ATTRS_LEN; ++i)
+ {
+ tmp = desc->attributes[i].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, ATTR_LOCAL_NAMES[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_attribute_test: "
+ "wrong local name for attribute #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ CORBA::TCKind kind =
+ desc->attributes[i].type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (kind != ATTR_TC_KINDS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_attribute_test: "
+ "wrong TCKind for attribute #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ if (desc->attributes[i].get_exceptions.length () != GET_EXCEP_LEN[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_attribute_test: "
+ "wrong number of get-exceptions"
+ " for attribute #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ if (desc->attributes[i].put_exceptions.length () != PUT_EXCEP_LEN[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_attribute_test: "
+ "wrong number of put-exceptions"
+ " for attribute #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::valuetype_operation_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &desc,
+ const char *prefix
+ ACE_ENV_ARG_DECL
+ )
+{
+ CORBA::ULong ops_length = desc->operations.length ();
+
+ if (ops_length != OPS_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_operation_test: "
+ "wrong number of operations\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ const char *tmp = 0;
+ CORBA::ULong j = 0;
+ CORBA::ULong length = 0;
+
+ for (CORBA::ULong i = 0; i < ops_length; ++i)
+ {
+ tmp = desc->operations[i].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, OP_NAMES[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_operation_test: "
+ "wrong name for operation #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ CORBA::TCKind ret_kind =
+ desc->operations[i].result.in ()->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (ret_kind != OP_RET_KINDS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_operation_test: "
+ "wrong return type\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ length = desc->operations[i].parameters.length ();
+
+ if (length != PARAMS_LEN[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_operation_test: "
+ "wrong number of parameters in operation #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < length; ++j)
+ {
+ tmp = desc->operations[i].parameters[j].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, PARAM_NAMES[j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_operation_test: "
+ "wrong name for operation #%d,"
+ "parameter #%d\n",
+ prefix,
+ i + 1,
+ j + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ length = desc->operations[i].exceptions.length ();
+
+ if (length != OP_EXCEP_LEN[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_operation_test: "
+ "wrong number of exceptions in operation #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::valuetype_member_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &desc,
+ const char *prefix
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ CORBA::ULong length = desc->members.length ();
+
+ if (length != MEM_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_member_test: "
+ "wrong number of members\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ if (desc->members[i].access != MEM_VIS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_member_test: "
+ "wrong access value in member #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ tmp = desc->members[i].name.in ();
+
+ if (tmp == 0 || ACE_OS::strcmp (tmp, MEM_NAMES[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_member_test: "
+ "wrong repo id for member #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::valuetype_factory_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &desc,
+ const char *prefix
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+{
+ CORBA::ULong length = desc->initializers.length ();
+
+ if (length != FACTORY_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_factory_test: "
+ "wrong number of factories\n",
+ prefix));
+ }
+
+ return -1;
+ }
+
+ CORBA::ULong inside_len = 0;
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < FACTORY_LEN; ++i)
+ {
+ inside_len = desc->initializers[i].members.length ();
+
+ if (inside_len != VT_FACTORY_PARAM_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_factory_test: "
+ "wrong number of params in factory #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ CORBA::ULong j = 0;
+
+ for (j = 0; j < VT_FACTORY_PARAM_LENS[i]; ++j)
+ {
+ tmp = desc->initializers[i].members[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, VT_FACTORY_PARAM_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_factory_test: "
+ "wrong name for arg #%d in factory #%d\n",
+ prefix,
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ inside_len = desc->initializers[i].exceptions.length ();
+
+ if (inside_len != VT_FACTORY_EXCEP_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_factory_test: "
+ "wrong number of exceptions in factory #%d\n",
+ prefix,
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < VT_FACTORY_EXCEP_LENS[i]; ++j)
+ {
+ tmp = desc->initializers[i].exceptions[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, VT_FACTORY_EXCEP_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%stype_factory_test: "
+ "wrong name for exception #%d in factory #%d\n",
+ prefix,
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::home_inheritance_test (CORBA::ComponentIR::HomeDef_var &hd
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ComponentIR::HomeDef_var bhd =
+ hd->base_home (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (bhd.in ()))
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "base home is null\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::String_var str = bhd->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0 || ACE_OS::strcmp (str.in (), HOME_BASE_ID) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "wrong repo id for base home\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::InterfaceDefSeq_var supported =
+ bhd->supported_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::ULong length = supported->length ();
+
+ if (length != HOME_SUPPORTED_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "wrong number of supported interfaces\n"));
+ }
+
+ return -1;
+ }
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ str = supported[i]->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (str.in () == 0
+ || ACE_OS::strcmp (str.in (), HOME_SUPPORTED_IDS[i]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_inheritance_test: "
+ "bad id on supported interface #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::home_factory_test (CORBA::ComponentIR::HomeDescription *hd
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ CORBA::ULong length = hd->factories.length ();
+
+ if (length != HOME_FACTORY_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong number of factories\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ULong inside_len = 0;
+ CORBA::ULong j = 0;
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < HOME_FACTORY_LEN; ++i)
+ {
+ inside_len = hd->factories[i].parameters.length ();
+
+ if (inside_len != HOME_FACTORY_PARAM_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong number of params in factory #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->factories[i].parameters[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FACTORY_PARAM_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong name for param #%d in factory #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ inside_len = hd->factories[i].exceptions.length ();
+
+ if (inside_len != HOME_FACTORY_EXCEP_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong number of exceptions in factory #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->factories[i].exceptions[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FACTORY_EXCEP_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_factory_test: "
+ "wrong name for exception #%d in factory #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+int
+IDL3_Client::home_finder_test (CORBA::ComponentIR::HomeDescription *hd
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ CORBA::ULong length = hd->finders.length ();
+
+ if (length != HOME_FINDER_LEN)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong number of finders\n"));
+ }
+
+ return -1;
+ }
+
+ CORBA::ULong inside_len = 0;
+ CORBA::ULong j = 0;
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < HOME_FINDER_LEN; ++i)
+ {
+ inside_len = hd->finders[i].parameters.length ();
+
+ if (inside_len != HOME_FINDER_PARAM_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong number of params in finder #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->finders[i].parameters[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FINDER_PARAM_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong name for param #%d in finder #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+
+ inside_len = hd->finders[i].exceptions.length ();
+
+ if (inside_len != HOME_FINDER_EXCEP_LENS[i])
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong number of exceptions in finder #%d\n",
+ i + 1));
+ }
+
+ return -1;
+ }
+
+ for (j = 0; j < inside_len; ++j)
+ {
+ tmp = hd->finders[i].exceptions[j].name.in ();
+
+ if (tmp == 0
+ || ACE_OS::strcmp (tmp, HOME_FINDER_EXCEP_NAMES[i][j]) != 0)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "home_finder_test: "
+ "wrong name for exception #%d in finder #%d\n",
+ j + 1,
+ i + 1));
+ }
+
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h
new file mode 100644
index 00000000000..df2bd70a044
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/idl3_client.h
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/InterfaceRepo
+//
+// = FILENAME
+// idl3_client.h
+//
+// = DESCRIPTION
+// This class tests the IFR support for CCM-related types.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef IDL3_CLIENT_H
+#define IDL3_CLIENT_H
+
+#include "tao/IFR_Client/IFR_ComponentsC.h"
+
+class IDL3_Client
+{
+ // = TITLE
+ // Component-aware IFR Client Implementation
+ //
+ // = DESCRIPTION
+ // Class wrapper for a client which tests the Interface Repository
+ // support for the OMG IDL3 extensions.
+public:
+ IDL3_Client (void);
+ // Constructor
+
+ ~IDL3_Client (void);
+ // Destructor
+
+ int init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL);
+ // Initialize the ORB and get the IFR object reference.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Execute test code.
+
+private:
+ int parse_args (int argc,
+ char *argv[]);
+ // Process the command line arguments.
+
+ int component_test (ACE_ENV_SINGLE_ARG_DECL);
+ int home_test (ACE_ENV_SINGLE_ARG_DECL);
+
+ // Also tests eventtype.
+ int valuetype_test (const char *repo_id,
+ const char *prefix
+ ACE_ENV_ARG_DECL);
+
+ int component_attribute_test (
+ CORBA::InterfaceAttrExtension::ExtFullInterfaceDescription_var &
+ ACE_ENV_ARG_DECL
+ );
+
+ int component_inheritance_test (CORBA::ComponentIR::ComponentDef_var &
+ ACE_ENV_ARG_DECL);
+
+ int component_port_test (CORBA::ComponentIR::ComponentDef_var &
+ ACE_ENV_ARG_DECL);
+
+ int provides_test (CORBA::ComponentIR::ProvidesDescriptionSeq &
+ ACE_ENV_ARG_DECL);
+
+ int uses_test (CORBA::ComponentIR::UsesDescriptionSeq &
+ ACE_ENV_ARG_DECL);
+
+ int event_port_test (CORBA::ComponentIR::EventPortDescriptionSeq &,
+ CORBA::ULong seq_length,
+ const char *port_type,
+ const char **names,
+ const char **ids
+ ACE_ENV_ARG_DECL);
+
+ int valuetype_inheritance_test (CORBA::ExtValueDef_var &,
+ const char *prefix
+ ACE_ENV_ARG_DECL);
+
+ int valuetype_attribute_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &,
+ const char *prefix
+ ACE_ENV_ARG_DECL
+ );
+
+ int valuetype_operation_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &,
+ const char *prefix
+ ACE_ENV_ARG_DECL
+ );
+
+ int valuetype_member_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &,
+ const char *prefix
+ ACE_ENV_ARG_DECL
+ );
+
+ int valuetype_factory_test (
+ CORBA::ExtValueDef::ExtFullValueDescription_var &,
+ const char *prefix
+ ACE_ENV_ARG_DECL
+ );
+
+ int home_inheritance_test (CORBA::ComponentIR::HomeDef_var &
+ ACE_ENV_ARG_DECL);
+
+ int home_factory_test (CORBA::ComponentIR::HomeDescription *
+ ACE_ENV_ARG_DECL);
+
+ int home_finder_test (CORBA::ComponentIR::HomeDescription *
+ ACE_ENV_ARG_DECL);
+
+private:
+ CORBA::Boolean debug_;
+ // Flag to output detailed error messages.
+
+ CORBA::ORB_var orb_;
+ // Storage of the ORB reference.
+
+ CORBA::Repository_var repo_;
+ // Storage of the IFR reference.
+};
+
+#endif /* IDL3_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl
new file mode 100755
index 00000000000..80fb6ba003c
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl
@@ -0,0 +1,82 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$ifr_iorfile= "if_repo.ior";
+$test_idl = PerlACE::LocalFile ("test.idl");
+$includes = "-I ../../../.. -I../../../../CIAO/ciao -I../../../../orbsvcs";
+
+# find the tao_ifr executable.
+# Its placement is dependent upon the OS and if MPC generated makefiles are used.
+my $exec_extn="";
+if ($^O eq "MSWin32") {
+ $exec_extn=".exe";
+}
+
+$tao_ifr = "../../../../../bin/tao_ifr";
+if (! -e $tao_ifr . $exec_extn ) {
+ $tao_ifr = "../../../IFR_Service/tao_ifr";
+ if (! -e $tao_ifr . $exec_extn ) {
+ print STDERR "ERROR: tao_ifr compiler not found.\n";
+ exit 1;
+ }
+}
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-d") {
+ $debug = "-d";
+ }
+ else {
+ $other .= $ARGV[$i];
+ }
+}
+
+$TAO_IFR = new PerlACE::Process ($tao_ifr);
+$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " -o $ifr_iorfile");
+$CL = new PerlACE::Process ("IDL3_Test", "-ORBInitRef InterfaceRepository=file://$ifr_iorfile"
+ . " $debug");
+
+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 $includes $test_idl");
+
+$tresult = $TAO_IFR->SpawnWaitKill (30);
+
+if ($tresult != 0) {
+ print STDERR "ERROR: tao_ifr (test.idl) returned $tresult\n";
+ $status = 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\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/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
new file mode 100644
index 00000000000..b697c945933
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/test.idl
@@ -0,0 +1,123 @@
+// -*- C++ -*-
+// $Id$
+
+#ifndef INTERFACEREPO_IDL3_TEST
+#define INTERFACEREPO_IDL3_TEST
+
+#include <Components.idl>
+
+module help
+{
+ exception doh {};
+ exception whups {};
+};
+
+module help
+{
+ interface c_supp1 {};
+ interface c_supp2 {};
+ component c_base supports c_supp1, c_supp2 {};
+ valuetype v_base_base {};
+ valuetype v_base : v_base_base {};
+ interface v_supp1 {};
+ abstract interface v_supp2 {};
+
+ valuetype h_key : Components::PrimaryKeyBase
+ {
+ public long id_key;
+ };
+
+ interface h_supp1 {};
+ interface h_supp2 {};
+ home h_base supports h_supp1, h_supp2 manages c_base {};
+};
+
+module help
+{
+ interface c_provides1 {};
+ interface c_uses1 {};
+ interface c_uses2 {};
+ eventtype c_emits1 {};
+ eventtype c_publishes1 {};
+ eventtype c_consumes1 {};
+};
+
+module mod
+{
+ component test_component : help::c_base
+ {
+ attribute long c_attr1
+ getraises (help::doh)
+ setraises (help::whups, help::doh);
+
+ provides help::c_provides1 test_provides1;
+
+ uses help::c_uses1 test_uses1;
+
+ uses multiple help::c_uses2 test_uses2;
+
+ emits help::c_emits1 test_emits1;
+
+ publishes help::c_publishes1 test_publishes1;
+
+ consumes help::c_consumes1 test_consumes1;
+ };
+
+ valuetype test_valuetype
+ : help::v_base supports help::v_supp1, help::v_supp2
+ {
+ attribute long c_attr1
+ getraises (help::doh)
+ setraises (help::whups, help::doh);
+
+ string v_op (inout string inoutarg,
+ in help::v_supp1 inarg,
+ out long outarg)
+ raises (help::doh, help::whups);
+
+ public string test_mem1;
+ private short test_mem2;
+
+ factory default_factory (in string set_tm1);
+ factory create_tv (in string set_tm1a,
+ in short set_tm2)
+ raises (help::whups, help::doh);
+ };
+
+ home test_home : help::h_base
+ manages test_component primarykey help::h_key
+ {
+ factory create_tc (in string set_uid)
+ raises (help::doh);
+
+ finder find_tc (in long id_number,
+ in string id_string,
+ in help::h_key pkey)
+ raises (help::whups);
+ };
+
+ eventtype test_eventtype
+ : help::v_base supports help::v_supp1, help::v_supp2
+ {
+ attribute long c_attr1
+ getraises (help::doh)
+ setraises (help::whups, help::doh);
+
+ string v_op (inout string inoutarg,
+ in help::v_supp1 inarg,
+ out long outarg)
+ raises (help::doh, help::whups);
+
+ public string test_mem1;
+ private short test_mem2;
+
+ factory default_factory (in string set_tm1);
+ factory create_tv (in string set_tm1a,
+ in short set_tm2)
+ raises (help::whups, help::doh);
+ };
+
+};
+
+#endif /* INTERFACEREPO_IDL3_TEST */
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.idl b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.idl
new file mode 100644
index 00000000000..55d1cb99edb
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.idl
@@ -0,0 +1,33 @@
+// $Id$
+#ifndef __IFR_INHERITANCE_TEST_DEFINED
+#define __IFR_INHERITANCE_TEST_DEFINED
+
+module IFR_Test
+{
+ typedef sequence<string> NameList;
+
+ interface InterfaceRoot
+ {
+ readonly attribute string root_attr1;
+ attribute string root_attr2;
+
+ void get_root(in string root_name, out InterfaceRoot iroot);
+
+ readonly attribute string root_attr3;
+
+ NameList get_all_roots();
+ };
+
+ interface SubInterface : InterfaceRoot
+ {
+ attribute long sub_attr1;
+
+ void set_sub(in string sub_name);
+
+ NameList get_all_subs();
+
+ readonly attribute string sub_attr2;
+ };
+};
+
+#endif
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.mpc b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.mpc
new file mode 100644
index 00000000000..858b1fdd3ee
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/IFR_Inheritance_Test.mpc
@@ -0,0 +1,11 @@
+// -*- MPC -*-
+// $Id$
+
+project: taoexe, ifr_client, portableserver {
+ exename = IFR_Inheritance_Test
+
+ IDL_Files {
+ // exclude this file
+ !IFR_Inheritance_Test.idl
+ }
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/Makefile.am b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/Makefile.am
new file mode 100644
index 00000000000..65568172685
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/Makefile.am
@@ -0,0 +1,42 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.IFR_Inheritance_Test.am
+
+noinst_PROGRAMS = IFR_Inheritance_Test
+
+IFR_Inheritance_Test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+IFR_Inheritance_Test_SOURCES = \
+ main.cpp
+
+IFR_Inheritance_Test_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/README b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/README
new file mode 100644
index 00000000000..5948342f0c9
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/README
@@ -0,0 +1,75 @@
+$Id$
+
+This is a simple test showing that Interface inheritance
+is supported by the Interface Repository.
+
+ --- The test should output: ---
+operation InterfaceRoot::get_root
+operation InterfaceRoot::get_all_roots
+attribute InterfaceRoot::root_attr1
+attribute InterfaceRoot::root_attr2
+attribute InterfaceRoot::root_attr3
+operation SubInterface::get_root
+operation SubInterface::get_all_roots
+operation SubInterface::set_sub
+operation SubInterface::get_all_subs
+attribute SubInterface::root_attr1
+attribute SubInterface::root_attr2
+attribute SubInterface::root_attr3
+attribute SubInterface::sub_attr1
+attribute SubInterface::sub_attr2
+
+Thanks to Bryan Cassell <BryanCassell@iti-team.com> for identifying
+problem and providing non-automated test code.
+
+
+To build this test, the TAO library, the TypeCodeFactory
+library, the Interface Repository (the last two found in
+TAO/orbsvcs/IFR_Service), and these test files must all be built.
+In addition, the Interface Repository requires the TAO_Svc_Utils
+library in TAO/orbsvcs/orbsvcs.
+
+To run this test, either use the Perl script run_test.pl, or
+
+
+
+(Windows)
+start the Interface Repository by typing
+
+ ..\..\..\IFR_Service\IFR_Service
+
+in one window, then (in another window)
+
+REM may need this to avoid error finding CL.EXE
+"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
+
+%ACE_ROOT%\bin\tao_ifr IFR_Inheritance_Test.idl -ORBInitRef InterfaceRepository=file://if_repo.ior
+
+and then
+
+ IFR_Inheritance_Test -ORBInitRef InterfaceRepository=file://if_repo.ior
+
+(Unix)
+in this directory, type
+
+ ../../../IFR_Service/IFR_Service &
+
+then
+
+%TAO_ROOT%/orbsvcs/IFR_Service/tao_ifr IFR_Inheritance_Test.idl -ORBInitRef InterfaceRepository=file://if_repo.ior
+
+and then
+ ./IFR_Inheritance_Test -ORBInitRef InterfaceRepository=file://if_repo.ior
+
+
+
+You may use IP multicast discovery by starting the server with "-m 1"
+and use the default multicast address for the InterfaceRepository.
+
+ ../../../IFR_Service/IFR_Service -m 1
+
+and
+
+ ./IFR_Inheritance_Test
+
+- Scott Harris <harris_s@ociweb.com> \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp
new file mode 100644
index 00000000000..2b862e5fdb1
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+// $Id$
+
+// The run_test.pl perl script will check for the expected output.
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/ORB.h"
+
+ACE_RCSID (IFR_Inheritance_Test,
+ main,
+ "$Id$")
+
+void printContents( const CORBA::ContainedSeq& cont )
+{
+ ACE_TRY_NEW_ENV
+ {
+ for( unsigned int i=0; i<cont.length(); i++ )
+ {
+ if( cont[i]->describe()->kind == CORBA::dk_Interface )
+ {
+ CORBA::InterfaceDef_var intDef =
+ CORBA::InterfaceDef::_narrow (cont[i]
+ ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ CORBA::InterfaceDef::FullInterfaceDescription* desc =
+ intDef->describe_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //printf( "-- %s:\n", (const char*)(desc->name) );
+
+ for( unsigned int j1=0; j1 < desc->operations.length (); j1++ )
+ printf( "operation %s::%s\n",
+ (const char*)(desc->name),
+ (const char*)((desc->operations[j1]).name) );
+
+ for( unsigned int j2=0; j2 < desc->attributes.length (); j2++ )
+ printf( "attribute %s::%s\n",
+ (const char*)(desc->name),
+ (const char*)((desc->attributes[j2]).name) );
+ }
+ else if( cont[i]->describe ()->kind == CORBA::dk_Module )
+ {
+ CORBA::ModuleDef_var moduleDef =
+ CORBA::ModuleDef::_narrow (cont[i]
+ ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ CORBA::ContainedSeq_var moduleContents =
+ moduleDef->contents (CORBA::dk_all,1
+ ACE_ENV_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ printContents (moduleContents.in ());
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "printContents");
+ ACE_OS::exit(-1); // the test has failed!
+ }
+ ACE_ENDTRY;
+}
+
+
+int main(int argc, char** argv)
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("InterfaceRepository"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (object.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ "Null objref from resolve_initial_references\n"
+ ),
+ -1
+ );
+ }
+
+ CORBA::Repository_var ifr =
+ CORBA::Repository::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (ifr.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CORBA::Repository::_narrow failed\n"),
+ -1);
+ }
+
+ CORBA::ContainedSeq_var cont = ifr->contents (CORBA::dk_all, 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ printContents (cont.in ());
+
+ orb->shutdown ();
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "main");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
new file mode 100755
index 00000000000..cdbe13a4a8f
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
@@ -0,0 +1,156 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+use strict;
+
+my %isa = ();
+$isa{"InterfaceRoot::get_root"} = "operation";
+$isa{"InterfaceRoot::get_all_roots"} = "operation";
+$isa{"InterfaceRoot::root_attr1"} = "attribute";
+$isa{"InterfaceRoot::root_attr2"} = "attribute";
+$isa{"InterfaceRoot::root_attr3"} = "attribute";
+$isa{"SubInterface::get_root"} = "operation";
+$isa{"SubInterface::get_all_roots"} = "operation";
+$isa{"SubInterface::set_sub"} = "operation";
+$isa{"SubInterface::get_all_subs"} = "operation";
+$isa{"SubInterface::root_attr1"} = "attribute";
+$isa{"SubInterface::root_attr2"} = "attribute";
+$isa{"SubInterface::root_attr3"} = "attribute";
+$isa{"SubInterface::sub_attr1"} = "attribute";
+$isa{"SubInterface::sub_attr2"} = "attribute";
+
+my %got = ();
+$got{"InterfaceRoot::get_root"} = 13;
+$got{"InterfaceRoot::get_all_roots"} = 13;
+$got{"InterfaceRoot::root_attr1"} = 13;
+$got{"InterfaceRoot::root_attr2"} = 13;
+$got{"InterfaceRoot::root_attr3"} = 13;
+$got{"SubInterface::get_root"} = 13;
+$got{"SubInterface::get_all_roots"} = 13;
+$got{"SubInterface::set_sub"} = 13;
+$got{"SubInterface::get_all_subs"} = 13;
+$got{"SubInterface::root_attr1"} = 13;
+$got{"SubInterface::root_attr2"} = 13;
+$got{"SubInterface::root_attr3"} = 13;
+$got{"SubInterface::sub_attr1"} = 13;
+$got{"SubInterface::sub_attr2"} = 13;
+
+my $iorfile = "if_repo.ior";
+
+my $testoutputfilename = "IFR_Inheritance_test.output";
+
+unlink $testoutputfilename;
+
+my $status = 0;
+
+unlink $iorfile;
+
+my $SV = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " -o $iorfile" );
+
+my $CL = new PerlACE::Process ("IFR_Inheritance_Test",
+ " -ORBInitRef InterfaceRepository=file://$iorfile");
+
+# The location of the tao_idl utility - depends on O/S
+my $tao_ifr = "undefined";
+if ($^O eq "MSWin32")
+{
+ $tao_ifr = "../../../../../bin/tao_ifr";
+}
+else
+{
+ $tao_ifr = "../../../IFR_Service/tao_ifr";
+}
+
+# Compile the IDL
+#
+my $TAO_IFR = new PerlACE::Process("$tao_ifr",
+ "IFR_Inheritance_Test.idl"
+ . " -ORBInitRef InterfaceRepository=file://$iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+if( $TAO_IFR->SpawnWaitKill(10) != 0 )
+{
+ print STDERR "ERROR: can't compile IDL\n";
+ $TAO_IFR->Kill ();
+ $status = 1;
+ exit $status;
+}
+
+# Redirect STDERR to a log file so that
+# we can make sure that we got a warning
+open(SAVE, ">&STDOUT");
+open(STDOUT, ">$testoutputfilename");
+
+my $client = $CL->SpawnWaitKill (60);
+
+# Close the log file and restore STDERR
+close(STDOUT);
+open(STDOUT, ">&SAVE");
+
+
+my $type = "";
+my $name = "";
+open(THELOG, "< $testoutputfilename") or die "could not open the saved log";
+while (<THELOG>) {
+ if (/^attribute/ || "^operation") {
+ chomp($_);
+ ($type, $name) = split(/ /, $_);
+ #print "found $type $name\n";
+ if ($isa{$name} eq $type) {
+ #print "got $name\n";
+ $got{$name} = 1;
+ }
+ else {
+ print STDERR "ERROR: $type $name was not expected\n";
+ $status = 1;
+ }
+ }
+ else {
+ print STDOUT "ERROR: unexpected line: $_\n";
+ }
+}
+close(THELOG);
+
+### did we get all of the expected attributes and operations?
+my $key = "";
+foreach $key (keys (%got)) {
+ #print "got\{$key\} = $got{$key}\n";
+ if (! exists $isa{$key} ) {
+ print STDERR "CONFIG ERROR: \$got has $key but \$isa does not\n";
+ $status = 1;
+ }
+ if ($got{$key} == 13) {
+ print STDERR "ERROR: $isa{$key} $key was not found\n";
+ $status = 1;
+ }
+}
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+my $server = $SV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp
new file mode 100644
index 00000000000..ef26b0b054d
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.cpp
@@ -0,0 +1,3577 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Admin_Client.h"
+
+#include "tao/AnyTypeCode/Any_Unknown_IDL_Type.h"
+#include "tao/CDR.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/SString.h"
+
+ACE_RCSID (IFR_Test,
+ Admin_Client,
+ "$Id$")
+
+Admin_Client::Admin_Client (void)
+ : debug_ (0),
+ all_tests_ (1),
+ which_test_ (0),
+ iterations_ (1)
+{
+ // Initialize the array of pointers to member functions.
+ this->test_array_[0] = &Admin_Client::array_test;
+ this->test_array_[1] = &Admin_Client::enum_test;
+ this->test_array_[2] = &Admin_Client::alias_test;
+ this->test_array_[3] = &Admin_Client::native_test;
+ this->test_array_[4] = &Admin_Client::struct_test;
+ this->test_array_[5] = &Admin_Client::union_test;
+ this->test_array_[6] = &Admin_Client::exception_test;
+ this->test_array_[7] = &Admin_Client::constant_test;
+ this->test_array_[8] = &Admin_Client::interface_test;
+ this->test_array_[9] = &Admin_Client::move_test;
+ this->test_array_[10] = &Admin_Client::module_test;
+}
+
+Admin_Client::~Admin_Client (void)
+{
+}
+
+// An array of test names, so we can step through them when
+// trying to find a match for a test selected on the command line.
+const char *Admin_Client::test_names_[] =
+{
+ "array",
+ "enum",
+ "alias",
+ "native",
+ "struct",
+ "union",
+ "exception",
+ "constant",
+ "interface",
+ "move",
+ "module"
+};
+
+int
+Admin_Client::init (int argc,
+ char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int retval = this->parse_args (argc,
+ argv);
+
+ if (retval != 0)
+ return retval;
+
+ CORBA::Object_var object =
+ this->orb_->resolve_initial_references ("InterfaceRepository"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (object.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ "Null objref from resolve_initial_references\n"
+ ),
+ -1
+ );
+ }
+
+ this->repo_ =
+ CORBA::Repository::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->repo_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CORBA::Repository::_narrow failed\n"),
+ -1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Admin_Client::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Admin_Client::run (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ if (this->all_tests_ == 1)
+ {
+ for (CORBA::ULong i = 0; i < NUMBER_OF_TESTS; ++i)
+ {
+ // Each test is run twice to make sure everything
+ // gets destroyed properly. If not, we get a
+ // CORBA::BAD_PARAM exception the second time.
+ for (CORBA::ULong j = 0; j < this->iterations_; ++j)
+ {
+ (this->*test_array_[i])(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ else
+ {
+ for (CORBA::ULong j = 0; j < this->iterations_; ++j)
+ {
+ (this->*test_array_[this->which_test_])(
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Admin_Client::run");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Admin_Client::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Get_Opt opts (argc, argv, "di:t:");
+ int c;
+ int result = 0;
+ CORBA::ULong i = 0;
+ char *name = 0;
+
+ while ((c = opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ this->debug_ = 1;
+ break;
+ case 'i': // iterations
+ result = ACE_OS::atoi (opts.opt_arg ());
+ if (result > 0)
+ this->iterations_ = result;
+ break;
+ case 't': // test selection
+ this->all_tests_ = 0;
+ name = opts.opt_arg ();
+
+ for (i = 0; i < NUMBER_OF_TESTS; ++i)
+ {
+ if (ACE_OS::strcmp (name, this->test_names_[i]) == 0)
+ {
+ this->which_test_ = i;
+ break;
+ }
+ }
+
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-i iterations]"
+ " [-t test name]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ return 0;
+}
+
+void
+Admin_Client::array_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== ARRAY TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::IDLType_var atype =
+ this->repo_->create_string (7 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ArrayDef_var avar =
+ this->repo_->create_array (5,
+ atype.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong bound = avar->length (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::length: %d\n"),
+ bound));
+ }
+
+ ACE_ASSERT (bound == 5);
+
+ CORBA::TypeCode_var tc = avar->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_array);
+
+ tc = avar->element_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_string);
+
+ CORBA::IDLType_var tdef =
+ avar->element_type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::DefinitionKind dk = tdef->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type_def::def_kind: %d\n"),
+ dk
+ ));
+ }
+
+ ACE_ASSERT (dk == CORBA::dk_String);
+
+ CORBA::StringDef_var pvar =
+ CORBA::StringDef::_narrow (tdef.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ bound = pvar->bound (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StringDef::bound: %d\n"),
+ bound));
+ }
+
+ ACE_ASSERT (bound == 7);
+
+ CORBA::PrimitiveDef_var pdef =
+ this->repo_->get_primitive (CORBA::pk_short
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ avar->element_type_def (pdef.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type_def (set)\n")));
+ }
+
+ tc = avar->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_array);
+
+ tdef = avar->element_type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ dk = tdef->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ArrayDef::element_type_def::def_kind: %d\n"),
+ dk));
+ }
+
+ ACE_ASSERT (dk == CORBA::dk_Primitive);
+
+ CORBA::PrimitiveDef_var zvar =
+ CORBA::PrimitiveDef::_narrow (tdef.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::PrimitiveKind pkind = zvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("PrimitiveDef::kind: %d\n"),
+ pkind));
+ }
+
+ ACE_ASSERT (pkind == CORBA::pk_short);
+
+ avar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::enum_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== ENUM TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::EnumMemberSeq members (4);
+ members.length (3);
+
+ members[0] = CORBA::string_dup ("ZERO");
+ members[1] = CORBA::string_dup ("ONE");
+ members[2] = CORBA::string_dup ("TWO");
+
+ CORBA::EnumDef_var evar =
+ this->repo_->create_enum ("IDL:my_enum:1.0",
+ "my_enum",
+ "1.0",
+ members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str = evar->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::id: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0") == 0);
+
+ str = evar->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_enum") == 0);
+
+ str = evar->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::absolute_name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_enum") == 0);
+
+ str = evar->version (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::version: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.0") == 0);
+
+ CORBA::DefinitionKind dkind =
+ evar->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::def_kind: %d\n\n"),
+ dkind));
+ }
+
+ ACE_ASSERT (dkind == CORBA::dk_Enum);
+
+ CORBA::Contained::Description_var desc =
+ evar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ dkind = desc->kind;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::kind: %d\n"),
+ dkind));
+ }
+
+ ACE_ASSERT (dkind == CORBA::dk_Enum);
+
+ CORBA::TypeDescription *td;
+ desc->value >>= td;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::name: %s\n"),
+ td->name.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_enum") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::id: %s\n"),
+ td->id.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->id, "IDL:my_enum:1.0") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::defined_in: %s\n"),
+ td->defined_in.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->defined_in, "") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::version: %s\n"),
+ td->version.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->version, "1.0") == 0);
+
+ CORBA::TCKind kind = td->type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_enum);
+
+ str = td->type->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::id: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0") == 0);
+
+ str = td->type->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_enum") == 0);
+
+ CORBA::ULong count =
+ td->type->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::member_count: %d\n\n"),
+ count
+ ));
+ }
+
+ ACE_ASSERT (count == 3);
+
+ CORBA::ULong i = 0;
+
+ for (i = 0; i < count; ++i)
+ {
+ str = td->type->member_name (i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::describe::value::type::")
+ ACE_TEXT ("member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), members[i]) == 0);
+ }
+
+
+ members.length (4);
+ members[0] = CORBA::string_dup ("NOTHINGNESS");
+ members[1] = CORBA::string_dup ("UNITY");
+ members[2] = CORBA::string_dup ("DUALITY");
+ members[3] = CORBA::string_dup ("TRINITY");
+
+ evar->members (members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::members (set)\n\n")));
+ }
+
+ CORBA::EnumMemberSeq_var fellows =
+ evar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ count = fellows->length ();
+ const char *tmp = 0;
+
+ for (i = 0; i < count; ++i)
+ {
+ tmp = fellows[i];
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::")
+ ACE_TEXT ("members[%d]: %s\n"),
+ i,
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (fellows[i], members[i]) == 0);
+ }
+
+ evar->name ("another_enum"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ str = evar->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::name (set)\n")));
+ }
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "another_enum") == 0);
+
+ str = evar->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("EnumDef::absolute_name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::another_enum") == 0);
+
+ evar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::alias_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== ALIAS TEST ==============\n\n")
+ ));
+ }
+
+ // This test also tests WstringDef and SequenceDef.
+
+ CORBA::IDLType_var sq_elem =
+ this->repo_->create_wstring (7 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::SequenceDef_var sq_var =
+ this->repo_->create_sequence (5,
+ sq_elem.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::AliasDef_var a_var =
+ this->repo_->create_alias ("IDL:my_alias:1.0",
+ "my_alias",
+ "1.0",
+ sq_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str = a_var->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::id: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_alias:1.0") == 0);
+
+ str = a_var->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_alias") == 0);
+
+ str = a_var->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::absolute_name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_alias") == 0);
+
+ str = a_var->version (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::version: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.0") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::version (set)\n")));
+ }
+
+ a_var->version ("1.1"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = a_var->version (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::version: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.1") == 0);
+
+ CORBA::TypeCode_var tc = a_var->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = tc->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nAliasDef::type::name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_alias") == 0);
+
+ CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_alias);
+
+ CORBA::TypeCode_var ct =
+ tc->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ kind = ct->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_sequence);
+
+ CORBA::ULong length = ct->length (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 5);
+
+ CORBA::TypeCode_var ct2 =
+ ct->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ kind = ct2->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::")
+ ACE_TEXT ("content_type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_wstring);
+
+ length = ct2->length (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::type::content_type::")
+ ACE_TEXT ("content_type::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 7);
+
+ CORBA::Contained::Description_var desc =
+ a_var->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TypeDescription *td;
+ desc->value >>= td;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nAliasDef::describe::value::name: %s\n"),
+ td->name.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_alias") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::version: %s\n"),
+ td->version.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->version, "1.1") == 0);
+
+ kind = td->type->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_alias);
+
+ str = td->type->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::type::id: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_alias:1.0") == 0);
+
+ str = td->type->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::describe::value::type::name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_alias") == 0);
+
+ CORBA::IDLType_var i_var =
+ a_var->original_type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::SequenceDef_var seq_var =
+ CORBA::SequenceDef::_narrow (i_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = seq_var->bound (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("AliasDef::original_type_def::bound: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 5);
+
+ a_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::native_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== NATIVE TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::NativeDef_var nvar =
+ this->repo_->create_native ("IDL:my_native:1.0",
+ "my_native",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str = nvar->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::id: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_native:1.0") == 0);
+
+ str = nvar->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "my_native") == 0);
+
+ str = nvar->version (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::version: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "1.0") == 0);
+
+ str = nvar->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::absolute_name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_native") == 0);
+
+ CORBA::DefinitionKind kind =
+ nvar->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("NativeDef::def_kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::dk_Native);
+
+ nvar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::struct_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== STRUCT TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::StructMemberSeq members (3);
+ members.length (3);
+
+ members[0].name = CORBA::string_dup ("ub_string");
+ members[0].type_def = this->repo_->get_primitive (CORBA::pk_string
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[0].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ members[1].name = CORBA::string_dup ("bd_string");
+ members[1].type_def = this->repo_->create_string (5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[1].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ CORBA::EnumMemberSeq e_members (2);
+ e_members.length (2);
+
+ e_members[0] = CORBA::string_dup ("ZERO");
+ e_members[1] = CORBA::string_dup ("ONE");
+
+ members[2].name = CORBA::string_dup ("my_struct_enum");
+
+ CORBA::EnumDef_var e_var =
+ this->repo_->create_enum ("IDL:my_enum:1.0",
+ "my_enum",
+ "1.0",
+ e_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[2].type_def = CORBA::EnumDef::_duplicate (e_var.in ());
+ members[2].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ CORBA::StructDef_var svar =
+ this->repo_->create_struct ("IDL:my_struct:1.0",
+ "my_struct",
+ "1.0",
+ members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // This also tests the members() function.
+ CORBA::TypeCode_var tc = svar->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong length = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::type::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 3);
+
+ CORBA::String_var str;
+ CORBA::ULong i = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ str = tc->member_name (i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::type::member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), members[i].name) == 0);
+ }
+
+ CORBA::Contained::Description_var desc =
+ svar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TypeDescription *td;
+ desc->value >>= td;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::describe::value::name: %s\n"),
+ td->name.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_struct") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::describe::value::id: %s\n"),
+ td->id.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->id, "IDL:my_struct:1.0") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::describe::value::version: %s\n"),
+ td->version.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->version, "1.0") == 0);
+
+ members.length (2);
+ members[0].name = CORBA::string_dup ("long_mem");
+ members[0].type_def = this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[0].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ members[1].name = CORBA::string_dup ("array_mem");
+ members[1].type_def =
+ this->repo_->create_array (5,
+ members[0].type_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[1].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ svar->members (members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::members (set)\n\n")));
+ }
+
+ CORBA::EnumMemberSeq def_members (2);
+ def_members.length (2);
+
+ def_members[0] = CORBA::string_dup ("FIRST");
+ def_members[1] = CORBA::string_dup ("SECOND");
+
+ CORBA::EnumDef_var e_def_var = svar->create_enum ("IDL:my_def_enum:1.0",
+ "my_enum",
+ "1.0",
+ def_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::StructMemberSeq_var out_members =
+ svar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_members->length ();
+ int cmp_result = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
+ i,
+ out_members[i].name.in ()));
+ }
+
+ if (i == length - 1)
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, "my_enum");
+ ACE_ASSERT (cmp_result == 0);
+ }
+ else
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, members[i].name);
+ ACE_ASSERT (cmp_result == 0);
+ }
+ }
+
+ CORBA::Contained_var fox = this->repo_->lookup ("::my_struct::my_enum"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = fox->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup::absolute_name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct::my_enum") == 0);
+
+ fox = svar->lookup ("my_enum"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = fox->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::lookup::absolute_name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct::my_enum") == 0);
+
+ CORBA::Container_var outer = fox->defined_in (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::Contained_var schizo =
+ CORBA::Contained::_narrow (outer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = schizo->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::lookup::defined_in::")
+ ACE_TEXT ("absolute_name: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct") == 0);
+
+ CORBA::ContainedSeq_var contents =
+ this->repo_->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ contents = svar->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ if (i == 0)
+ {
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_struct::my_enum") == 0);
+ }
+ else
+ {
+ // No more found in lookup.
+ }
+ }
+
+ contents = this->repo_->lookup_name ("my_enum",
+ -1,
+ CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::lookup_name::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ // Can't use ACE_ASSERT here because we don't know the order
+ // of the results of the search.
+ }
+
+ CORBA::Container::DescriptionSeq_var cont_desc =
+ this->repo_->describe_contents (CORBA::dk_all,
+ 0,
+ -1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = cont_desc->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::describe_contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ for (i = 0; i < length; ++i)
+ {
+ CORBA::TypeDescription *td;
+ cont_desc[i].value >>= td;
+
+ str = td->type->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]::id: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ if (i == 0)
+ {
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_enum:1.0") == 0);
+ }
+ else if (i == 1)
+ {
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:my_struct:1.0") == 0);
+ }
+ }
+
+ svar->name ("your_struct"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::name (set)\n")));
+ }
+
+ contents = svar->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ const char *tmp = "::your_struct";
+
+ for (i = 0; i < length; ++i)
+ {
+ str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ // Whatever the scoped name now is, it must begin
+ // with "::your_struct".
+ cmp_result =
+ ACE_OS::strncmp (str.in (), tmp, ACE_OS::strlen (tmp));
+ ACE_ASSERT (cmp_result == 0);
+ }
+
+#if defined (ACE_NDEBUG)
+ // ACE_ASSERT macro expands to nothing, so...
+ ACE_UNUSED_ARG (tmp);
+#endif /* ACE_NDEBUG */
+
+ e_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ svar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::union_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== UNION TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::EnumMemberSeq d_members (4);
+ d_members.length (4);
+
+ d_members[0] = CORBA::string_dup ("ZERO");
+ d_members[1] = CORBA::string_dup ("ONE");
+ d_members[2] = CORBA::string_dup ("TWO");
+ d_members[3] = CORBA::string_dup ("THREE");
+
+ CORBA::EnumDef_var d_var =
+ this->repo_->create_enum ("IDL:disc_enum:1.0",
+ "disc_enum",
+ "1.0",
+ d_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::StructMemberSeq s_members (1);
+ s_members.length (1);
+ s_members[0].name = CORBA::string_dup ("string_in_struct");
+ s_members[0].type_def =
+ this->repo_->create_string (6
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ s_members[0].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ CORBA::StructDef_var s_var =
+ this->repo_->create_struct ("IDL:struct_in_union:1.0",
+ "struct_in_union",
+ "1.0",
+ s_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::UnionMemberSeq u_members (4);
+ u_members.length (4);
+
+ u_members[0].name = CORBA::string_dup ("longval");
+ u_members[0].type_def =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ u_members[0].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+ CORBA::TypeCode_var d_type = d_var->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ TAO_OutputCDR maker2;
+ maker2.write_ulong (3); // THREE
+ TAO_InputCDR maker2_in (maker2);
+ TAO::Unknown_IDL_Type *impl2 = 0;
+ ACE_NEW (impl2,
+ TAO::Unknown_IDL_Type (d_type.in (),
+ maker2_in));
+ CORBA::Any any2;
+ any2.replace (impl2);
+ u_members[0].label = any2;
+
+ u_members[1].name = CORBA::string_dup ("longval");
+ u_members[1].type_def =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ u_members[1].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+ TAO_OutputCDR maker0;
+ maker0.write_ulong (2); // TWO
+ TAO_InputCDR maker0_in (maker0);
+ TAO::Unknown_IDL_Type *impl0 = 0;
+ ACE_NEW (impl0,
+ TAO::Unknown_IDL_Type (d_type.in (),
+ maker0_in));
+ CORBA::Any any0;
+ any0.replace (impl0);
+ u_members[1].label = any0;
+
+ u_members[2].name = CORBA::string_dup ("structval");
+ u_members[2].type_def = CORBA::StructDef::_duplicate (s_var.in ());
+ u_members[2].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+
+ TAO_OutputCDR maker1;
+ maker1.write_ulong (0); // ZERO
+ TAO_InputCDR maker1_in (maker1);
+ TAO::Unknown_IDL_Type *impl1 = 0;
+ ACE_NEW (impl1,
+ TAO::Unknown_IDL_Type (d_type.in (),
+ maker1_in));
+ CORBA::Any any1;
+ any1.replace (impl1);
+ u_members[2].label = any1;
+
+ u_members[3].name = CORBA::string_dup ("stringval");
+ u_members[3].type_def =
+ this->repo_->create_string (17
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ u_members[3].type = CORBA::TypeCode::_duplicate (CORBA::_tc_void);
+ u_members[3].label <<= CORBA::Any::from_octet (0); // default case (ONE)
+
+ CORBA::UnionDef_var u_var =
+ this->repo_->create_union ("IDL:my_union:1.0",
+ "my_union",
+ "1.0",
+ d_var.in (),
+ u_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TypeCode_var disc_tc =
+ u_var->discriminator_type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong length =
+ disc_tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("UnionDef::discriminator_type::member_count: %d\n"),
+ length
+ ));
+ }
+
+ ACE_ASSERT (length == 4);
+
+ CORBA::TypeCode_var tc = u_var->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::member_count: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 3);
+
+ CORBA::Long slot = tc->default_index (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::default_index: %d\n\n"),
+ slot));
+ }
+
+ ACE_ASSERT (slot == 2);
+
+ CORBA::String_var str;
+ const char *tmp = 0;
+
+ for (CORBA::ULong i = 0; i < length; ++i)
+ {
+ str = tc->member_name (i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ // Multiple labels for first member shifts index by 1.
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), u_members[i + 1].name) == 0);
+
+ CORBA::Any_var label = tc->member_label (i
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_InputCDR cdr (static_cast<ACE_Message_Block *> (0));
+ CORBA::ULong val;
+
+ TAO::Any_Impl *impl = label->impl ();
+ TAO_OutputCDR out;
+ impl->marshal_value (out);
+ TAO_InputCDR in (out);
+
+ // If we're at the default index, it's in the label as octet 0,
+ // so just assign the slot value to val.
+ if (i != (CORBA::ULong) slot)
+ {
+ in.read_ulong (val);
+ tmp = d_members[val];
+ }
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::type::member_label[%d]: %s\n"),
+ i,
+ i == (CORBA::ULong) slot ? "default" : tmp));
+ }
+
+ // Labels are not in order.
+ switch (i)
+ {
+ case 0:
+ ACE_ASSERT (val == 3 || val == 2);
+ break;
+ case 1:
+ ACE_ASSERT (val == 0);
+ break;
+ default:
+ break;
+ }
+ }
+
+ u_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ s_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ d_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::exception_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== EXCEPTION TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::StructMemberSeq members (3);
+ members.length (3);
+
+ members[0].name = CORBA::string_dup ("ub_string");
+ members[0].type_def = this->repo_->get_primitive (CORBA::pk_string
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[0].type =
+ members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ members[1].name = CORBA::string_dup ("bd_string");
+ members[1].type_def = this->repo_->create_string (5
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[1].type = members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::EnumMemberSeq e_members (2);
+ e_members.length (2);
+
+ e_members[0] = CORBA::string_dup ("ZERO");
+ e_members[1] = CORBA::string_dup ("ONE");
+
+ members[2].name = CORBA::string_dup ("my_exception_enum");
+ CORBA::EnumDef_var e_var =
+ this->repo_->create_enum ("IDL:my_enum:1.0",
+ "my_enum",
+ "1.0",
+ e_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ members[2].type_def = CORBA::EnumDef::_duplicate (e_var.in ());
+
+ members[2].type =
+ members[2].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ExceptionDef_var exvar =
+ this->repo_->create_exception ("IDL:my_exception:1.0",
+ "my_exception",
+ "1.0",
+ members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TypeCode_var tc = exvar->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong length = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::type::member_count: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 3);
+
+ CORBA::String_var str;
+ CORBA::ULong i = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ str = tc->member_name (i ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::type::member_name[%d]: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), members[i].name) == 0);
+ }
+
+ CORBA::Contained::Description_var desc =
+ exvar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ExceptionDescription *ed;
+ desc->value >>= ed;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nExceptionDef::describe::value::name: %s\n"),
+ ed->name.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (ed->name, "my_exception") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::describe::value::id: %s\n"),
+ ed->id.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (ed->id, "IDL:my_exception:1.0") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::describe::value::defined_in: %s\n"),
+ ed->defined_in.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (ed->defined_in, "") == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::describe::value::version: %s\n"),
+ ed->version.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (ed->version, "1.0") == 0);
+
+ members.length (2);
+ members[0].name = CORBA::string_dup ("long_mem");
+ members[0].type_def = this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[0].type =
+ members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ members[1].name = CORBA::string_dup ("array_mem");
+ CORBA::ArrayDef_ptr a_ptr =
+ this->repo_->create_array (5,
+ members[0].type_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[1].type_def = a_ptr;
+ members[1].type =
+ members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ exvar->members (members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nExceptionDef::members (set)\n\n")));
+ }
+
+ CORBA::EnumMemberSeq def_members (2);
+ def_members.length (2);
+
+ def_members[0] = CORBA::string_dup ("FIRST");
+ def_members[1] = CORBA::string_dup ("SECOND");
+
+ CORBA::EnumDef_var e_def_var = exvar->create_enum ("IDL:my_def_enum:1.0",
+ "my_enum",
+ "1.0",
+ def_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::StructMemberSeq_var out_members =
+ exvar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_members->length ();
+ int cmp_result = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ if (this->debug_)
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::members[%d]::name: %s\n"),
+ i,
+ out_members[i].name.in ()));
+
+ if (i == 2)
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, "my_enum");
+ ACE_ASSERT (cmp_result == 0);
+ }
+ else
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, members[i].name);
+ ACE_ASSERT (cmp_result == 0);
+ }
+ }
+
+ a_ptr->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nArrayDef::destroy\n\n")));
+ }
+
+ out_members = exvar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ length = out_members->length ();
+
+ for (i = 0; i < length; ++i)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::members[%d]::name: %s\n"),
+ i,
+ out_members[i].name.in ()));
+ }
+
+ if (i == 1)
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, "my_enum");
+ ACE_ASSERT (cmp_result == 0);
+ }
+ else
+ {
+ cmp_result =
+ ACE_OS::strcmp (out_members[i].name, members[i].name);
+ ACE_ASSERT (cmp_result == 0);
+ }
+ }
+
+ CORBA::Contained_var fox = this->repo_->lookup ("::my_exception::my_enum"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = fox->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::lookup: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_exception::my_enum") == 0);
+
+ fox = exvar->lookup ("my_enum"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = fox->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::lookup: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_exception::my_enum") == 0);
+
+ CORBA::ContainedSeq_var contents =
+ this->repo_->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ contents = exvar->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ // Should be only the one member.
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::my_exception::my_enum") == 0);
+ }
+
+ contents = this->repo_->lookup_name ("my_enum",
+ -1,
+ CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::lookup_name::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ // Can't use ACE_ASSERT here - order of search results is unknown.
+ }
+
+ CORBA::Container::DescriptionSeq_var cont_desc =
+ this->repo_->describe_contents (CORBA::dk_all,
+ 0,
+ -1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = cont_desc->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::describe_contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ CORBA::TypeDescription *td;
+
+ for (i = 0; i < length; ++i)
+ {
+ CORBA::DefinitionKind kind = cont_desc[i].kind;
+
+ if (kind == CORBA::dk_Exception)
+ {
+ cont_desc[i].value >>= ed;
+ CORBA::TypeCode_ptr tc = ed->type.in ();
+
+ length = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::type::member_count: %d\n"),
+ i,
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::name: %s\n"),
+ i,
+ ed->name.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (ed->name, "my_exception") == 0);
+ }
+ else
+ {
+ cont_desc[i].value >>= td;
+ CORBA::TypeCode_ptr tc = td->type.in ();
+
+ length = tc->member_count (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::type::member_count: %d\n"),
+ i,
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::describe_contents[%d]")
+ ACE_TEXT ("::value::name: %s\n"),
+ i,
+ td->name.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (td->name, "my_enum") == 0);
+ }
+ }
+
+ exvar->name ("your_exception"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nExceptionDef::name (set)\n\n")));
+ }
+
+ contents = exvar->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+ const char *tmp = "::your_exception";
+
+ for (i = 0; i < length; ++i)
+ {
+ str = contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ExceptionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ ACE_ASSERT (ACE_OS::strncmp (str.in (), tmp, ACE_OS::strlen (tmp)) == 0);
+ }
+
+#if defined (ACE_NDEBUG)
+ // ACE_ASSERT macro expands to nothing, so...
+ ACE_UNUSED_ARG (tmp);
+#endif /* ACE_NDEBUG */
+
+ e_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ exvar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::constant_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== CONSTANT TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::IDLType_var ivar =
+ this->repo_->get_primitive (CORBA::pk_string
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Any any;
+ const char *s = "hello";
+ any <<= s;
+
+ CORBA::ConstantDef_var cvar =
+ this->repo_->create_constant ("IDL:my_constant:1.0",
+ "my_constant",
+ "1.0",
+ ivar.in (),
+ any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::TypeCode_var tc = cvar->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::TCKind kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::type::kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_string);
+
+ CORBA::IDLType_var tdef =
+ cvar->type_def (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::DefinitionKind def_kind =
+ tdef->def_kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::type_def::def_kind: %d\n"),
+ def_kind));
+ }
+
+ ACE_ASSERT (def_kind == CORBA::dk_Primitive);
+
+ CORBA::Any_var out_any;
+ out_any = cvar->value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const char *out_s;
+ out_any >>= out_s;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (string): %s\n"),
+ out_s));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (out_s, s) == 0);
+
+ ivar = this->repo_->get_primitive (CORBA::pk_double
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ cvar->type_def (ivar.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Double double_val = -1223.42256;
+ any <<= double_val;
+ cvar->value (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
+
+ out_any = cvar->value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Double out_double_val;
+ out_any >>= out_double_val;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (double): %.5f\n"),
+ out_double_val));
+ }
+
+ ACE_ASSERT (out_double_val == double_val);
+
+ ivar = this->repo_->get_primitive (CORBA::pk_short
+ ACE_ENV_ARG_PARAMETER);
+ cvar->type_def (ivar.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
+
+ CORBA::Short short_val = -65;
+ any <<= short_val;
+
+ cvar->value (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ out_any = cvar->value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Short out_short_val;
+ out_any >>= out_short_val;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (short): %hd\n"),
+ out_short_val));
+ }
+
+ ACE_ASSERT (out_short_val == short_val);
+
+ ivar = this->repo_->get_primitive (CORBA::pk_float
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ cvar->type_def (ivar.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
+
+ CORBA::Float float_val = 2.33f;
+ any <<= float_val;
+
+ cvar->value (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ out_any = cvar->value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Float out_float_val;
+ out_any >>= out_float_val;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (float): %.2f\n"),
+ out_float_val));
+ }
+
+ ACE_ASSERT (out_float_val == float_val);
+
+ ivar = this->repo_->get_primitive (CORBA::pk_ulonglong
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ cvar->type_def (ivar.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nConstantDef::type_def (set)\n")
+ ACE_TEXT ("ConstantDef::value (set)\n")));
+ }
+
+ CORBA::ULongLong ull_val = 1234567890;
+ any <<= ull_val;
+
+ cvar->value (any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ out_any = cvar->value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULongLong out_ull_val;
+ out_any >>= out_ull_val;
+
+ if (this->debug_)
+ {
+#if defined (ACE_LACKS_LONGLONG_T)
+ char buffer[32];
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (ulonglong): %s\n"),
+ out_ull_val.as_string (buffer)));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("ConstantDef::value (ulonglong): %Q\n"),
+ out_ull_val));
+#endif
+ }
+ ACE_ASSERT (out_ull_val == ull_val);
+
+ cvar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::interface_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== INTERFACE TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::ULong i, length;
+
+ CORBA::InterfaceDefSeq in_bases (1);
+ in_bases.length (0);
+
+ CORBA::InterfaceDef_var gp_ivar =
+ this->repo_->create_interface ("IDL:gp_iface:1.0",
+ "gp_iface",
+ "1.0",
+ in_bases
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::PrimitiveDef_var p_long =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::AttributeDef_var gp_attr =
+ gp_ivar->create_attribute ("IDL:gp_iface/gp_attr:1.0",
+ "gp_attr",
+ "1.0",
+ p_long.in (),
+ CORBA::ATTR_NORMAL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ in_bases.length (1);
+ in_bases[0] = CORBA::InterfaceDef::_duplicate (gp_ivar.in ());
+
+ CORBA::InterfaceDef_var p_ivar =
+ this->repo_->create_interface ("IDL:p_iface:1.0",
+ "p_iface",
+ "1.0",
+ in_bases
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::StringDef_var p_string =
+ this->repo_->create_string (5 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::AttributeDef_var p_attr =
+ p_ivar->create_attribute ("IDL:p_iface/p_attr:1.0",
+ "p_attr",
+ "1.0",
+ p_string.in (),
+ CORBA::ATTR_READONLY
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ const char *names[] = {"inarg", "inoutarg", "outarg"};
+
+ const CORBA::ParameterMode modes[] =
+ {CORBA::PARAM_IN, CORBA::PARAM_INOUT, CORBA::PARAM_OUT};
+
+ const char *contexts[] = {"straw", "sticks", "bricks"};
+
+ length = 3;
+ CORBA::ParDescriptionSeq par_seq (3);
+ par_seq.length (3);
+
+ CORBA::StructMemberSeq members (0);
+ members.length (0);
+
+ CORBA::ExceptionDef_var ex_var =
+ this->repo_->create_exception ("IDL:if_exception:1.0",
+ "if_exception",
+ "1.0",
+ members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ExceptionDefSeq get_seq (1);
+ get_seq.length (1);
+ get_seq[0] = CORBA::ExceptionDef::_duplicate (ex_var.in ());
+
+ CORBA::ContextIdSeq con_seq (3);
+ con_seq.length (3);
+
+ for (i = 0; i < length; ++i)
+ {
+ par_seq[i].name = names[i];
+ par_seq[i].type_def = CORBA::PrimitiveDef::_duplicate (p_long.in ());
+ par_seq[i].type = p_long->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ par_seq[i].mode = modes[i];
+ con_seq[i] = contexts[i];
+ }
+
+ CORBA::OperationDef_var p_op =
+ p_ivar->create_operation ("IDL:p_iface/p_op:1.0",
+ "p_op",
+ "1.0",
+ p_long.in (),
+ CORBA::OP_NORMAL,
+ par_seq,
+ get_seq,
+ con_seq
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Contained::Description_var desc =
+ p_op->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::OperationDescription *od;
+ desc->value >>= od;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::value::")
+ ACE_TEXT ("defined_in: %s\n"),
+ od->defined_in.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (od->defined_in, "IDL:p_iface:1.0") == 0);
+
+ CORBA::TypeCode_var result = od->result;
+ CORBA::TCKind kind = result->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::result::")
+ ACE_TEXT ("kind: %d\n"),
+ kind));
+ }
+
+ ACE_ASSERT (kind == CORBA::tk_long);
+
+ length = od->parameters.length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nOperationDef::describe::parameters::")
+ ACE_TEXT ("length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 3);
+
+ const char *tmp = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ tmp = od->parameters[i].name;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::parameters[%d]::")
+ ACE_TEXT ("name: %s\n"),
+ i,
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (tmp, names[i]) == 0);
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("OperationDef::describe::parameters[%d]::")
+ ACE_TEXT ("mode: %d\n"),
+ i,
+ od->parameters[i].mode));
+ }
+
+ ACE_ASSERT (od->parameters[i].mode == modes[i]);
+ }
+
+ CORBA::Boolean is_it = p_ivar->is_a ("IDL:p_iface:1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::is_a (same class): %hd\n"),
+ is_it));
+ }
+
+ ACE_ASSERT (is_it == 1);
+
+ is_it = p_ivar->is_a ("IDL:gp_iface:1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::is_a (base class): %hd\n"),
+ is_it));
+ }
+
+ ACE_ASSERT (is_it == 1);
+
+ is_it = gp_ivar->is_a ("IDL:p_iface:1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::is_a (derived class): %hd\n"),
+ is_it));
+ }
+
+ ACE_ASSERT (is_it == 0);
+
+ CORBA::InterfaceDef::FullInterfaceDescription_var fifd =
+ p_ivar->describe_interface (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str = fifd->type->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("type::id: %s\n"),
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "IDL:p_iface:1.0") == 0);
+
+ length = fifd->operations.length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("operations::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ length = fifd->operations[0].contexts.length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("operations[3]::contexts::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 3);
+
+ for (i = 0; i < length; ++i)
+ {
+ tmp = fifd->operations[0].contexts[i];
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::describe_interface::")
+ ACE_TEXT ("operations[0]::contexts[%d]: %s\n"),
+ i,
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (tmp, contexts[i]) == 0);
+ }
+
+ length = fifd->operations[0].exceptions.length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("operations[0]::exceptions::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ for (i = 0; i < length; ++i)
+ {
+ const char *tmp = fifd->operations[0].exceptions[i].name;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::describe::operations[3]::")
+ ACE_TEXT ("contexts[%d]: %s\n"),
+ i,
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (tmp, "if_exception") == 0);
+ }
+
+ tmp = fifd->attributes[0].defined_in;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe_interface::")
+ ACE_TEXT ("attributes::defined_in: %s\n"),
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (tmp, "IDL:gp_iface:1.0") == 0);
+
+ in_bases[0] = CORBA::InterfaceDef::_duplicate (p_ivar.in ());
+
+ CORBA::InterfaceDef_var ivar =
+ this->repo_->create_interface ("IDL:iface:1.0",
+ "iface",
+ "1.0",
+ in_bases
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ desc = ivar->describe (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::InterfaceDescription *ifd;
+ desc->value >>= ifd;
+
+ length = ifd->base_interfaces.length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::describe::")
+ ACE_TEXT ("base_interfaces::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ const char *base_iface_id = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ base_iface_id = ifd->base_interfaces[i];
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::describe::")
+ ACE_TEXT ("base_interfaces[%d]: %s\n"),
+ i,
+ base_iface_id));
+ }
+ }
+
+ CORBA::InterfaceDefSeq_var out_bases =
+ ivar->base_interfaces (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_bases->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::base_interfaces::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = out_bases[i]->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::base_interfaces[%d]::name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+ }
+
+ CORBA::ContainedSeq_var contents = ivar->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 3);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = contents[i]->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::contents[%d]::name: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ CORBA::Container_var cr =
+ contents[i]->defined_in (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Contained_var cd =
+ CORBA::Contained::_narrow (cr.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = cd->name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("InterfaceDef::contents[%d]::")
+ ACE_TEXT ("defined_in::name: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "p_iface") == 0
+ || ACE_OS::strcmp (str.in (), "gp_iface") == 0);
+ }
+
+ ex_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ ivar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ gp_ivar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ p_ivar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::move_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== MOVE TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::EnumMemberSeq e_members (2);
+ e_members.length (2);
+
+ e_members[0] = CORBA::string_dup ("ZERO");
+ e_members[1] = CORBA::string_dup ("ONE");
+
+ CORBA::EnumDef_var e_var =
+ this->repo_->create_enum ("IDL:o_enum:1.0",
+ "o_enum",
+ "1.0",
+ e_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ e_members[0] = CORBA::string_dup ("TEN");
+ e_members[1] = CORBA::string_dup ("ELEVEN");
+
+ CORBA::EnumDef_var e_var2 =
+ this->repo_->create_enum ("IDL:i_enum:1.0",
+ "i_enum",
+ "1.0",
+ e_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::StructMemberSeq s_members (2);
+ s_members.length (2);
+
+ const char *s_names[] = {"s_string", "s_enum"};
+
+ s_members[0].name = s_names[0];
+ s_members[0].type_def =
+ this->repo_->get_primitive (CORBA::pk_string
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ s_members[0].type =
+ s_members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ s_members[1].name = s_names[1];
+ s_members[1].type_def = CORBA::EnumDef::_duplicate (e_var2.in ());
+ s_members[1].type =
+ s_members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::StructDef_var s_var =
+ this->repo_->create_struct ("IDL:o_struct:1.0",
+ "o_struct",
+ "1.0",
+ s_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::UnionMemberSeq u_members (2);
+ u_members.length (2);
+
+ const char *u_names[] = {"u_enum", "u_struct"};
+
+ u_members[0].name = u_names[0];
+ u_members[0].type_def = CORBA::EnumDef::_duplicate (e_var.in ());
+ u_members[0].type = e_var->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::Long label = 0;
+ CORBA::Any any;
+ any <<= label;
+ u_members[0].label = any;
+
+ u_members[1].name = u_names[1];
+ u_members[1].type_def = CORBA::StructDef::_duplicate (s_var.in ());
+ u_members[1].type = s_var->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ label = 1;
+ any <<= label;
+ u_members[1].label = any;
+
+ CORBA::PrimitiveDef_var d_var =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::UnionDef_var u_var =
+ this->repo_->create_union ("IDL:the_union:1.0",
+ "the_union",
+ "1.0",
+ d_var.in (),
+ u_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::UnionMemberSeq_var out_u_members =
+ u_var->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong length = out_u_members->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ CORBA::ULong i = 0;
+ const char *tmp = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ tmp = out_u_members[i].name;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (tmp, u_members[i].name) == 0);
+ }
+
+ CORBA::ContainedSeq_var out_contents =
+ u_var->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 0);
+
+ e_var->move (u_var.in (),
+ u_names[0],
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::move (into union)\n")));
+ }
+
+ out_u_members = u_var->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_u_members->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::members::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ for (i = 0; i < length; ++i)
+ {
+ tmp = out_u_members[i].name;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
+
+ if (i == 0)
+ {
+ ACE_ASSERT (ACE_OS::strcmp (tmp, "u_enum") == 0);
+ }
+ else
+ {
+ ACE_ASSERT (ACE_OS::strcmp (tmp, u_members[i].name) == 0);
+ }
+ }
+
+ out_contents = u_var->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ CORBA::String_var str;
+
+ for (i = 0; i < length; ++i)
+ {
+ str = out_contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("UnionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ if (i == 0)
+ {
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::the_union::u_enum") == 0);
+ }
+ }
+
+ e_var2->move (s_var.in (),
+ s_names[1],
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ s_var->move (u_var.in (),
+ u_names[1],
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nEnumDef::move (into struct)\n")
+ ACE_TEXT ("StructDef::move (into union)\n")));
+ }
+
+ out_contents = this->repo_->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nRepository::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ out_u_members = u_var->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_u_members->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::members::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ for (i = 0; i < length; ++i)
+ {
+ tmp = out_u_members[i].name;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (tmp, u_names[i]) == 0);
+ }
+
+ out_contents = u_var->contents (CORBA::dk_all,
+ 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nUnionDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ ACE_CString scoped ("::the_union::");
+ CORBA::StructDef_var s_tmp;
+ int cmp_result = 0;
+
+ for (i = 0; i < length; ++i)
+ {
+ str = out_contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("UnionDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ cmp_result =
+ ACE_OS::strcmp (str.in (), (scoped + u_names[i]).c_str ());
+
+ ACE_ASSERT (cmp_result == 0);
+
+ if (i == 1)
+ {
+ s_tmp = CORBA::StructDef::_narrow (out_contents[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ out_contents = s_tmp->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ const char *base = "::the_union::u_struct";
+
+ for (i = 0; i < length; ++i)
+ {
+ str = out_contents[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::contents[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()));
+ }
+
+ cmp_result =
+ ACE_OS::strncmp (str.in (), base, ACE_OS::strlen (base));
+
+ ACE_ASSERT (cmp_result == 0);
+ }
+
+#if defined (ACE_NDEBUG)
+ // ACE_ASSERT macro expands to nothing, so...
+ ACE_UNUSED_ARG (base);
+#endif /* ACE_NDEBUG */
+
+ CORBA::StructMemberSeq_var out_s_members =
+ s_tmp->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_s_members->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::members::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 2);
+
+ for (i = 0; i < length; ++i)
+ {
+ tmp = out_s_members[i].name;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
+ i,
+ tmp));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (tmp, s_names[i]) == 0);
+ }
+
+ u_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Admin_Client::module_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== MODULE TEST ==============\n\n")
+ ));
+ }
+
+ CORBA::ModuleDef_var outer =
+ this->repo_->create_module ("IDL:outer:1.0",
+ "outer",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ModuleDef_var middle =
+ outer->create_module ("IDL:outer/middle:1.0",
+ "middle",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ModuleDef_var inner =
+ middle->create_module ("IDL:outer/middle/inner:1.0",
+ "inner",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::InterfaceDefSeq in_bases (1);
+ in_bases.length (0);
+
+ CORBA::InterfaceDef_var p_iface =
+ outer->create_interface ("IDL:p_iface:1.0",
+ "p_iface",
+ "1.0",
+ in_bases
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ in_bases.length (1);
+ in_bases[0] = CORBA::InterfaceDef::_duplicate (p_iface.in ());
+
+ CORBA::InterfaceDef_var iface =
+ inner->create_interface ("IDL:iface:1.0",
+ "iface",
+ "1.0",
+ in_bases
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::PrimitiveDef_var p_void =
+ this->repo_->get_primitive (CORBA::pk_void
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ CORBA::PrimitiveDef_var p_long =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::AttributeDef_var attr =
+ p_iface->create_attribute ("IDL:iface/attr:1.0",
+ "attr",
+ "1.0",
+ p_void.in (),
+ CORBA::ATTR_NORMAL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong length = 3;
+ CORBA::ULong i = 0;
+
+ CORBA::ParDescriptionSeq par_seq (length);
+ par_seq.length (length);
+
+ CORBA::ContextIdSeq con_seq (length);
+ con_seq.length (length);
+
+ const char *p_names[] = {"inarg", "outarg", "inoutarg"};
+ const char *contexts[] = {"straw", "sticks", "bricks"};
+
+ for (i = 0; i < length; ++i)
+ {
+ par_seq[i].name = p_names[i];
+ par_seq[i].type_def = CORBA::PrimitiveDef::_duplicate (p_long.in ());
+ par_seq[i].type = p_long->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ par_seq[i].mode = static_cast<CORBA::ParameterMode> (i);
+
+ con_seq[i] = contexts[i];
+ }
+
+ CORBA::StructMemberSeq members (0);
+ members.length (0);
+
+ CORBA::ExceptionDef_var ex_var =
+ this->repo_->create_exception ("IDL:if_exception:1.0",
+ "if_exception",
+ "1.0",
+ members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ExceptionDefSeq get_seq (1);
+ get_seq.length (1);
+ get_seq[0] = CORBA::ExceptionDef::_duplicate (ex_var.in ());
+
+ CORBA::OperationDef_var op =
+ iface->create_operation ("IDL:iface/op:1.0",
+ "op",
+ "1.0",
+ p_void.in (),
+ CORBA::OP_NORMAL,
+ par_seq,
+ get_seq,
+ con_seq
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var str;
+
+ CORBA::Contained_var result =
+ inner->lookup ("::outer::middle::inner::iface::op"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = result->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ModuleDef::lookup (absolute)::absolute_name: %s\n"),
+ str.in ()
+ ));
+ }
+
+ int cmp_result =
+ ACE_OS::strcmp (str.in (), "::outer::middle::inner::iface::op");
+
+ ACE_ASSERT (cmp_result == 0);
+
+ result = middle->lookup ("inner::iface::op"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ str = result->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("ModuleDef::lookup (relative)::absolute_name: %s\n"),
+ str.in ()
+ ));
+ }
+
+ cmp_result =
+ ACE_OS::strcmp (str.in (), "::outer::middle::inner::iface::op");
+
+ ACE_ASSERT (cmp_result == 0);
+
+ CORBA::ContainedSeq_var cseq =
+ this->repo_->lookup_name ("op",
+ -1,
+ CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = cseq->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = cseq[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ cmp_result =
+ ACE_OS::strcmp (str.in (), "::outer::middle::inner::iface::op");
+
+ ACE_ASSERT (cmp_result == 0);
+ }
+
+ cseq = middle->lookup_name ("attr",
+ 3,
+ CORBA::dk_Attribute,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = cseq->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = cseq[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::outer::p_iface::attr") == 0);
+ }
+
+ iface->move (outer.in (),
+ "iface",
+ "1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nInterfaceDef::move (into outer module)\n")));
+ }
+
+ cseq = this->repo_->lookup_name ("op",
+ -1,
+ CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = cseq->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ for (i = 0; i < length; ++i)
+ {
+ str = cseq[i]->absolute_name (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("Repository::lookup_name[%d]::absolute_name: %s\n"),
+ i,
+ str.in ()
+ ));
+ }
+
+ ACE_ASSERT (ACE_OS::strcmp (str.in (), "::outer::iface::op") == 0);
+ }
+
+ ex_var->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ outer->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.h b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.h
new file mode 100644
index 00000000000..2c478800c52
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Admin_Client.h
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/InterfaceRepo
+//
+// = FILENAME
+// Admin_Client.h
+//
+// = DESCRIPTION
+// This class tests the functionality of the IFR methods by inserting
+// IR objects into the repository by hand, querying them, moving them,
+// and destroying them.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#if !defined (ADMIN_CLIENT_H)
+#define ADMIN_CLIENT_H
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/ORB.h"
+
+const CORBA::ULong NUMBER_OF_TESTS = 11;
+
+class Admin_Client
+{
+ // = TITLE
+ // Administrating IFR Client Implementation
+ //
+ // = DESCRIPTION
+ // Class wrapper for a client which puts the Interface Repository
+ // methods through their paces.
+public:
+ Admin_Client (void);
+ // Constructor
+
+ ~Admin_Client (void);
+ // Destructor
+
+ int init (int argc,
+ char *argv[]);
+ // Initialize the ORB and get the IFR object reference.
+
+ int run (void);
+ // Execute test code.
+
+private:
+ void array_test (ACE_ENV_SINGLE_ARG_DECL);
+ void enum_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void alias_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void native_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void struct_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void union_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void exception_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void constant_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void interface_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void move_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void module_test (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // The various IFR tests.
+
+ int parse_args (int argc,
+ char *argv[]);
+ // Process the command line arguments.
+
+ void (Admin_Client::*test_array_[NUMBER_OF_TESTS])(ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Array of pointers to the test functions.
+
+ static const char *test_names_[];
+ // Array of test names used in selection of one test.
+
+ CORBA::Boolean debug_;
+ // Flag to output results of IFR queries.
+
+ CORBA::Boolean all_tests_;
+ // Are we running all the tests or just one?
+
+ CORBA::ULong which_test_;
+ // Array index of the selected test function.
+
+ CORBA::ULong iterations_;
+ // # of times to run each test.
+
+ CORBA::ORB_var orb_;
+ // Storage of the ORB reference.
+
+ CORBA::Repository_var repo_;
+ // Storage of the IFR reference.
+};
+
+#endif /* ADMIN_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/IFR_IFR_Test.mpc b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/IFR_IFR_Test.mpc
new file mode 100644
index 00000000000..c351c9ef039
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/IFR_IFR_Test.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project: taoexe, ifr_client, minimum_corba {
+ exename = IFR_Test
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Makefile.am b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Makefile.am
new file mode 100644
index 00000000000..7df8ba75c5c
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.IFR_IFR_Test.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = IFR_Test
+
+IFR_Test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+IFR_Test_SOURCES = \
+ Admin_Client.cpp \
+ client.cpp \
+ Admin_Client.h
+
+IFR_Test_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/README b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/README
new file mode 100644
index 00000000000..45898fd7299
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/README
@@ -0,0 +1,113 @@
+$Id$
+
+Admin_Client is a class containing several functions which test
+the methods in various IFR object classes. Since automatic
+administration of the TAO Interface Repository has not yet been
+implemented, each of these functions creates, queries, modifies,
+moves, and finally destroys several IFR objects, none of which
+are related to anything found in an actual IDL file.
+
+Not every type of IFR object is represented by an Admin_Client
+function (the name of which gives a hint about what type of
+IFR object it tests). There are two reasons for this - the
+first being that there will almost certainly be more tests
+added later, and the second being that many of the functions
+test more than one IFR object type. For example, interface_test()
+tests not only the functionality of InterfaceDef, but also that
+of AttributeDef and OperationDef, since these IFR objects are
+created only by an InterfaceDef. In a similar way, alias_test()
+tests WstringDef and SequenceDef in addition to AliasDef, and
+StringDef and PrimitiveDef members are created and tested in
+struct_test(), union_test() and exception_test().
+
+To build this test, the TAO library, the TypeCodeFactory
+library, the Interface Repository (the last two found in
+TAO/orbsvcs/IFR_Service), and these test files must all be built.
+In addition, the Interface Repository requires the TAO_Svc_Utils
+library in TAO/orbsvcs/orbsvcs.
+
+To run this test, either use the Perl script run_test.pl, or
+
+
+
+(Windows)
+start the Interface Repository by typing
+
+ ..\..\..\IFR_Service\IFR_Service
+
+in one window, then (in another window)
+
+ IFR_Test -ORBInitRef InterfaceRepository=file://if_repo.ior
+
+(Unix)
+in this directory, type
+
+ ../../../IFR_Service/IFR_Service &
+
+then
+
+ ./IFR_Test -ORBInitRef InterfaceRepository=file://if_repo.ior
+
+
+
+You may use IP multicast discovery by starting the server with "-m 1"
+and use the default multicast address for the InterfaceRepository.
+
+ ../../../IFR_Service/IFR_Service -m 1
+
+and
+
+ ./IFR_Test
+
+You may add any of the options below to the IFR_Test command line. Both the
+Perl script and the test executable have the same command line options.
+They are:
+
+ -d Outputs the results of queries along with a string
+ explaining the sequence of calls and/or accesses
+ leading to each result. There is also informative
+ output when an IFR object is modified or moved.
+ Default output is the test name only.
+
+ -t (followed by test name - see below). This will
+ execute only the selected test. Default is to
+ execute all test functions.
+ Test names:
+ array
+ enum
+ alias
+ native
+ struct
+ union
+ exception
+ constant
+ interface
+ move
+ module
+
+
+ -i (followed by number of iterations). This will
+ cause each test function (or the selected one)
+ to be executed <n> times. A useful selection
+ here is -i 2. At the end of each test function,
+ all IFR objects created in that function are
+ destroyed. If the destroy() function does not
+ work properly, then the second execution will
+ raise a BAD_PARAM exception when the test
+ attempts to create the undestroyed object.
+
+ACE_ASSERT is used to check each result, so an incorrect result
+will cause test execution to halt immediately. If a test function
+is halted for this or any other reason, it is likely that the
+destroy() call(s) at the end of the function were not exectuted.
+Before running the test again, the Interface Repository process
+should be stopped and restarted to avoid a BAD_PARAM exception.
+
+The IFR server is started in this test with locking enabled. Even
+though the test itself is single-threaded, using this option will
+ensure that future modifications to IFR code don't cause deadlocks.
+
+More information about the Interface Repository can be found in
+TAO/docs/releasenotes.index.html.
+
+-Jeff Parsons <parsons@cs.wustl.edu> \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp
new file mode 100644
index 00000000000..aa3af160455
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/client.cpp
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Admin_Client.h"
+
+ACE_RCSID (IFR_Test,
+ client,
+ "$Id$")
+
+int main (int argc, char *argv[])
+{
+ Admin_Client admin_client;
+
+ int retval = admin_client.init (argc,
+ argv);
+
+ if (retval == -1)
+ {
+ return 1;
+ }
+
+ return admin_client.run ();
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl
new file mode 100755
index 00000000000..2c0c628e6ef
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl
@@ -0,0 +1,72 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$locking = "";
+
+$iorfile = "if_repo.ior";
+
+$status = 0;
+
+$nice = "";
+$debug = "";
+$test = "";
+$iterations = "";
+$other = "";
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-d") {
+ $debug = "-d";
+ }
+ elsif ($ARGV[$i] eq "-t") {
+ $test = "-t ".$ARGV[$i + 1];
+ $i++;
+ }
+ elsif ($ARGV[$i] eq "-i") {
+ $iterations = "-i ".$ARGV[$i + 1];
+ $i++;
+ }
+ else {
+ $other .= $ARGV[$i];
+ }
+}
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " $nice " . " -o $iorfile" . " $locking");
+$CL = new PerlACE::Process ("IFR_Test",
+ "-ORBInitRef InterfaceRepository=file://$iorfile"
+ . " $debug $test $iterations");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
new file mode 100644
index 00000000000..c29daa4ff2a
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.cpp
@@ -0,0 +1,257 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Latency_Query_Client.h"
+#include "ace/Get_Opt.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Stats.h"
+#include "ace/Sample_History.h"
+
+ACE_RCSID (Latency_Test,
+ Latency_Query_Client,
+ "$Id$")
+
+const CORBA::ULong DEFAULT_NUMCALLS = 20000;
+
+Latency_Query_Client::Latency_Query_Client (void)
+ : debug_ (false),
+ do_dump_history_ (0),
+ iterations_ (DEFAULT_NUMCALLS)
+{
+}
+
+Latency_Query_Client::~Latency_Query_Client (void)
+{
+}
+
+int
+Latency_Query_Client::init (int argc,
+ char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int retval = this->parse_args (argc,
+ argv);
+
+ if (retval != 0)
+ {
+ return retval;
+ }
+
+ CORBA::Object_var object =
+ this->orb_->resolve_initial_references ("InterfaceRepository"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (object.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ "Null objref from resolve_initial_references\n"
+ ),
+ -1
+ );
+ }
+
+ this->repo_ =
+ CORBA::Repository::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->repo_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CORBA::Repository::_narrow failed\n"),
+ -1);
+ }
+
+ retval = this->populate_ifr (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (retval != 0)
+ {
+ return retval;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Latency_Query_Client::init:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Latency_Query_Client::run (void)
+{
+// CORBA::DefinitionKind dk;
+ CORBA::AttributeMode am;
+
+ ACE_TRY_NEW_ENV
+ {
+ for (int j = 0; j < 100; ++j)
+ {
+ am = this->attr_->mode (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (am != CORBA::ATTR_NORMAL)
+ {
+ return -1;
+ }
+ }
+
+ ACE_Sample_History history (this->iterations_);
+ ACE_hrtime_t test_start = ACE_OS::gethrtime ();
+
+ for (CORBA::ULong i = 0; i < this->iterations_; ++i)
+ {
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ am = this->attr_->mode (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ history.sample (now - start);
+ }
+
+ ACE_hrtime_t test_end = ACE_OS::gethrtime ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "test finished\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "High resolution timer calibration...."));
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ ACE_DEBUG ((LM_DEBUG,
+ "done\n"));
+
+ if (this->do_dump_history_)
+ {
+ history.dump_samples ("HISTORY", gsf);
+ }
+
+ ACE_Basic_Stats stats;
+ history.collect_basic_stats (stats);
+ stats.dump_results ("Total", gsf);
+
+ ACE_Throughput_Stats::dump_throughput ("Total",
+ gsf,
+ test_end - test_start,
+ stats.samples_count ());
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Latency_Query_Client::run:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Latency_Query_Client::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Get_Opt opts (argc, argv, "dhi:");
+ int c;
+ int result = 0;
+
+ while ((c = opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'd':
+ this->debug_ = true;
+ break;
+ case 'h':
+ this->do_dump_history_ = true;
+ break;
+ case 'i':
+ result = ACE_OS::atoi (opts.opt_arg ());
+
+ if (result > 0)
+ {
+ this->iterations_ = result;
+ }
+
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-i iterations]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ }
+
+ return 0;
+}
+
+int
+Latency_Query_Client::populate_ifr (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Contained_var irobj = this->repo_->lookup_id ("IDL:dummy/attr:1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (! CORBA::is_nil (irobj.in ()))
+ {
+ this->attr_ = CORBA::AttributeDef::_narrow (irobj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->attr_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Latency_Query_Client::populate_ifr - "
+ "AttributeDef::_narrow returned null\n"),
+ -1);
+ }
+
+ return 0;
+ }
+
+ CORBA::InterfaceDefSeq in_bases (0);
+ in_bases.length (0);
+
+ CORBA::InterfaceDef_var iface =
+ this->repo_->create_interface ("IDL:dummy:1.0",
+ "dummy",
+ "1.0",
+ in_bases
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::PrimitiveDef_var p_long =
+ this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->attr_ =
+ iface->create_attribute ("IDL:dummt/attr:1.0",
+ "attr",
+ "1.0",
+ p_long.in (),
+ CORBA::ATTR_NORMAL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h
new file mode 100644
index 00000000000..fa223454637
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Query_Client.h
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/InterfaceRepo
+//
+// = FILENAME
+// Latency_Query_Client.h
+//
+// = DESCRIPTION
+// This class tests the latency of queries made on the IFR.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@isis-server.isis.vanderbilt.edu>
+//
+// ============================================================================
+
+#if !defined (LATENCY_QUERY_CLIENT_H)
+#define LATENCY_QUERY_CLIENT_H
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/ORB.h"
+
+class Latency_Query_Client
+{
+ // = TITLE
+ // Querying IFR Client Implementation
+ //
+ // = DESCRIPTION
+ // Class wrapper for a client which queries the Interface Repository.
+public:
+ Latency_Query_Client (void);
+ // Constructor
+
+ ~Latency_Query_Client (void);
+ // Destructor
+
+ int init (int argc,
+ char *argv[]);
+ // Initialize the ORB and get the IFR object reference.
+
+ int run (void);
+ // Execute test code.
+private:
+ int parse_args (int argc,
+ char *argv[]);
+ // Process the command line arguments.
+
+ int populate_ifr (ACE_ENV_SINGLE_ARG_DECL);
+ // Put in something to query about.
+
+private:
+ bool debug_;
+ // Toggle debugging output.
+
+ bool do_dump_history_;
+ // Toggle saving of dump history.
+
+ CORBA::ULong iterations_;
+ // Number of queries in a run.
+
+ CORBA::ORB_var orb_;
+ // Storage of the ORB reference.
+
+ CORBA::Repository_var repo_;
+ // Storage of the IFR reference.
+
+// CORBA::AliasDef_var tdef_;
+ // Storage of the typedef definition that we will query.
+
+ CORBA::AttributeDef_var attr_;
+ // Storage of the attribute definition we will query.
+};
+
+#endif /* LATENCY_QUERY_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Test.mpc b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Test.mpc
new file mode 100644
index 00000000000..f2cf973217a
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Latency_Test.mpc
@@ -0,0 +1,4 @@
+// $Id$
+project: ifr_client {
+ avoids += ace_for_tao
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Makefile.am b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Makefile.am
new file mode 100644
index 00000000000..269964f7a1a
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Latency_Test.am
+
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ Latency_Query_Client.cpp \
+ client.cpp \
+ Latency_Query_Client.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_ACE_FOR_TAO
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp
new file mode 100644
index 00000000000..43c9155ebb1
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/client.cpp
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Latency_Query_Client.h"
+
+ACE_RCSID (Latency__Test,
+ client,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ Latency_Query_Client client;
+
+ int retval = client.init (argc,
+ argv);
+
+ if (retval == -1)
+ {
+ return 1;
+ }
+
+ retval = client.run ();
+
+ return retval;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl
new file mode 100755
index 00000000000..6a3b2359b5f
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl
@@ -0,0 +1,69 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$iorfile = "if_repo.ior";
+
+$status = 0;
+$nice = "-ORBDottedDecimalAddresses 1";
+$debug = "";
+$history = "";
+$iterations = "";
+$other = "";
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-d") {
+ $debug = "-d";
+ }
+ elsif ($ARGV[$i] eq "-h") {
+ $history = "-h ";
+ $i++;
+ }
+ elsif ($ARGV[$i] eq "-i") {
+ $iterations = "-i ".$ARGV[$i + 1];
+ $i++;
+ }
+ else {
+ $other .= $ARGV[$i];
+ }
+}
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " $nice" . " -o $iorfile");
+$CL = new PerlACE::Process ("client",
+ "-ORBInitRef InterfaceRepository=file://$iorfile"
+ . " $debug $history $iterations");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Makefile.am b/TAO/orbsvcs/tests/InterfaceRepo/Makefile.am
new file mode 100644
index 00000000000..8d7805a1da0
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Makefile.am
@@ -0,0 +1,18 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ Application_Test \
+ IDL3_Test \
+ IFR_Inheritance_Test \
+ IFR_Test \
+ Latency_Test \
+ Persistence_Test
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/IFR_Persistence_Test.mpc b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/IFR_Persistence_Test.mpc
new file mode 100644
index 00000000000..57112a88744
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/IFR_Persistence_Test.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project: taoexe, ifr_client, minimum_corba {
+ exename = Persistence_Test
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Makefile.am b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Makefile.am
new file mode 100644
index 00000000000..9a124a27e7b
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.IFR_Persistence_Test.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = Persistence_Test
+
+Persistence_Test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+Persistence_Test_SOURCES = \
+ Ptest.cpp \
+ test.cpp \
+ Ptest.h
+
+Persistence_Test_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp
new file mode 100644
index 00000000000..10146a9a882
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.cpp
@@ -0,0 +1,270 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Ptest.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID(Persistence_Test, Ptest, "$Id$")
+
+Ptest::Ptest (void)
+ : debug_ (0),
+ query_ (0)
+{
+}
+
+Ptest::~Ptest (void)
+{
+}
+
+int
+Ptest::init (int argc,
+ char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int retval = this->parse_args (argc,
+ argv);
+
+ if (retval != 0)
+ return retval;
+
+ CORBA::Object_var object =
+ this->orb_->resolve_initial_references ("InterfaceRepository"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (object.in ()))
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ "Null objref from resolve_initial_references\n"
+ ),
+ -1
+ );
+ }
+
+ this->repo_ =
+ CORBA::Repository::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->repo_.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CORBA::Repository::_narrow failed\n"),
+ -1);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Ptest::init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Ptest::run (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (this->query_ == 1)
+ {
+ this->query (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ this->populate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Ptest::run");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+Ptest::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Get_Opt opts (argc, argv, "dq");
+ int c;
+
+ while ((c = opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ this->debug_ = 1;
+ break;
+ case 'q': // query toggle
+ this->query_ = 1;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-q]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ return 0;
+}
+
+void
+Ptest::populate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== POPULATE ==============\n\n")
+ ));
+ }
+
+ CORBA::StructMemberSeq members (2);
+ members.length (2);
+ members[0].name = CORBA::string_dup ("long_mem");
+ members[0].type_def = this->repo_->get_primitive (CORBA::pk_long
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[0].type = members[0].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ members[1].name = CORBA::string_dup ("array_mem");
+ members[1].type_def = this->repo_->create_array (5,
+ members[0].type_def.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ members[1].type = members[1].type_def->type (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ CORBA::StructDef_var svar = this->repo_->create_struct ("IDL:my_struct:1.0",
+ "my_struct",
+ "1.0",
+ members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::EnumMemberSeq def_members (2);
+ def_members.length (2);
+
+ def_members[0] = CORBA::string_dup ("ZERO");
+ def_members[1] = CORBA::string_dup ("ONE");
+
+ CORBA::EnumDef_var e_def_var = svar->create_enum ("IDL:my_def_enum:1.0",
+ "my_enum",
+ "1.0",
+ def_members
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Ptest::query (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->debug_)
+ {
+ ACE_DEBUG ((
+ LM_DEBUG,
+ ACE_TEXT ("\n============== QUERY ==============\n\n")
+ ));
+ }
+
+ const char *members[] =
+ {
+ "long_mem",
+ "array_mem",
+ "my_enum"
+ };
+
+ CORBA::ContainedSeq_var contents =
+ this->repo_->contents (CORBA::dk_all,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ULong length = contents->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Repository::contents::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 1);
+
+ CORBA::ULong i = 0;
+
+ CORBA::StructDef_var svar =
+ CORBA::StructDef::_narrow (contents[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (svar.in ()));
+
+ CORBA::StructMemberSeq_var out_members =
+ svar->members (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ length = out_members->length ();
+
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("\nStructDef::members::length: %d\n"),
+ length));
+ }
+
+ ACE_ASSERT (length == 3);
+
+ for (i = 0; i < length; ++i)
+ {
+ if (this->debug_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("StructDef::members[%d]::name: %s\n"),
+ i,
+ out_members[i].name.in ()));
+ }
+
+ if (i == length - 1)
+ {
+ ACE_ASSERT (ACE_OS::strcmp (out_members[i].name, "my_enum") == 0);
+ }
+ else
+ {
+ ACE_ASSERT (ACE_OS::strcmp (out_members[i].name, members[i]) == 0);
+ }
+ }
+
+#if defined (ACE_NDEBUG)
+ // ACE_ASSERT macro expands to nothing, so...
+ ACE_UNUSED_ARG (members);
+#endif /* ACE_NDEBUG */
+
+ svar->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h
new file mode 100644
index 00000000000..bec1b5d88c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/Ptest.h
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/InterfaceRepo
+//
+// = FILENAME
+// Ptest.h
+//
+// = DESCRIPTION
+// This code tests the persistence of the IFR by inserting
+// IR objects into the repository with one function, and querying the
+// repository with another, with a repository shutdown in between.
+//
+// = AUTHOR
+// Jeff Parsons <parsons@cs.wustl.edu>
+//
+// ============================================================================
+
+#if !defined (PTEST_H)
+#define PTEST_H
+
+#include "tao/IFR_Client/IFR_BasicC.h"
+#include "tao/ORB.h"
+
+class Ptest
+{
+ // = TITLE
+ // IFR Persistence test Implementation
+ //
+ // = DESCRIPTION
+ // Class wrapper for code which either populates or queries the
+ // Interface Repository. Designed to be used with a Perl script
+ // which can start and stop both this process and the repository
+ // process in the necessary order.
+public:
+ Ptest (void);
+ // Constructor
+
+ ~Ptest (void);
+ // Destructor
+
+ int init (int argc,
+ char *argv[]);
+ // Initialize the ORB and get the IFR object reference.
+
+ int run (void);
+ // Execute test code.
+
+private:
+ void populate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ void query (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ // The two IFR tests.
+
+ int parse_args (int argc,
+ char *argv[]);
+ // Process the command line arguments.
+
+ CORBA::Boolean debug_;
+ // Flag to output results of IFR queries.
+
+ CORBA::Boolean query_;
+ // Are we populating a new IFR or querying a persistent one?
+
+ CORBA::ORB_var orb_;
+ // Storage of the ORB reference.
+
+ CORBA::Repository_var repo_;
+ // Storage of the IFR reference.
+};
+
+#endif /* PTEST_H */
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README
new file mode 100644
index 00000000000..7eae42fd67c
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/README
@@ -0,0 +1,69 @@
+$Id$
+
+This test addresses the functionality of persistence in the
+Interface Repository.
+
+Ptest is a class wrapper for the test code. The class contains
+two functions: populate() and query().
+
+To build this test, the TAO library, the TypeCodeFactory
+library, the Interface Repository (the last two found in
+TAO/orbsvcs/IFR_Service), must be previously built. In addition,
+the Interface Repository requires the TAO_Svc_Utils library in
+TAO/orbsvcs/orbsvcs.
+
+It is far easier to run the test with the provided Perl script
+run_test.pl, but to do it by hand, first start the IFR with
+(Windows users remember to use backslashes instead):
+
+../../../IFR_Service/IFR_Service -p -m 1
+
+Then execute the test code with
+
+Persistence_Test
+
+This will populate the IFR with a few IFR objects.
+After the test finishes, stop the IFR. Then start it again
+with the same command line option. Then run the
+test code again with the query option:
+
+Persistence_Test -q
+
+You may also add the option -d to this second run of the test
+code to see the results of the IFR queries (this option will
+have the same effect if used with the Perl script).
+
+After the query run of the test code, before starting again, you must
+delete the IFR backing store file ("ifr_default_backing_store"). If you
+like you can use another persistence file by starting the IFR both times with
+the command line option '-p <filename>'. Just as with the default backing
+file, it must be deleted before starting the test over.
+
+The query run of the test code will also destroy all IFR objects that were
+created - the repository will be left empty except for the primitive kinds
+which are always there (and cannot be destroyed).
+
+If for some reason IP multicast is not available or enabled on your platform,
+then add
+
+ -ORBInitRef InterfaceRepository=file://if_repo.ior
+
+to the client's command line. If the IFR_Service has been started with the
+command line option -o <filename> (see the README file in the IFR_Service
+directory), then instead add
+
+ -ORBInitRef InterfaceRepository=file://<filename>
+
+to the client's command line.
+
+ACE_ASSERT is used to check each result, so an incorrect result
+will cause test execution to halt immediately. If a test function
+is halted for this or any other reason, it is likely that the
+destroy() call(s) at the end of the function were not exectuted.
+Before running the test again, the Interface Repository process
+should be stopped and restarted to avoid a BAD_PARAM exception.
+
+More information about the Interface Repository can be found in
+TAO/docs/releasenotes.index.html.
+
+-Jeff Parsons <parsons@cs.wustl.edu> \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
new file mode 100755
index 00000000000..8ded8407764
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
@@ -0,0 +1,95 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$persistent = "-p";
+
+$status = 0;
+
+$iorfile = "if_repo.ior";
+$backing_file = PerlACE::LocalFile ("ifr_default_backing_store");
+
+$init_ref = "-ORBInitRef InterfaceRepository=file://$iorfile";
+
+$debug = "";
+$query_opt = "-q";
+$other = "";
+
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-d") {
+ $debug = "-d";
+ }
+ else {
+ $other .= $ARGV[$i];
+ }
+}
+
+unlink $iorfile;
+unlink $backing_file;
+
+$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " -o $iorfile" . " $persistent");
+$T = new PerlACE::Process ("Persistence_Test");
+
+$IFR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
+}
+
+$T->Arguments ($init_ref);
+
+$test = $T->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: populate test returned $test\n";
+ $status = 1;
+}
+
+$server = $IFR->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: IFR returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+$IFR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
+}
+
+$T->Arguments ("$init_ref $debug $query_opt");
+
+
+$test = $T->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: query test returned $test\n";
+ $status = 1;
+}
+
+
+$server = $IFR->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: IFR returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+unlink $backing_file;
+
+exit $status;
+
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/svc.conf b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/svc.conf
new file mode 100644
index 00000000000..ea66c67064d
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static Resource_Factory "-ORBDropRepliesDuringShutdown 0"
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp
new file mode 100644
index 00000000000..2155c1c4c36
--- /dev/null
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/test.cpp
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+// $Id$
+
+#include "Ptest.h"
+
+ACE_RCSID (Persistence_Test,
+ test,
+ "$Id$")
+
+int main (int argc, char *argv[])
+{
+ Ptest ptest;
+
+ int retval = ptest.init (argc,
+ argv);
+
+ if (retval == -1)
+ return 1;
+
+ retval = ptest.run ();
+
+ return retval;
+}
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/Interoperable_Naming.mpc b/TAO/orbsvcs/tests/Interoperable_Naming/Interoperable_Naming.mpc
new file mode 100644
index 00000000000..831fed1a8d3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/Interoperable_Naming.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project: namingexe, portableserver {
+ exename = client
+}
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/Makefile.am b/TAO/orbsvcs/tests/Interoperable_Naming/Makefile.am
new file mode 100644
index 00000000000..bea2ef61ae1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/Makefile.am
@@ -0,0 +1,86 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Interoperable_Naming.am
+
+BUILT_SOURCES = \
+ Web_ServerC.cpp \
+ Web_ServerC.h \
+ Web_ServerC.inl \
+ Web_ServerS.cpp \
+ Web_ServerS.h \
+ Web_ServerS.inl \
+ Web_ServerS_T.cpp \
+ Web_ServerS_T.h \
+ Web_ServerS_T.inl
+
+CLEANFILES = \
+ Web_Server-stamp \
+ Web_ServerC.cpp \
+ Web_ServerC.h \
+ Web_ServerC.inl \
+ Web_ServerS.cpp \
+ Web_ServerS.h \
+ Web_ServerS.inl \
+ Web_ServerS_T.cpp \
+ Web_ServerS_T.h \
+ Web_ServerS_T.inl
+
+Web_ServerC.cpp Web_ServerC.h Web_ServerC.inl Web_ServerS.cpp Web_ServerS.h Web_ServerS.inl Web_ServerS_T.cpp Web_ServerS_T.h Web_ServerS_T.inl: Web_Server-stamp
+
+Web_Server-stamp: $(srcdir)/Web_Server.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/Web_Server.idl
+ @touch $@
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ Web_ServerC.cpp \
+ Web_ServerS.cpp \
+ client.cpp \
+ ncontextext_client_i.cpp \
+ Web_ServerC.h \
+ Web_ServerC.inl \
+ Web_ServerS.h \
+ Web_ServerS.inl \
+ Web_ServerS_T.h \
+ Web_ServerS_T.inl \
+ ncontextext_client_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/README b/TAO/orbsvcs/tests/Interoperable_Naming/README
new file mode 100644
index 00000000000..81501320d70
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/README
@@ -0,0 +1,39 @@
+// $Id$
+
+This application tests the implementation of the CosNaming::NamingContextExt
+interface.
+
+To run the test automatically -
+ execute Perl script run_test.pl
+
+To run tests manually -
+ start the Naming Service (see
+ TAO/orbsvcs/Naming_Service/README for valid options),
+ then run ./client with one of the options below.
+
+NOTE: if running tests manually, Naming Service has to be restarted
+before each test (this is due to the test not 'cleaning up' bindings
+after themselves).
+
+The following options exist:
+----------------------------
+
+-o Run the client so that output is printed.
+
+If no option is specified, the test is run and no output is printed.
+
+DESCRIPTION AND EXPECTED OUTPUT
+===============================
+
+Performs the to_string, to_name (), to_url () and resolve_str () methods on
+the given Name or stringified name.
+
+Expected Output:
+
+ If the -o option is specified, prints out the outputs of the
+to_string (), to_name () and to_url () functions. If no option is specified,
+completes with no output.
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/Web_Server.idl b/TAO/orbsvcs/tests/Interoperable_Naming/Web_Server.idl
new file mode 100644
index 00000000000..97bda28066e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/Web_Server.idl
@@ -0,0 +1,26 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Interoperable_Naming/
+//
+// = FILENAME
+// Web_Server.idl
+//
+// = DESCRIPTION
+// IDL schema definition for Web server interface.
+//
+// = AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//
+// ============================================================================
+
+module Web_Server
+{
+ interface Iterator_Factory
+ {
+ };
+
+};
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/client.cpp b/TAO/orbsvcs/tests/Interoperable_Naming/client.cpp
new file mode 100644
index 00000000000..a7b13988c33
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/client.cpp
@@ -0,0 +1,47 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Interoperable_Naming/
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// This implements a simple CORBA client for the
+// CosNaming::NamingContextExt example
+//
+// = AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//
+// ============================================================================
+
+#include "ncontextext_client_i.h"
+
+int main (int argc, char *argv [])
+{
+ int result = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ NContextExt_Client_i client;
+
+ if (client.init (argc, argv) != 0)
+ return 1;
+
+ result = client.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.cpp b/TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.cpp
new file mode 100644
index 00000000000..2f6f2d7ad72
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.cpp
@@ -0,0 +1,355 @@
+// $Id$
+//
+
+// ===========================================================
+//
+// = LIBRARY
+// TAO/ORBSVCS/tests/SimpleNaming
+//
+// = FILENAME
+// ncontextext_client_i.cpp
+//
+// = DESCRIPTION
+// This class implements a simple CORBA client which
+// converts a Name to a string and viceversa, forms a IIOPNAME
+// url address and can resolve a stringified name.
+//
+// = AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//============================================================
+
+#include "ncontextext_client_i.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+
+// Constructor
+NContextExt_Client_i::NContextExt_Client_i (void)
+{
+}
+
+NContextExt_Client_i::~NContextExt_Client_i (void)
+{
+}
+
+
+// Parses the command line arguments and returns an
+// error status
+int
+NContextExt_Client_i::parse_args (void)
+{
+
+ ACE_Get_Opt get_opts (argc_, argv_, "dvs");
+ int c;
+
+ this->view_ = 1;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case 'v': // output needed
+ this->view_ = 0;
+ break;
+ case 's':
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-v]"
+ "\n",
+ this->argv_ [0]),
+ -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+char *
+NContextExt_Client_i::get_name ()
+{
+
+ // USe time (NULL) to produce the seed:
+ srand (time (0));
+
+ const int len = 10;
+ char *name_component = CORBA::string_alloc (len);
+ char *name_componentPtr = name_component;
+
+
+ for (int i = 0; i < len; ++i)
+ {
+
+ int rand_value = rand () % 10;
+
+ switch (rand_value)
+ {
+ case 0:
+ *name_componentPtr = '/';
+ ++name_componentPtr;
+ break;
+
+ case 1:
+ *name_componentPtr = '.';
+ ++name_componentPtr;
+ break;
+
+ case 2:
+ *name_componentPtr = '\\';
+ ++name_componentPtr;
+ break;
+
+ case 3:
+ *name_componentPtr = '<';
+ ++name_componentPtr;
+ break;
+
+ case 4:
+ *name_componentPtr = '>';
+ ++name_componentPtr;
+ break;
+
+ case 5:
+ *name_componentPtr = ' ';
+ ++name_componentPtr;
+ break;
+
+ case 6:
+ *name_componentPtr = '%';
+ ++name_componentPtr;
+ break;
+
+ case 7:
+ case 8:
+ case 9:
+ *name_componentPtr = 'A' + ( rand () % 26 );
+ ++name_componentPtr;
+ break;
+
+ default:
+ ACE_ERROR ((LM_ERROR, "shouldnt come here"));
+ break;
+ }
+ }
+
+ *name_componentPtr = '\0';
+
+ return name_component;
+
+}
+
+int
+NContextExt_Client_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ ACE_TRY_EX (OuterBlock)
+ {
+ CosNaming::Name name;
+
+ name.length (2);
+ name[0].id = CORBA::string_dup (this->get_name ());
+ name[0].kind = CORBA::string_dup (this->get_name ());
+ name[1].id = CORBA::string_dup ("Iterator_Factory");
+ name[1].kind = CORBA::string_dup ("factory");
+
+ // Get the stringified form of the name
+ CORBA::String_var str_name =
+ this->naming_context_->to_string (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (OuterBlock);
+
+ CORBA::Object_var factory_object;
+
+ ACE_TRY_EX (InnerBlock)
+ {
+ // Resolve the name using the stringified form of the name
+ factory_object =
+ this->naming_context_->resolve_str (str_name.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (InnerBlock);
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ }
+ ACE_ENDTRY;
+
+ // Narrow
+ Web_Server::Iterator_Factory_var factory =
+ Web_Server::Iterator_Factory::_narrow (factory_object.in () ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK_EX (OuterBlock);
+
+ // Create bindings
+ CosNaming::BindingIterator_var iter;
+ CosNaming::BindingList_var bindings_list;
+
+ this->naming_context_->list (2,
+ bindings_list.out (),
+ iter.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (OuterBlock);
+
+ // Convert the stringified name back as CosNaming::Name and print
+ // them out.
+ CosNaming::Name *nam =
+ this->naming_context_->to_name (str_name.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (OuterBlock);
+
+ // Declare a CosNaming::Name variable and assign length to it.
+ CosNaming::Name nm;
+ nm.length (nam->length ());
+
+ nm = *nam;
+
+ // Test the to_url function:
+ // For the address, we are assigning
+ // some random address now. But, in real applications, the address
+ // denotes the address of the NamingContext possibly returned from
+ // the LocateReply or LOCATION_FORWARD reply by an agent listening
+ // at that address
+ //
+ CORBA::String_var address =
+ CORBA::string_dup (":myhost.555xyz.com:9999");
+
+ // Since we are just testing the functionality of the to_url
+ // function, use a random object name.
+ CORBA::String_var obj_name = get_name ();
+
+ CORBA::String_var url_string =
+ this->naming_context_->to_url (address.in (),
+ obj_name.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (OuterBlock);
+
+ if (this->view_ == 0)
+ {
+ this->print_values (name,
+ str_name,
+ nm,
+ obj_name,
+ url_string);
+ }
+ }
+ ACE_CATCH (CORBA::NO_MEMORY, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "A system exception oc client side");
+ return -1;
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "A system exception oc client side");
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+NContextExt_Client_i::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ // First initialize the ORB, that will remove some arguments...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "" /* the ORB name, it can be anything! */
+ ACE_ENV_ARG_PARAMETER);
+
+ // There must be at least one argument, the file that has to be
+ // retrieved
+ if (this->parse_args () == -1)
+ return 1;
+
+ // Get a reference to the Naming Service
+ CORBA::Object_var naming_context_object =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (naming_context_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot resolve Naming Service\n"),
+ 1);
+
+ // Narrow to get the correct reference
+ this->naming_context_ =
+ CosNaming::NamingContextExt::_narrow (naming_context_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->naming_context_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot narrow Naming Service\n"),
+ 1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+NContextExt_Client_i::print_values (CosNaming::Name name,
+ CORBA::String_var str_name,
+ CosNaming::Name nm,
+ CORBA::String_var obj_name,
+ CORBA::String_var url_string)
+{
+
+ ACE_DEBUG((LM_DEBUG, ACE_TEXT ("The first component id is %s,"
+ "The first component kind is %s,"
+ "The second component id is %s,"
+ "The second component kind is %s\n\n"),
+ name[0].id.in (),
+ name[0].kind.in (),
+ name[1].id.in (),
+ name[1].kind.in ()));
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("The string form of the input name is: \n%s\n\n"),
+ str_name.in ()));
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("The unstringified version of the name components are:,"
+ "The first component id is %s,"
+ "The first component kind is %s,"
+ "The second component id is %s,"
+ "The second component kind is %s\n\n"),
+ nm[0].id.in (),
+ nm[0].kind.in (),
+ nm[1].id.in (),
+ nm[1].kind.in ()));
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("When the address of the NamingContext is:"
+ "myhost.555xyz.com:9999"
+ "and the Object name is \n%s\n"),
+ obj_name.in ()));
+
+ ACE_DEBUG ((LM_DEBUG,ACE_TEXT ("The URL form of the string is \n %s\n"),
+ url_string.in ()));
+
+}
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.h b/TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.h
new file mode 100644
index 00000000000..930aeaf426a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/ncontextext_client_i.h
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+// $Id$
+
+// ===========================================================
+//
+// = LIBRARY
+// TAO/ORBSVCS/tests/SimpleNaming
+//
+// = FILENAME
+// ncontextext_client_i.h
+//
+// = DESCRIPTION
+// This class implements a simple CORBA client which
+// converts a Name to a string and viceversa, forms a IIOPNAME
+// url address and can resolve a stringified name.
+//
+// = AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//============================================================
+
+
+#if !defined (NCONTEXTEXT_CLIENT_I_H)
+#define NCONTEXTEXT_CLIENT_I_H
+
+#include "Web_ServerC.h"
+#include "orbsvcs/CosNamingC.h"
+
+class NContextExt_Client_i
+{
+ // = TITLE
+ // NContextExt Client Implementation
+ //
+ // = DESCRIPTION
+ //
+
+ public:
+ // = COnstructor and destructor.
+ NContextExt_Client_i (void);
+ ~NContextExt_Client_i (void);
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Execute the client example code.
+
+ int init (int argc, char **argv);
+ // Initialize the client communication endpoint with the server.
+
+ private:
+
+ int parse_args (void);
+ // Parses the arguments passed on the command line.
+
+ void print_values (CosNaming::Name name,
+ CORBA::String_var str_name,
+ CosNaming::Name nm,
+ CORBA::String_var obj_name,
+ CORBA::String_var url_string);
+ // Prints the values of the original name, strigified name and
+ // destringified name. Also, prints the value of the address of the
+ // naming context, a name that identifies a binding in that naming
+ // context and the corresponding iioploc URL
+ // representation.
+
+ char * get_name (void);
+ // Generates a random name
+
+ int argc_;
+ // # of arguments on the command line.
+
+ char **argv_;
+ // arguments from command line.
+
+ CosNaming::NamingContextExt_var naming_context_;
+ // Naming context
+
+ CORBA::Boolean view_;
+ // Flag to check if '-v' option is set.
+
+};
+
+#endif /* NCONTEXTEXT_CLIENT_I_H */
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl b/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl
new file mode 100755
index 00000000000..12b26792aa8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Interoperable_Naming/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;
+
+# $Id$
+# -*- perl -*-
+
+# This is a perl script that runs the NamingContextExt test. It starts
+# the Naming service, server and the client as necessary
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 8;
+
+# Variables for command-line arguments to client and server
+# executables
+$iorfile = PerlACE::LocalFile ("ns.ior");
+
+# Run the server and client for the test.
+
+$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o $iorfile");
+$CL = new PerlACE::Process ("client", "-s -ORBInitRef NameService=file://$iorfile");
+
+# Make sure the files are gone, so we can wait on them.
+unlink $iorfile;
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, $sleeptime) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: server returned $nserver\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Application_Controlled.mpc b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Application_Controlled.mpc
new file mode 100644
index 00000000000..91756218ae9
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Application_Controlled.mpc
@@ -0,0 +1,32 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*server): orbsvcsexe, portablegroup, loadbalancing, naming, svc_utils {
+ after += *idl
+ Source_Files {
+ server.cpp
+ LB_server.cpp
+ Basic.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*client): orbsvcsexe, portablegroup, loadbalancing, naming, svc_utils {
+ after += *idl
+ Source_Files {
+ client.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp
new file mode 100644
index 00000000000..0fc3f158fc1
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp
@@ -0,0 +1,72 @@
+#include "Basic.h"
+#include "LB_server.h"
+
+
+ACE_RCSID (Application_Controlled,
+ Basic,
+ "$Id$")
+
+
+Basic::Basic (CORBA::Object_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ const char *loc)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+ this->object_group_ = CORBA::Object::_duplicate (object_group);
+ this->lm_ = CosLoadBalancing::LoadManager::_duplicate (lm);
+ this->location_ = CORBA::string_dup (loc);
+}
+
+char *
+Basic::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup (this->location_);
+}
+
+void
+Basic::remove_member (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+ location[0].id = CORBA::string_dup (this->location_);
+ this->lm_->remove_member (this->object_group_.in (),
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Removed Member at Location <%s>\n",
+ this->location_));
+
+ }
+ ACE_CATCH (PortableGroup::ObjectNotFound, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ "Caught exception in remove_member");
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCH (PortableGroup::MemberNotFound, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ "Caught exception in remove_member");
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught while destroying member\n");
+ }
+ ACE_ENDTRY;
+
+}
+
+void
+Basic::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.h
new file mode 100644
index 00000000000..72a6aeb8977
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef BASIC_H
+#define BASIC_H
+
+#include "TestS.h"
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "orbsvcs/PortableGroupC.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+class LB_Basic_Test;
+
+/// Implement the Test::Basic interface
+class Basic
+ : public virtual POA_Test::Basic
+{
+public:
+ /// Constructor
+ Basic (CORBA::Object_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ const char *loc);
+
+ virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void remove_member (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to convert strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+
+ /// Load Manager Reference used to delete the servant reference from the
+ /// object group.
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// location of the servant
+ const char *location_ ;
+
+ /// Object Group reference.
+ CORBA::Object_var object_group_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* BASIC_H */
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp
new file mode 100644
index 00000000000..f112c8a0af6
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp
@@ -0,0 +1,212 @@
+#include "LB_server.h"
+#include "Basic.h"
+
+#include "TestC.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Application_Controlled,
+ LB_server,
+ "$Id$")
+
+LB_server::LB_server (int argc, char **argv)
+ : argc_ (argc)
+ , argv_ (argv)
+{
+}
+
+int
+LB_server::destroy (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->lm_->delete_object (this->fcid_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught while destroying LB_server\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 1;
+
+}
+
+CORBA::ORB_ptr
+LB_server::orb (void)
+{
+ return this->orb_.in ();
+}
+
+CORBA::Object_ptr
+LB_server::object_group (void)
+{
+ return this->object_group_.in ();
+}
+
+CosLoadBalancing::LoadManager_ptr
+LB_server::load_manager (void)
+{
+ return this->lm_.in ();
+}
+
+int
+LB_server::write_ior_to_file (const char *ior)
+{
+ FILE *output_file =
+ ACE_OS::fopen ("obj.ior", "w");
+
+ if (output_file == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot open output file for writing IOR:"));
+ return -1;
+ }
+
+ ACE_OS::fprintf (output_file, "%s", ior);
+ ACE_OS::fclose (output_file);
+ return 0;
+}
+
+int
+LB_server::start_orb_and_poa (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialise the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("LoadManager" ACE_ENV_ARG_PARAMETER);
+
+ this->lm_ =
+ CosLoadBalancing::LoadManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->lm_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get Load Manager Reference\n"),
+ 1);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised initialising ORB or POA");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+
+}
+
+int
+LB_server::create_object_group (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ const char *repository_id = "IDL:Test/Basic:1.0";
+
+ PortableGroup::Criteria criteria (1);
+ criteria.length (1);
+
+ PortableGroup::Property &property = criteria[0];
+ property.nam.length (1);
+
+ property.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MembershipStyle");
+
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_APP_CTRL;
+ property.val <<= msv;
+
+ this->object_group_ = this->lm_->create_object (repository_id,
+ criteria,
+ this->fcid_.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (this->object_group_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->write_ior_to_file (ior.in ());
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while creating object group");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+
+}
+
+int
+LB_server::register_servant (Basic *servant, const char *loc)
+{
+ ACE_TRY_NEW_ENV
+ {
+ Test::Basic_var basic =
+ servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Location location (1);
+ location.length (1);
+
+ location[0].id = CORBA::string_dup (loc);
+
+ this->lm_->add_member (this->object_group_.in (),
+ location,
+ basic.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while registering servant");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.h
new file mode 100644
index 00000000000..c82ed1c073b
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.h
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_server.h
+ *
+ * $Id$
+ *
+ * @author Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "tao/PortableServer/PortableServer.h"
+
+// Forward Declaration of the kind of servant we would like to handle
+// by the server.
+class Basic;
+
+/**
+ * @class LB_server
+ *
+ * @brief Encapsulate the test in class.
+ *
+ * This is a class used to retrieve the LoadManager reference and
+ * create the Object Group. Servants add themselves to the object
+ * group and the object group reference is published to the clients.
+ * Clients then invoke the "servant operations" on the LoadManager
+ * itself. At this point the Load Balancing cycle starts.
+ */
+class LB_server
+{
+public:
+
+ /// Constructor
+ LB_server (int argc, char **argv);
+
+ /// destroys LoadManager, ORB and POA.
+ int destroy (void);
+
+ /// start the ORB.
+ int start_orb_and_poa (void);
+
+ /// Get the LoadManager Interface.
+ int init (int argc, char **argv);
+
+ /// Create the Object Group using the Load Manager Reference.
+ int create_object_group (void);
+
+ /// register the servants with the object group.
+ int register_servant (Basic *servant, const char *loc);
+
+ /// for servants to register to the initialised ORB.
+ CORBA::ORB_ptr orb (void);
+
+ /// for servants to get the reference for object_group.
+ CORBA::Object_ptr object_group (void);
+
+ /// for servants to get the reference for object_group.
+ CosLoadBalancing::LoadManager_ptr load_manager (void);
+
+private:
+
+ /// Load Manager
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// Object Group.
+ CORBA::Object_var object_group_;
+
+ /// factory id for the object group.
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid_;
+
+ /// Used to force the creation of the object group only once.
+ static int called_once_;
+
+ /// write the IOR to a file so that it can be read later.
+ int write_ior_to_file (const char *);
+
+ CORBA::ORB_var orb_;
+ int argc_;
+ char **argv_;
+ PortableServer::POA_var root_poa_;
+};
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Makefile.am b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Makefile.am
new file mode 100644
index 00000000000..17331079c93
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Makefile.am
@@ -0,0 +1,147 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Application_Controlled_Idl.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.Application_Controlled_Client.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ TestC.cpp \
+ client.cpp \
+ Basic.h \
+ LB_server.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosLoadBalancing.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.Application_Controlled_Server.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ Basic.cpp \
+ LB_server.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ Basic.h \
+ LB_server.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosLoadBalancing.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/README b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/README
new file mode 100644
index 00000000000..107953609c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/README
@@ -0,0 +1,11 @@
+This program tests the application controlled membership support
+of the Cygnus load balancer. The aim is to allow the application
+to create the replicas and then forcefully add them as the members
+of the object group maintained by the Cygnus load balancer. When
+the clients make a request on the IOR exported by the load
+balancer, the load balancer makes use of the round robin algorithm
+to make a call on any of the object group members registered with
+the load balancer.
+
+Please see $TAO_ROOT/orbsvcs/orbsvcs/Loadbalancing for the implementations
+of the Cygnus load balancer.
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Test.idl b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Test.idl
new file mode 100644
index 00000000000..0c9a380b07c
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Test.idl
@@ -0,0 +1,23 @@
+//
+// $Id$
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ /// A very simple interface
+ interface Basic
+ {
+ /// Return a simple string
+ string get_string ();
+
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+
+ /// A method to remove the servant from the LoadManager Object Group.
+ oneway void remove_member ();
+ };
+};
+
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp
new file mode 100644
index 00000000000..3a588d90066
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp
@@ -0,0 +1,92 @@
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID (Application_Controlled,
+ client,
+ "$Id$")
+
+const char *ior = "file://obj.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Basic_var basic =
+ Test::Basic::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (basic.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Basic reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ for (int i = 0; i < 5; i++)
+ {
+ CORBA::String_var the_string =
+ basic->get_string (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Client request handled by object at <%s>\n",
+ the_string.in ()));
+ }
+
+ basic->remove_member (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ basic->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught in client.cpp:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/run_test.pl b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/run_test.pl
new file mode 100755
index 00000000000..80b2f8e1838
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/run_test.pl
@@ -0,0 +1,86 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../bin";
+use PerlACE::Run_Test;
+
+$iorfile = PerlACE::LocalFile ("obj.ior");
+unlink $iorfile;
+
+$lm_ior = "lm.ior";
+unlink $lm_ior;
+
+$status = 0;
+
+## The LoadManager needs to register signals with the ORB's reactor (on
+## Windows only) and thus can not use the TP Reactor since it doesn't
+## support that kind of thing. So, we swith to the Select MT Reactor.
+$lm_conf = PerlACE::LocalFile ("windows$PerlACE::svcconf_ext");
+
+$init_ref = "-ORBInitRef LoadManager=file://lm.ior";
+
+$LM = new PerlACE::Process ("../../../../LoadBalancer/LoadManager",
+ "-o lm.ior" . ($^O eq 'MSWin32' ?
+ " -ORBSvcConf $lm_conf" : ''));
+$SV = new PerlACE::Process ("server", $init_ref);
+$CL = new PerlACE::Process ("client", " -k file://$iorfile");
+
+print STDERR "\n\n======== Running Application Controlled Membership Test================\n";
+print STDERR "\n";
+
+print STDERR "This test uses the Random Load Balancing strategy in the Cygnus Load Balancer\n";
+
+print STDERR "6 servers are created and added into a Object Group\n";
+
+print STDERR "When the client makes an invocation, Random load balancing strategy\n";
+print STDERR "selects one of the servers and then the client makes 5 invocations on\n";
+print STDERR "the server. When done, the application has to delete the object from the\n";
+print STDERR "object group. This is called the application controlled membership of\n";
+print STDERR "object group.\n";
+print STDERR "\n";
+
+$LM->Spawn ();
+
+if (PerlACE::waitforfile_timed ("lm.ior", 5) == -1) {
+ print STDERR "ERROR: cannot find file LoadManager IOR: lm.ior\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find server file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (100);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+$load_manager = $LM->TerminateWaitKill (10);
+
+if ($load_manager != 0) {
+ print STDERR "ERROR: LoadManager returned $load_manager\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+unlink $lm_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp
new file mode 100644
index 00000000000..68236f62685
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp
@@ -0,0 +1,112 @@
+#include "LB_server.h"
+#include "Basic.h"
+
+ACE_RCSID (Application_Controlled,
+ server,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ const char *location1 = "MyLocation 1";
+ const char *location2 = "MyLocation 2";
+ const char *location3 = "MyLocation 3";
+ const char *location4 = "MyLocation 4";
+ const char *location5 = "MyLocation 5";
+ const char *location6 = "MyLocation 6";
+
+ LB_server lb_server (argc, argv);
+
+ if (lb_server.start_orb_and_poa () == -1)
+ return 1;
+
+ if (lb_server.create_object_group () == -1)
+ return 1;
+
+ Basic *basic_servant1;
+ Basic *basic_servant2;
+ Basic *basic_servant3;
+ Basic *basic_servant4;
+ Basic *basic_servant5;
+ Basic *basic_servant6;
+
+ ACE_NEW_RETURN (basic_servant1,
+ Basic (lb_server.object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ location1),
+ 1);
+ PortableServer::ServantBase_var owner_transfer1(basic_servant1);
+
+ ACE_NEW_RETURN (basic_servant2,
+ Basic (lb_server.object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ location2),
+ 1);
+ PortableServer::ServantBase_var owner_transfer2(basic_servant2);
+
+ ACE_NEW_RETURN (basic_servant3,
+ Basic (lb_server.object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ location3),
+ 1);
+ PortableServer::ServantBase_var owner_transfer3(basic_servant3);
+
+ ACE_NEW_RETURN (basic_servant4,
+ Basic (lb_server.object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ location4),
+ 1);
+ PortableServer::ServantBase_var owner_transfer4(basic_servant4);
+
+ ACE_NEW_RETURN (basic_servant5,
+ Basic (lb_server.object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ location5),
+ 1);
+ PortableServer::ServantBase_var owner_transfer5(basic_servant5);
+
+ ACE_NEW_RETURN (basic_servant6,
+ Basic (lb_server.object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ location6),
+ 1);
+ PortableServer::ServantBase_var owner_transfer6(basic_servant6);
+
+ if (lb_server.register_servant (basic_servant1, location1) == -1
+ || lb_server.register_servant (basic_servant2, location2) == -1
+ || lb_server.register_servant (basic_servant3, location3) == -1
+ || lb_server.register_servant (basic_servant4, location4) == -1
+ || lb_server.register_servant (basic_servant5, location5) == -1
+ || lb_server.register_servant (basic_servant6, location6) == -1)
+ {
+ (void) lb_server.destroy ();
+ return 1;
+ }
+
+ lb_server.orb ()->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ if (lb_server.destroy () == -1)
+ return 1;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "lb_server exception");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/svc.conf b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/svc.conf
new file mode 100644
index 00000000000..ea66c67064d
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/svc.conf
@@ -0,0 +1,2 @@
+# $Id$
+static Resource_Factory "-ORBDropRepliesDuringShutdown 0"
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf
new file mode 100644
index 00000000000..06c425e3ecf
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf
@@ -0,0 +1,3 @@
+# $Id $
+
+dynamic Advanced_Resource_Factory Service_Object* TAO_Strategies:_make_TAO_Advanced_Resource_Factory () "-ORBReactorType select_mt"
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf.xml b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf.xml
new file mode 100644
index 00000000000..289810f7d22
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/windows.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from windows.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id $ -->
+ <dynamic id="Advanced_Resource_Factory" type="Service_Object">
+ <initializer path="TAO_Strategies" init="_make_TAO_Advanced_Resource_Factory" params="-ORBReactorType select_mt"/>
+ </dynamic>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.cpp
new file mode 100644
index 00000000000..1c0798efa7e
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.cpp
@@ -0,0 +1,107 @@
+#include "Factory.h"
+#include "Simple.h"
+
+#include "TestC.h"
+
+ACE_RCSID (Infrastructure_Controlled,
+ Factory,
+ "$Id$")
+
+Factory::Factory (void)
+{
+ this->fcid_ = 0;
+}
+
+CORBA::Object_ptr
+Factory::create_object (
+ const char * /*type_id*/,
+ const PortableGroup::Criteria & /*the_criteria*/,
+ PortableGroup::GenericFactory::FactoryCreationId_out fcid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria))
+{
+ Simple *servant;
+
+ ACE_NEW_THROW_EX (servant,
+ Simple,
+ CORBA::NO_MEMORY ());
+
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ PortableServer::ServantBase_var safe_servant = servant;
+
+ CORBA::ULong tmp_fcid = 0;
+ tmp_fcid = this->fcid_;
+
+ while (this->factory_map_.find (this->fcid_) == 0)
+ {
+ this->fcid_++;
+ if (this->fcid_ == tmp_fcid)
+ ACE_THROW_RETURN (PortableGroup::ObjectNotCreated (),
+ CORBA::Object::_nil ());
+ }
+
+ tmp_fcid = this->fcid_;
+
+ PortableGroup::GenericFactory::FactoryCreationId *my_fcid = 0;
+
+ ACE_NEW_THROW_EX (my_fcid,
+ PortableGroup::GenericFactory::FactoryCreationId,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ fcid = my_fcid;
+
+ *my_fcid <<= tmp_fcid;
+
+ this->poa_ =
+ servant->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ this->oid_ = this->poa_->servant_to_id (servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+
+ return servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+}
+
+void
+Factory::delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ fcid
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound))
+{
+ CORBA::ULong my_fcid = 0;
+
+ if (fcid >>= my_fcid)
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->lock_);
+ Factory_Map::ENTRY *entry = 0;
+ if (this->factory_map_.find (my_fcid, entry) == 0)
+ {
+ if (this->factory_map_.unbind (my_fcid) != 0)
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ }
+ else
+ ACE_THROW (PortableGroup::ObjectNotFound ());
+
+ if (my_fcid == this->fcid_)
+ {
+ this->poa_->deactivate_object (this->oid_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ {
+ ACE_THROW (PortableGroup::ObjectNotFound ());
+ }
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.h
new file mode 100644
index 00000000000..68473814908
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef FACTORY_H
+#define FACTORY_H
+
+#include "Factory_Map.h"
+#include "orbsvcs/PortableGroupS.h"
+#include "ace/Null_Mutex.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+#endif /* _MSC_VER */
+
+/// Implement the PortableGroup::GenericFactory Interface.
+class Factory
+ : public virtual POA_PortableGroup::GenericFactory
+{
+public:
+
+ /// Constructor
+ Factory (void);
+ /// creates a Test::Simple servant reference.
+ /// This reference is then passed as a FactoryInfos property
+ /// when the LoadManager creates the object group.
+ /// In this way, LoadManager can decide when to create the object group
+ /// members.
+
+ virtual CORBA::Object_ptr create_object (
+ const char * type_id,
+ const PortableGroup::Criteria & the_criteria,
+ PortableGroup::GenericFactory::FactoryCreationId_out
+ factory_creation_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::NoFactory,
+ PortableGroup::ObjectNotCreated,
+ PortableGroup::InvalidCriteria,
+ PortableGroup::InvalidProperty,
+ PortableGroup::CannotMeetCriteria));
+
+ /// The LoadManager is passed the FactoryCreationId, it received
+ /// from the create_object () call.
+ /// The LoadManager destroys the factory object created.
+
+ virtual void delete_object (
+ const PortableGroup::GenericFactory::FactoryCreationId &
+ factory_creation_id
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableGroup::ObjectNotFound));
+private:
+ /// The factory creation id.
+ CORBA::ULong fcid_;
+
+ /// Table that maps FactoryCreationId to Factory_Node
+ Factory_Map factory_map_;
+
+ /// The object id of the servant we are creating.
+ PortableServer::ObjectId_var oid_;
+
+ /// The POA with which we register the servant.
+ PortableServer::POA_var poa_;
+
+ /// Lock used to synchronize access to the factory creation id
+ TAO_SYNCH_MUTEX lock_;
+
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* FACTORY_H */
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.cpp
new file mode 100644
index 00000000000..375784f2fd3
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.cpp
@@ -0,0 +1,9 @@
+// -*- C++ -*-
+
+#include "Factory_Map.h"
+
+
+ACE_RCSID (Infrastructure_Controlled,
+ Factory_Map,
+ "$Id$")
+
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.h
new file mode 100644
index 00000000000..87df1062797
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Map.h
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef FACTORY_MAP_H
+#define FACTORY_MAP_H
+
+#include /**/ "ace/pre.h"
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Factory_Struct.h"
+#include "ace/Hash_Map_Manager_T.h"
+
+typedef ACE_Hash_Map_Manager_Ex<
+ ACE_UINT32,
+ Factory_Struct,
+ ACE_Hash<ACE_UINT32>,
+ ACE_Equal_To<ACE_UINT32>,
+ ACE_Null_Mutex> Factory_Map;
+
+
+#include /**/ "ace/post.h"
+#endif /* FACTORY_MAP_H */
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.cpp
new file mode 100644
index 00000000000..4459fe3e227
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.cpp
@@ -0,0 +1,5 @@
+#include "Factory_Struct.h"
+
+ACE_RCSID (Infrastructure_Controlled,
+ Factory_Struct,
+ "$Id$")
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.h
new file mode 100644
index 00000000000..1e949a91aa5
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Factory_Struct.h
@@ -0,0 +1,34 @@
+//$Id$
+// -*- C++ -*-
+
+
+#ifndef FACTORY_STRUCT_H
+#define FACTORY_STRUCT_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/PortableGroupC.h"
+
+#include "ace/Array_Base.h"
+
+
+struct Factory_Node
+{
+
+ /// FactoryCreationId assigned to the member.
+ PortableGroup::GenericFactory::FactoryCreationId_var factory_creation_id;
+
+};
+
+typedef ACE_Array_Base<Factory_Node> Factory_Struct;
+
+
+#include /**/ "ace/post.h"
+
+#endif /* FACTORY_STRUCT_H */
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Infrastructure_Controlled.mpc b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Infrastructure_Controlled.mpc
new file mode 100644
index 00000000000..af901a174ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Infrastructure_Controlled.mpc
@@ -0,0 +1,34 @@
+// $Id$
+project(*idl): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*Server): loadbalancing {
+ after += *idl
+ Source_Files {
+ server.cpp
+ LB_server.cpp
+ Simple.cpp
+ Factory.cpp
+ Factory_Map.cpp
+ Factory_Struct.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Client): loadbalancing {
+ after += *idl
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.cpp
new file mode 100644
index 00000000000..fef78510c70
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.cpp
@@ -0,0 +1,249 @@
+#include "LB_server.h"
+#include "Simple.h"
+#include "Factory.h"
+
+#include "TestC.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Infrastructure_Controlled,
+ LB_server,
+ "$Id$")
+
+LB_server::LB_server (int argc, char **argv)
+ : argc_ (argc)
+ , argv_ (argv)
+{
+}
+
+CORBA::ORB_ptr
+LB_server::orb (void)
+{
+ return this->orb_.in ();
+}
+
+int
+LB_server::run (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ ACE_Time_Value period (0, 10);
+ while (1)
+ {
+ this->orb_->perform_work (&period);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught while running LB_server\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 1;
+
+}
+
+
+int
+LB_server::destroy (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->lm_->delete_object (this->fcid_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught while destroying LB_server\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 1;
+
+}
+
+int
+LB_server::write_ior_to_file (const char *ior)
+{
+ FILE *output_file =
+ ACE_OS::fopen ("obj.ior", "w");
+
+ if (output_file == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot open output file for writing IOR:"));
+ return -1;
+ }
+
+ ACE_OS::fprintf (output_file, "%s", ior);
+ ACE_OS::fclose (output_file);
+ return 0;
+}
+
+int
+LB_server::start_orb_and_poa (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialise the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("LoadManager" ACE_ENV_ARG_PARAMETER);
+
+ this->lm_ =
+ CosLoadBalancing::LoadManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->lm_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get Load Manager Reference\n"),
+ 1);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised initialising ORB or POA");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+
+}
+
+int
+LB_server::create_object_group (const char *loc_1, const char *loc_2)
+{
+ ACE_TRY_NEW_ENV
+ {
+ const char *repository_id = "IDL:Test/Simple:1.0";
+
+ Factory factory_object1;
+ Factory factory_object2;
+
+ PortableGroup::GenericFactory_var factory_obj1 =
+ factory_object1._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::GenericFactory_var factory_obj2 =
+ factory_object2._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::FactoriesValue factory_infos;
+ factory_infos.length (2);
+
+ PortableGroup::Criteria criteria ;
+ criteria.length (4);
+
+ PortableGroup::Criteria factory_criteria ;
+ factory_criteria.length (1);
+
+ PortableGroup::Property &property_one = criteria[0];
+ property_one.nam.length (1);
+ PortableGroup::Property &property_two = criteria[1];
+ property_two.nam.length (1);
+ PortableGroup::Property &property_three = criteria[2];
+ property_three.nam.length (1);
+ PortableGroup::Property &property_four = criteria[3];
+ property_four.nam.length (1);
+
+ PortableGroup::Property &factory_property_one = factory_criteria[0];
+ factory_property_one.nam.length (1);
+
+ property_one.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MembershipStyle");
+
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_INF_CTRL;
+ property_one.val <<= msv;
+
+ factory_infos[0].the_factory = factory_obj1._retn ();
+ factory_infos[0].the_criteria = factory_criteria;
+
+ factory_infos[1].the_factory = factory_obj2._retn ();
+ factory_infos[1].the_criteria = factory_criteria;
+
+ PortableGroup::Location & location1 = factory_infos[0].the_location;
+ location1.length (1);
+ PortableGroup::Location & location2 = factory_infos[1].the_location;
+ location2.length (1);
+
+ location1[0].id = CORBA::string_dup (loc_1);
+ location2[0].id = CORBA::string_dup (loc_2);
+
+ property_two.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.Factories");
+ property_two.val <<= factory_infos;
+
+ property_three.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.InitialNumberMembers");
+ PortableGroup::InitialNumberMembersValue init_value = 2;
+ property_three.val <<= init_value;
+
+ property_four.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MinimumNumberMembers");
+ PortableGroup::MinimumNumberMembersValue min_value = 2;
+ property_four.val <<= min_value;
+
+ this->object_group_ = this->lm_->create_object (repository_id,
+ criteria,
+ this->fcid_.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (this->object_group_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->write_ior_to_file (ior.in ());
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while creating object group");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.h
new file mode 100644
index 00000000000..9b0513431dc
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/LB_server.h
@@ -0,0 +1,71 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_server.h
+ *
+ * $Id$
+ *
+ * @author Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "tao/PortableServer/PortableServer.h"
+
+/**
+ * @class LB_server
+ *
+ * @brief Encapsulate the test in class.
+ *
+ * This is a class used to retrieve the LoadManager reference and
+ * create the Object Group. Servants add themselves to the object
+ * group and the object group reference is published to the clients.
+ * Clients then invoke the "servant operations" on the LoadManager
+ * itself. At this point the Load Balancing cycle starts.
+ */
+class LB_server
+{
+public:
+
+ /// Constructor
+ LB_server (int argc, char **argv);
+
+ /// destroys LoadManager, ORB and POA.
+ int destroy (void);
+
+ /// start the ORB.
+ int start_orb_and_poa (void);
+
+ /// Create the Object Group using the Load Manager Reference.
+ int create_object_group (const char *loc_1, const char *loc_2);
+
+ /// Run the ORB.
+ int run (void);
+
+ /// for servants to register to the initialised ORB.
+ CORBA::ORB_ptr orb (void);
+
+private:
+
+ int write_ior_to_file (const char *);
+
+private:
+
+ /// Load Manager
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// Object Group.
+ CORBA::Object_var object_group_;
+
+ /// factory id for the object group.
+ PortableGroup::GenericFactory::FactoryCreationId_var fcid_;
+
+ CORBA::ORB_var orb_;
+ int argc_;
+ char **argv_;
+ PortableServer::POA_var root_poa_;
+};
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Makefile.am b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Makefile.am
new file mode 100644
index 00000000000..c5dee68b8be
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Makefile.am
@@ -0,0 +1,154 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Infrastructure_Controlled_Idl.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.Infrastructure_Controlled_Client.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ TestC.cpp \
+ client.cpp \
+ Factory.h \
+ Factory_Map.h \
+ Factory_Struct.h \
+ LB_server.h \
+ Simple.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosLoadBalancing.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Makefile.Infrastructure_Controlled_Server.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ Factory.cpp \
+ Factory_Map.cpp \
+ Factory_Struct.cpp \
+ LB_server.cpp \
+ Simple.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ Factory.h \
+ Factory_Map.h \
+ Factory_Struct.h \
+ LB_server.h \
+ Simple.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosLoadBalancing.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/README b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/README
new file mode 100644
index 00000000000..679b3d67b4b
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/README
@@ -0,0 +1,8 @@
+This program tests the infrastructure controlled membership support
+of the Cygnus Load Balancer. The aim is to allow Cygnus to set the
+factories needed to create the "replicas", when the object group
+is created. This way, the load balancer can decide when to create
+the object group members.
+
+Please see $TAO_ROOT/orbsvcs/orbsvcs/Loadbalancing for the implementations
+of the Cygnus load balancer.
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.cpp
new file mode 100644
index 00000000000..a4de93fd1b0
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.cpp
@@ -0,0 +1,18 @@
+#include "Simple.h"
+
+
+ACE_RCSID (Infrastructure_Controlled,
+ Simple,
+ "$Id$")
+
+
+Simple::Simple (void)
+{
+}
+
+char *
+Simple::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO Load Balancing Works!");
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.h
new file mode 100644
index 00000000000..7eb93b15f5c
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Simple.h
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef SIMPLE_H
+#define SIMPLE_H
+
+#include "TestS.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+#endif /* _MSC_VER */
+
+/// Implement the Test::Simple interface
+class Simple
+ : public virtual POA_Test::Simple
+{
+public:
+
+ Simple (void);
+ /// Constructor
+
+ virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* SIMPLE_H */
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Test.idl b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Test.idl
new file mode 100644
index 00000000000..4c0f00b66a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/Test.idl
@@ -0,0 +1,15 @@
+//
+// $Id$
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ /// A very simple interface
+ interface Simple
+ {
+ /// Return a simple string
+ string get_string ();
+
+ };
+};
+
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/client.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/client.cpp
new file mode 100644
index 00000000000..8a85b412846
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/client.cpp
@@ -0,0 +1,86 @@
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+
+
+ACE_RCSID (Infrastructure_Controlled,
+ client,
+ "$Id$")
+
+
+const char *ior = "file://obj.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Simple_var simple =
+ Test::Simple::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (simple.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Simple reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ CORBA::String_var the_string =
+ simple->get_string (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%s>\n",
+ the_string.in ()));
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught in client.cpp:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/run_test.pl b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/run_test.pl
new file mode 100755
index 00000000000..b5fa6ef52da
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/run_test.pl
@@ -0,0 +1,72 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../bin";
+use PerlACE::Run_Test;
+
+$iorfile = PerlACE::LocalFile ("obj.ior");
+unlink $iorfile;
+
+$lm_ior = "lm.ior";
+unlink $lm_ior;
+
+$status = 0;
+
+## The LoadManager needs to register signals with the ORB's reactor (on
+## Windows only) and thus can not use the TP Reactor since it doesn't
+## support that kind of thing. So, we swith to the Select MT Reactor.
+$lm_conf = PerlACE::LocalFile ("windows$PerlACE::svcconf_ext");
+
+$init_ref = "-ORBInitRef LoadManager=file://lm.ior";
+
+$LM = new PerlACE::Process ("../../../../LoadBalancer/LoadManager",
+ "-o lm.ior" . ($^O eq 'MSWin32' ?
+ " -ORBSvcConf $lm_conf" : ''));
+$SV = new PerlACE::Process ("server", $init_ref);
+$CL = new PerlACE::Process ("client", " -k file://$iorfile");
+
+$LM->Spawn ();
+
+if (PerlACE::waitforfile_timed ("lm.ior", 5) == -1) {
+ print STDERR "ERROR: cannot find file LoadManager IOR: lm.ior\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find server file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (100);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->TerminateWaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+$load_manager = $LM->TerminateWaitKill (10);
+
+if ($load_manager != 0) {
+ print STDERR "ERROR: LoadManager returned $load_manager\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+unlink $lm_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/server.cpp
new file mode 100644
index 00000000000..735da982dc4
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/server.cpp
@@ -0,0 +1,31 @@
+#include "LB_server.h"
+#include "Factory.h"
+#include "Simple.h"
+
+ACE_RCSID (Infrastructure_Controlled,
+ server,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ const char *location1 = "MyLocation 1";
+ const char *location2 = "MyLocation 2";
+
+ LB_server lb_server (argc, argv);
+
+ if (lb_server.start_orb_and_poa () == -1)
+ return 1;
+
+ if (lb_server.create_object_group (location1, location2) == -1)
+ return 1;
+
+ lb_server.run ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ if (lb_server.destroy () == -1)
+ return 1;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf
new file mode 100644
index 00000000000..06c425e3ecf
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf
@@ -0,0 +1,3 @@
+# $Id $
+
+dynamic Advanced_Resource_Factory Service_Object* TAO_Strategies:_make_TAO_Advanced_Resource_Factory () "-ORBReactorType select_mt"
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf.xml b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf.xml
new file mode 100644
index 00000000000..289810f7d22
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/windows.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from windows.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id $ -->
+ <dynamic id="Advanced_Resource_Factory" type="Service_Object">
+ <initializer path="TAO_Strategies" init="_make_TAO_Advanced_Resource_Factory" params="-ORBReactorType select_mt"/>
+ </dynamic>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile.am b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile.am
new file mode 100644
index 00000000000..94ee8bc71d4
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Makefile.am
@@ -0,0 +1,15 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ Application_Controlled \
+ Infrastructure_Controlled \
+ Manage_Object_Group
+
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp
new file mode 100644
index 00000000000..b858c9947a5
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp
@@ -0,0 +1,81 @@
+#include "Basic.h"
+#include "LB_server.h"
+
+
+ACE_RCSID (Application_Controlled,
+ Basic,
+ "$Id$")
+
+
+Basic::Basic (CORBA::Object_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ CORBA::Short num,
+ const char *loc)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ number_ (num)
+{
+ this->object_group_ = CORBA::Object::_duplicate (object_group);
+ this->lm_ = CosLoadBalancing::LoadManager::_duplicate (lm);
+ this->location_ = CORBA::string_dup (loc);
+}
+
+CORBA::Short
+Basic::number (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->number_;
+}
+
+char *
+Basic::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup (this->location_);
+}
+
+void
+Basic::remove_member (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+ location[0].id = CORBA::string_dup (this->location_);
+ this->lm_->remove_member (this->object_group_.in (),
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Removed Member at Location <%s>\n",
+ this->location_));
+
+ }
+ ACE_CATCH (PortableGroup::ObjectNotFound, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ "Caught exception in remove_member");
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCH (PortableGroup::MemberNotFound, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ "Caught exception in remove_member");
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught while destroying member\n");
+ }
+ ACE_ENDTRY;
+
+}
+
+void
+Basic::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.h
new file mode 100644
index 00000000000..ad2bb53be84
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.h
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef BASIC_H
+#define BASIC_H
+
+#include "TestS.h"
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "orbsvcs/PortableGroupC.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+/// Implement the Test::Basic interface
+class Basic
+ : public virtual POA_Test::Basic
+{
+public:
+ /// Constructor
+ Basic (CORBA::Object_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ CORBA::Short num,
+ const char *loc);
+
+ virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void remove_member (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Short number (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to convert strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+
+ /// Load Manager Reference used to delete the servant reference from the
+ /// object group.
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// location of the servant
+ const char *location_ ;
+
+ /// Object Group reference.
+ CORBA::Object_var object_group_;
+
+ /// ID of the servant
+ CORBA::Short number_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* BASIC_H */
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.cpp
new file mode 100644
index 00000000000..14c3fdcf727
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.cpp
@@ -0,0 +1,349 @@
+#include "LB_server.h"
+#include "Basic.h"
+#include "Simple.h"
+
+#include "TestC.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Application_Controlled,
+ LB_server,
+ "$Id$")
+
+LB_server::LB_server (int argc, char **argv)
+ : argc_ (argc)
+ , argv_ (argv)
+{
+}
+
+int
+LB_server::destroy (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->lm_->delete_object (this->basic_fcid_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->lm_->delete_object (this->simple_fcid_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orb_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught while destroying LB_server\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 1;
+
+}
+
+CORBA::ORB_ptr
+LB_server::orb (void)
+{
+ return this->orb_.in ();
+}
+
+CORBA::Object_ptr
+LB_server::get_basic_object_group (void)
+{
+ return this->basic_object_group_.in ();
+}
+
+CORBA::Object_ptr
+LB_server::get_simple_object_group (void)
+{
+ return this->simple_object_group_.in ();
+}
+
+CosLoadBalancing::LoadManager_ptr
+LB_server::load_manager (void)
+{
+ return this->lm_.in ();
+}
+
+int
+LB_server::start_orb_and_poa (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialise the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ this->orb_->resolve_initial_references ("LoadManager" ACE_ENV_ARG_PARAMETER);
+
+ this->lm_ =
+ CosLoadBalancing::LoadManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (this->lm_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to get Load Manager Reference\n"),
+ 1);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised initialising ORB or POA");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+
+}
+
+int
+LB_server::create_basic_object_group (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ const char *repository_id = "IDL:Test/Basic:1.0";
+
+ PortableGroup::Criteria criteria (1);
+ criteria.length (1);
+
+ PortableGroup::Property &property = criteria[0];
+ property.nam.length (1);
+
+ property.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MembershipStyle");
+
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_APP_CTRL;
+ property.val <<= msv;
+
+ this->basic_object_group_ = this->lm_->create_object (repository_id,
+ criteria,
+ this->basic_fcid_.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (this->basic_object_group_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while creating object group");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+
+}
+
+int
+LB_server::create_simple_object_group (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ const char *repository_id = "IDL:Test/Simple:1.0";
+
+ PortableGroup::Criteria criteria (1);
+ criteria.length (1);
+
+ PortableGroup::Property &property = criteria[0];
+ property.nam.length (1);
+
+ property.nam[0].id =
+ CORBA::string_dup ("org.omg.PortableGroup.MembershipStyle");
+
+ PortableGroup::MembershipStyleValue msv =
+ PortableGroup::MEMB_APP_CTRL;
+ property.val <<= msv;
+
+ this->simple_object_group_ = this->lm_->create_object (repository_id,
+ criteria,
+ this->simple_fcid_.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ this->orb_->object_to_string (this->simple_object_group_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while creating object group");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+
+}
+
+int
+LB_server::remove_basic_member (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+
+ location[0].id = CORBA::string_dup ("MyLocation 1");
+
+ const char *loc = "MyLocation 1";
+
+ this->lm_->remove_member (this->basic_object_group_.in (),
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ printf("Removed Basic Member at location %s\n\n", loc);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while deleting servant");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
+
+int
+LB_server::remove_simple_member (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+
+ location[0].id = CORBA::string_dup ("MyLocation 1");
+
+ const char *loc = "MyLocation 1";
+
+ this->lm_->remove_member (this->simple_object_group_.in (),
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ printf("Removed Simple Member at location %s\n\n", loc);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while deleting servant");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
+
+int
+LB_server::register_basic_servant (Basic *servant, const char *loc)
+{
+ ACE_TRY_NEW_ENV
+ {
+ Test::Basic_var basic =
+ servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Location location (1);
+ location.length (1);
+
+ location[0].id = CORBA::string_dup (loc);
+
+ this->lm_->add_member (this->basic_object_group_.in (),
+ location,
+ basic.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Short number = 0;
+ number = servant->number (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ printf("Added Basic member %d at location %s\n", number, loc);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while registering servant");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
+
+int
+LB_server::register_simple_servant (Simple *servant, const char *loc)
+{
+ ACE_TRY_NEW_ENV
+ {
+ Test::Simple_var simple =
+ servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::Location location (1);
+ location.length (1);
+
+ location[0].id = CORBA::string_dup (loc);
+
+ this->lm_->add_member (this->simple_object_group_.in (),
+ location,
+ simple.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Short number = 0;
+ number = servant->number (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ printf("Added Simple member %d at location %s\n", number, loc);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception raised while registering servant");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.h
new file mode 100644
index 00000000000..dd8366cf547
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/LB_server.h
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_server.h
+ *
+ * $Id$
+ *
+ * @author Jaiganesh Balasubramanian <jai@doc.ece.uci.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "orbsvcs/PortableGroupC.h"
+#include "tao/PortableServer/PortableServer.h"
+
+// Forward Declaration of the kind of servant we would like to handle
+// by the server.
+class Basic;
+class Simple;
+
+/**
+ * @class LB_server
+ *
+ * @brief Encapsulate the test in class.
+ *
+ * This is a class used to retrieve the LoadManager reference and
+ * create the Object Group. Servants add themselves to the object
+ * group and the object group reference is published to the clients.
+ * Clients then invoke the "servant operations" on the LoadManager
+ * itself. At this point the Load Balancing cycle starts.
+ */
+class LB_server
+{
+public:
+
+ /// Constructor
+ LB_server (int argc, char **argv);
+
+ /// destroys LoadManager, ORB and POA.
+ int destroy (void);
+
+ /// start the ORB.
+ int start_orb_and_poa (void);
+
+ /// Get the LoadManager Interface.
+ int init (int argc, char **argv);
+
+ /// Create the basic Object Group using the Load Manager Reference.
+ int create_basic_object_group (void);
+
+ /// Create the simple Object Group using the Load Manager Reference.
+ int create_simple_object_group (void);
+
+ /// remove the basic member from the object group
+ int remove_basic_member (void);
+
+ /// remove the simple member from the object group
+ int remove_simple_member (void);
+
+ /// register the basic servants with the object group.
+ int register_basic_servant (Basic *servant, const char *loc);
+
+ /// register the simple servants with the object group.
+ int register_simple_servant (Simple *servant, const char *loc);
+
+ /// for servants to register to the initialised ORB.
+ CORBA::ORB_ptr orb (void);
+
+ /// for servants to get the reference for object_group.
+ CORBA::Object_ptr get_basic_object_group (void);
+
+ /// for servants to get the reference for object_group.
+ CORBA::Object_ptr get_simple_object_group (void);
+
+ /// for servants to get the reference for object_group.
+ CosLoadBalancing::LoadManager_ptr load_manager (void);
+
+private:
+
+ /// Load Manager
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// Basic Object Group.
+ CORBA::Object_var basic_object_group_;
+
+ /// Simple Object Group.
+ CORBA::Object_var simple_object_group_;
+
+ /// factory id for the basic object group.
+ PortableGroup::GenericFactory::FactoryCreationId_var basic_fcid_;
+
+ /// factory id for the simple object group.
+ PortableGroup::GenericFactory::FactoryCreationId_var simple_fcid_;
+
+ /// ORB pointer
+ CORBA::ORB_var orb_;
+
+ /// command line arguments
+ int argc_;
+ char **argv_;
+
+ /// root poa pointer
+ PortableServer::POA_var root_poa_;
+};
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Makefile.am b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Makefile.am
new file mode 100644
index 00000000000..8f8d87249e8
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Makefile.am
@@ -0,0 +1,110 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Manage_Object_Group_Server.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl \
+ TestS_T.cpp \
+ TestS_T.h \
+ TestS_T.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl \
+ TestS_T.cpp \
+ TestS_T.h \
+ TestS_T.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl TestS_T.cpp TestS_T.h TestS_T.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/Test.idl
+ @touch $@
+
+noinst_PROGRAMS = server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ Basic.cpp \
+ LB_server.cpp \
+ Simple.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ Basic.h \
+ LB_server.h \
+ Simple.h \
+ TestC.h \
+ TestC.inl \
+ TestS.h \
+ TestS.inl \
+ TestS_T.h \
+ TestS_T.inl
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosLoadBalancing.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Manage_Object_Group.mpc b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Manage_Object_Group.mpc
new file mode 100644
index 00000000000..118d41248d2
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Manage_Object_Group.mpc
@@ -0,0 +1,11 @@
+// -*- MPC -*-
+// $Id$
+
+project(*server): orbsvcsexe, portablegroup, loadbalancing, naming, svc_utils {
+ Source_Files {
+ server.cpp
+ LB_server.cpp
+ Basic.cpp
+ Simple.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.cpp
new file mode 100644
index 00000000000..7949918ee73
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.cpp
@@ -0,0 +1,81 @@
+#include "Simple.h"
+#include "LB_server.h"
+
+
+ACE_RCSID (Application_Controlled,
+ Simple,
+ "$Id$")
+
+
+Simple::Simple (CORBA::Object_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ CORBA::Short num,
+ const char *loc)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ number_ (num)
+{
+ this->object_group_ = CORBA::Object::_duplicate (object_group);
+ this->lm_ = CosLoadBalancing::LoadManager::_duplicate (lm);
+ this->location_ = CORBA::string_dup (loc);
+}
+
+CORBA::Short
+Simple::number (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->number_;
+}
+
+char *
+Simple::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup (this->location_);
+}
+
+void
+Simple::remove_member (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+ location[0].id = CORBA::string_dup (this->location_);
+ this->lm_->remove_member (this->object_group_.in (),
+ location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Removed Member at Location <%s>\n",
+ this->location_));
+
+ }
+ ACE_CATCH (PortableGroup::ObjectNotFound, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ "Caught exception in remove_member");
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCH (PortableGroup::MemberNotFound, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ "Caught exception in remove_member");
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught while destroying member\n");
+ }
+ ACE_ENDTRY;
+
+}
+
+void
+Simple::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.h b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.h
new file mode 100644
index 00000000000..0a3d63efa23
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Simple.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#ifndef SIMPLE_H
+#define SIMPLE_H
+
+#include "TestS.h"
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "orbsvcs/PortableGroupC.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+class LB_Basic_Test;
+
+/// Implement the Test::Simple interface
+class Simple
+ : public virtual POA_Test::Simple
+{
+public:
+ /// Constructor
+ Simple (CORBA::Object_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ CORBA::Short num,
+ const char *loc);
+
+ virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void remove_member (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Short number (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to convert strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+
+ /// Load Manager Reference used to delete the servant reference from the
+ /// object group.
+ CosLoadBalancing::LoadManager_var lm_;
+
+ /// location of the servant
+ const char *location_ ;
+
+ /// Object Group reference.
+ CORBA::Object_var object_group_;
+
+ /// ID of the servant
+ CORBA::Short number_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* SIMPLE_H */
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Test.idl b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Test.idl
new file mode 100644
index 00000000000..25e2829b394
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Test.idl
@@ -0,0 +1,38 @@
+//
+// $Id$
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ /// A very simple interface
+ interface Basic
+ {
+ /// Return a simple string
+ string get_string ();
+
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+
+ /// A method to remove the servant from the LoadManager Object Group.
+ oneway void remove_member ();
+ };
+
+ /// A very simple interface
+ interface Simple
+ {
+ /// Return a simple string
+ string get_string ();
+
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+
+ /// A method to remove the servant from the LoadManager Object Group.
+ oneway void remove_member ();
+ };
+};
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/run_test.pl b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/run_test.pl
new file mode 100755
index 00000000000..4795e26e74d
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../bin";
+use PerlACE::Run_Test;
+
+$lm_ior = "lm.ior";
+unlink $lm_ior;
+
+$status = 0;
+
+## The LoadManager needs to register signals with the ORB's reactor (on
+## Windows only) and thus can not use the TP Reactor since it doesn't
+## support that kind of thing. So, we swith to the Select MT Reactor.
+$lm_conf = PerlACE::LocalFile ("windows$PerlACE::svcconf_ext");
+
+$init_ref = "-ORBInitRef LoadManager=file://lm.ior";
+
+$LM = new PerlACE::Process ("../../../../LoadBalancer/LoadManager",
+ "-o lm.ior" . ($^O eq 'MSWin32' ?
+ " -ORBSvcConf $lm_conf" : ''));
+$SV = new PerlACE::Process ("server", $init_ref);
+
+print STDERR "\n\n======== Running Manage ObjectGroup Membership Test================\n";
+print STDERR "\n";
+
+print STDERR "This test will check the add_member () and remove_member () methods of the\n";
+print STDERR "ObjectGroupManager\n";
+print STDERR "\n";
+
+$LM->Spawn ();
+
+if (PerlACE::waitforfile_timed ("lm.ior", 5) == -1) {
+ print STDERR "ERROR: cannot find file LoadManager IOR: lm.ior\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$SV->Spawn ();
+
+$server = $SV->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+$load_manager = $LM->TerminateWaitKill (10);
+
+if ($load_manager != 0) {
+ print STDERR "ERROR: LoadManager returned $load_manager\n";
+ $status = 1;
+}
+
+unlink $lm_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/server.cpp
new file mode 100644
index 00000000000..4f4724ab6c6
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/server.cpp
@@ -0,0 +1,132 @@
+#include "LB_server.h"
+#include "Basic.h"
+#include "Simple.h"
+
+ACE_RCSID (Manage_object_group,
+ server,
+ "$Id$")
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ const char *location1 = "MyLocation 1";
+
+ LB_server lb_server (argc, argv);
+
+ if (lb_server.start_orb_and_poa () == -1)
+ return 1;
+
+ if (lb_server.create_basic_object_group () == -1)
+ return 1;
+
+ if (lb_server.create_simple_object_group () == -1)
+ return 1;
+
+ Basic *basic_servant1;
+ Basic *basic_servant2;
+
+ Simple *simple_servant1;
+ Simple *simple_servant2;
+
+
+ ACE_NEW_RETURN (basic_servant1,
+ Basic (lb_server.get_basic_object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ 1,
+ location1),
+ 1);
+ PortableServer::ServantBase_var basic_owner_transfer1(basic_servant1);
+
+ ACE_NEW_RETURN (simple_servant1,
+ Simple (lb_server.get_simple_object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ 1,
+ location1),
+ 1);
+ PortableServer::ServantBase_var simple_owner_transfer1(simple_servant1);
+
+ if (lb_server.register_basic_servant (basic_servant1, location1) == -1)
+ {
+ (void) lb_server.destroy();
+ return 1;
+ }
+
+ if (lb_server.register_simple_servant (simple_servant1, location1) == -1)
+ {
+ (void) lb_server.destroy();
+ return 1;
+ }
+
+ if (lb_server.remove_basic_member() == -1)
+ {
+ return 1;
+ }
+
+ if (lb_server.remove_simple_member() == -1)
+ {
+ return 1;
+ }
+
+ ACE_NEW_RETURN (basic_servant2,
+ Basic (lb_server.get_basic_object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ 2,
+ location1),
+ 1);
+ PortableServer::ServantBase_var basic_owner_transfer2(basic_servant2);
+
+ ACE_NEW_RETURN (simple_servant2,
+ Simple (lb_server.get_simple_object_group (),
+ lb_server.load_manager (),
+ lb_server.orb (),
+ 2,
+ location1),
+ 1);
+ PortableServer::ServantBase_var simple_owner_transfer2(simple_servant2);
+
+ if (lb_server.register_basic_servant (basic_servant2, location1) == -1)
+ {
+ (void) lb_server.destroy();
+ return 1;
+ }
+
+ if (lb_server.register_simple_servant (simple_servant2, location1) == -1)
+ {
+ (void) lb_server.destroy();
+ return 1;
+ }
+
+ if (lb_server.remove_basic_member() == -1)
+ {
+ return 1;
+ }
+
+ if (lb_server.remove_simple_member() == -1)
+ {
+ return 1;
+ }
+
+ lb_server.orb ()->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ if (lb_server.destroy () == -1)
+ return 1;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "lb_server exception");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf
new file mode 100644
index 00000000000..06c425e3ecf
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf
@@ -0,0 +1,3 @@
+# $Id $
+
+dynamic Advanced_Resource_Factory Service_Object* TAO_Strategies:_make_TAO_Advanced_Resource_Factory () "-ORBReactorType select_mt"
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf.xml b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf.xml
new file mode 100644
index 00000000000..289810f7d22
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/windows.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from windows.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id $ -->
+ <dynamic id="Advanced_Resource_Factory" type="Service_Object">
+ <initializer path="TAO_Strategies" init="_make_TAO_Advanced_Resource_Factory" params="-ORBReactorType select_mt"/>
+ </dynamic>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/LoadMonitorCPU.mpc b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/LoadMonitorCPU.mpc
new file mode 100644
index 00000000000..55c91a8d3df
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/LoadMonitorCPU.mpc
@@ -0,0 +1,4 @@
+// $Id$
+
+project(*Client): loadbalancing {
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/Makefile.am b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/Makefile.am
new file mode 100644
index 00000000000..f9c6fe2837e
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/Makefile.am
@@ -0,0 +1,63 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.LoadMonitorCPU_Client.am
+
+if BUILD_AMI
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosLoadBalancing.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORInterceptor.la \
+ $(TAO_BUILDDIR)/tao/libTAO_ObjRefTemplate.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+endif BUILD_AMI
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/README b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/README
new file mode 100644
index 00000000000..ee845ff6081
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/README
@@ -0,0 +1,11 @@
+# $Id$
+
+This test verifies that Cygnus' CPU load monitor is working correctly.
+Run the test using the `run_test.pl' Perl script. The expected test
+output is the following:
+
+==== Running CPU Load Monitor test
+
+Retrieving loads from LoadManager ...... DONE
+Retrieving loads directly from LoadMonitor ... DONE
+CPU Load Monitor test passed.
diff --git a/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/client.cpp b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/client.cpp
new file mode 100644
index 00000000000..ccae399abb8
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/client.cpp
@@ -0,0 +1,180 @@
+// $Id$
+
+#include "orbsvcs/CosLoadBalancingC.h"
+#include "orbsvcs/PortableGroup/PG_Operators.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (CPU,
+ client,
+ "$Id$")
+
+
+const char * location = "MyLocation";
+
+const int MAX_RETRIES = 10;
+const CosLoadBalancing::LoadId LOAD_ID = CosLoadBalancing::LoadAverage;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "l:");
+
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'l':
+ location = get_opts.opt_arg ();
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s -l <ior>\n",
+ argv[0]),
+ -1);
+ }
+
+ return 0;
+}
+
+void
+check_loads (const CosLoadBalancing::LoadList & loads
+ ACE_ENV_ARG_DECL)
+{
+ if (loads.length () != 1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: Load list length is not equal to one.\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ if (loads[0].id != LOAD_ID
+ || loads[0].value < 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: Returned load is not a CPU load.\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain a reference to the LoadManager.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("LoadManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::LoadManager_var lm =
+ CosLoadBalancing::LoadManager::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::Location the_location (1);
+ the_location.length (1);
+
+ the_location[0].id = CORBA::string_dup (location);
+
+ // Attempt to get loads from the LoadManager.
+ ACE_DEBUG ((LM_INFO,
+ "\n"
+ "Retrieving loads from LoadManager ..."));
+
+ CosLoadBalancing::LoadList_var loads;
+
+ CORBA::Boolean retrieved_load = 0;
+
+ // Try a few times until a load is capable of being retrieved.
+ for (int i = 0; i < MAX_RETRIES && retrieved_load == 0; ++i)
+ {
+ ACE_TRY_EX (foo)
+ {
+ loads = lm->get_loads (the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (foo);
+
+ retrieved_load = 1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, ".")); // Show some progress.
+
+ // Give some time for loads to be reported to the
+ // LoadManager.
+ ACE_OS::sleep (2);
+ }
+ ACE_ENDTRY;
+ ACE_TRY_CHECK;
+ }
+
+ if (retrieved_load == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "\nERROR: Unable to retrieve loads "
+ "from LoadManager.\n"),
+ -1);
+ else
+ ACE_DEBUG ((LM_INFO,
+ " DONE\n"));
+
+ ::check_loads (loads.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Attempt to get loads directly from the LoadMonitor.
+ CosLoadBalancing::LoadMonitor_var monitor =
+ lm->get_load_monitor (the_location
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosLoadBalancing::Location_var cpu_mon_location =
+ monitor->the_location (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (cpu_mon_location.in () != the_location)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: Mismatched CPU load monitor location\n"));
+
+ ACE_TRY_THROW (CORBA::INTERNAL ());
+ }
+
+ ACE_DEBUG ((LM_INFO,
+ "Retrieving loads directly from LoadMonitor ..."));
+
+ loads = monitor->loads (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_INFO,
+ " DONE\n"));
+
+ ::check_loads (loads.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CPU Load Monitor test:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_INFO, "CPU Load Monitor test passed.\n\n"));
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/run_test.pl b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/run_test.pl
new file mode 100755
index 00000000000..7b7ed466ffc
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/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;
+
+# -*- perl -*-
+# $Id$
+
+use lib "../../../../../../bin";
+use PerlACE::Run_Test;
+
+print STDERR "\n\n==== Running CPU Load Monitor test\n";
+
+
+$lm_ior = "lm.ior";
+unlink $lm_ior;
+
+$status = 0;
+
+$init_ref = "-ORBInitRef LoadManager=file://" . $lm_ior;
+
+$location = "MyLocation";
+
+$LM = new PerlACE::Process ("../../../../LoadBalancer/LoadManager",
+ "-o " . $lm_ior);
+
+$MON = new PerlACE::Process ("../../../../LoadBalancer/LoadMonitor",
+ "-l " . $location
+ . " -t CPU -s PULL "
+ . $init_ref);
+
+$CL = new PerlACE::Process ("client",
+ $init_ref
+ . " -l " . $location);
+
+$LM->Spawn ();
+
+if (PerlACE::waitforfile_timed ($lm_ior, 8) == -1) {
+ print STDERR "ERROR: cannot find file LoadManager IOR: " . $lm_ior ."\n";
+ exit 1;
+}
+
+$MON->Spawn ();
+
+$client = $CL->SpawnWaitKill (100);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$load_monitor = $MON->TerminateWaitKill (10);
+$load_manager = $LM->TerminateWaitKill (10);
+
+if ($load_manager != 0 || $load_monitor != 0) {
+ print STDERR "Error terminating LoadManager or LoadMonitor.\n";
+ $status = 1;
+}
+
+unlink $lm_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/Makefile.am b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/Makefile.am
new file mode 100644
index 00000000000..cc16d67d6f5
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/Makefile.am
@@ -0,0 +1,13 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ CPU
+
diff --git a/TAO/orbsvcs/tests/LoadBalancing/Makefile.am b/TAO/orbsvcs/tests/LoadBalancing/Makefile.am
new file mode 100644
index 00000000000..aa65f76e141
--- /dev/null
+++ b/TAO/orbsvcs/tests/LoadBalancing/Makefile.am
@@ -0,0 +1,14 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ GenericFactory \
+ LoadMonitor
+
diff --git a/TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.cpp b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.cpp
new file mode 100644
index 00000000000..d7123478053
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.cpp
@@ -0,0 +1,803 @@
+#include "Basic_Log_Test.h"
+
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Log_Msg.h"
+#include "ace/SString.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID (Basic_Log_Test,
+ Basic_Log_Test,
+ "$Id$")
+
+
+const char* BasicLog_Test::basic_log_factory_name_= "BasicLogFactory";
+const char* BasicLog_Test::naming_sevice_name_ = "NameService";
+
+
+BasicLog_Test::BasicLog_Test(void)
+ : logServiceIor_ (0)
+{
+}
+
+BasicLog_Test::~BasicLog_Test (void)
+{
+ this->destroy_log ();
+}
+
+int
+BasicLog_Test::init (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB
+ orb_ = CORBA::ORB_init (argc,
+ argv,
+ "internet"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nOrb initialized successfully\n"));
+
+ // Parse command line and verify parameters.
+ if (this->parse_args (argc, argv) == -1)
+ return -1;
+
+ // Initialize the factory
+ int init_result = this->init_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (init_result != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize naming"
+ "services.\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "init");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ ACE_RETURN(0);
+
+}
+
+int
+BasicLog_Test::init_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ // Assumpting INS for finding LogServie
+
+ //CORBA::Object_var logging_obj = orb_->resolve_initial_references ("BasicLogFactory",
+ // ACE_TRY_ENV);
+
+ this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->resolve_basic_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ /*
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nLoggingService resolved\n"));
+
+ if (CORBA::is_nil (logging_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "LogService resolved to nil object\n"),
+ -1);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nLogService resolved\n"));
+
+ // Narrow the factory and check the success
+ factory_ =
+ DsLogAdmin::BasicLogFactory::_narrow (logging_obj.in () ACE_ENV_ARG_PARAMETER);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nFactory narrowed\n"));
+ if (CORBA::is_nil (factory_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "narrow returned nil"n"),
+ -1);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "\nLogger_Factory narrowed\n"));
+ */
+ // If debugging, get the factory's IOR
+ CORBA::String_var str =
+ orb_->object_to_string (basicLog_.in()
+ ACE_ENV_ARG_PARAMETER); //Init the Client
+ ACE_CHECK_RETURN (-1);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "The logger IOR is <%s>\n",
+ str.in ()));
+
+ return 0;
+}
+
+int
+BasicLog_Test::test_CreateLog (CORBA::ULongLong maxSize)
+{
+
+ ACE_TRY_NEW_ENV
+ {
+ DsLogAdmin::LogId id;
+ basicLog_ = factory_->create(DsLogAdmin::wrap, maxSize, id);
+ // @@ Krish, never use != 0 to compare a NIL object reference!!!
+ ACE_ASSERT (!CORBA::is_nil (basicLog_.in ()));
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "The logger id is %d\n",
+ id));
+ }
+/* ACE_CATCH(DsLogAdmin::NoResources, resourceX)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "no resources creating basic log.\n"),
+ -1);
+ }
+*/
+ ACE_CATCH(DsLogAdmin::InvalidThreshold, threshold)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "invalid threshold creating basic log.\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,"test_CreateLog");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Caught exception creating log.\n"),
+ -1);
+ }
+ ACE_ENDTRY;
+
+ ACE_RETURN(0);
+}
+
+int
+BasicLog_Test::test_LogAction ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ DsLogAdmin::LogId id = basicLog_->id ();
+
+ ACE_DEBUG ((LM_DEBUG, "The log's id is %d\n", id));
+
+ basicLog_->set_log_full_action (DsLogAdmin::halt);
+
+ DsLogAdmin::LogFullActionType logFullAction =
+ basicLog_->get_log_full_action ();
+
+ if (logFullAction != DsLogAdmin::halt)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Setting log full action to halt failed\n"),-1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "The log's full action successfully set to halt\n"));
+
+#ifndef ACE_LACKS_LONGLONG_T
+ ACE_DEBUG ((LM_INFO,
+ "The current size %Q, max size %Q\n",
+ basicLog_->get_current_size (),
+ basicLog_->get_max_size()));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "The current size %u , max size %u\n",
+ basicLog_->get_current_size().lo (),
+ basicLog_->get_max_size().lo ()));
+#endif
+
+ // make sure that it is full and when writing
+ this->write_records (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Wrote records instead should have thrown exception"));
+
+ basicLog_->set_log_full_action (DsLogAdmin::wrap);
+ ACE_ERROR_RETURN((LM_ERROR,"Testing log action halt failed\n"),-1);
+ }
+ ACE_CATCH(DsLogAdmin::LogFull, xLogFull)
+ {
+ ACE_DEBUG ((LM_DEBUG,"Correctly caught exception LogFull\n"));
+
+ CORBA::ULongLong nrecords = basicLog_->get_n_records ();
+
+ ACE_DEBUG ((LM_ERROR,
+ "The number of records written was %d\n",
+ ACE_U64_TO_U32 (nrecords)));
+
+ DsLogAdmin::AvailabilityStatus logStatus =
+ basicLog_->get_availability_status ();
+
+ if (!logStatus.log_full)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Failed the log's get_availability_status.\n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Log's availability status correctly set to log_full\n"));
+
+ basicLog_->set_log_full_action (DsLogAdmin::wrap);
+ DsLogAdmin::LogFullActionType logFullAction =
+ basicLog_->get_log_full_action();
+
+ if (logFullAction != DsLogAdmin::wrap)
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Setting log full action to wrap failed\n"),-1);
+
+ ACE_TRY_EX (SECOND)
+ {
+ int i = this->write_records (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SECOND);
+
+ ACE_DEBUG ((LM_DEBUG,"Test to wrap worked. %d written.\n",i));
+ }
+ ACE_CATCH (DsLogAdmin::LogFull, xLogFull)
+ {
+ ACE_DEBUG ((LM_ERROR,"Caught exception LogFull. Fail testing wrapping of the log.\n"));
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "test_LogAction");
+ return -1;
+ }
+ ACE_ENDTRY;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+/*
+int BasicLog_Test::display_records ()
+{
+ DsLogAdmin::Iterator_var iter_out;
+ DsLogAdmin::RecordList_var rec_list =
+ basicLog_->query ("EXTENDED_TCL", "id > 0", iter_out);
+
+ CORBA::ULong j = 0;
+ for (; j < rec_list->length();++j) //dhanvey added info
+#ifndef ACE_LACKS_LONGLONG_T
+ ACE_DEBUG ((LM_DEBUG,
+ "id = %Q, time= %Q\n",
+ rec_list[j].id, rec_list[j].time));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "id = %u, time= %u\n",
+ rec_list[j].id.lo(), rec_list[j].time.lo()));
+#endif
+
+ return 0;
+
+}
+*/
+int BasicLog_Test::write_records (CORBA::ULongLong numberOfRecords
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ CORBA::ULongLong numOfRecs = numberOfRecords;
+ if (numOfRecs == 0)
+ {
+ numOfRecs = basicLog_->get_max_size();
+ }
+
+#ifndef ACE_LACKS_LONGLONG_T
+ ACE_DEBUG ((LM_INFO,"B_test: Write_records: Max size in bytes %Q.\n", numOfRecs));
+#else
+ ACE_DEBUG ((LM_INFO,"B_test: Write_records: currentsize in bytes %u.\n", numOfRecs.lo()));
+#endif
+
+ int i = 0;
+ CORBA::ULongLong l = 0;
+
+ if (numOfRecs == 0)
+ {
+ for (;;)
+ {
+ DsLogAdmin::Anys record;
+ record.length(1);
+ ACE_CString str ("For the test of log "
+ "full action, writing test record, ");
+ char number[32];
+ ACE_OS::sprintf (number, "%d.", i);
+ str += number;
+ l += str.length ();
+ // record owns internal os string
+ ++i;
+ CORBA::String_var t(str.c_str ());
+ record[0] <<= t.in ();
+ basicLog_->write_records(record);
+ }
+ }
+ else
+ {
+ for(l = 0 ; l < numOfRecs ;)
+ {
+ DsLogAdmin::Anys record;
+ record.length(1);
+ ACE_CString str ("For the test of log "
+ "full action, writing test record, ");
+ char number[32];
+ ACE_OS::sprintf (number, "%d.", i);
+ str += number;
+ l += str.length ();
+ // record owns internal os string
+ ++i;
+ CORBA::String_var t(str.c_str ());
+ record[0] <<= t.in ();
+ basicLog_->write_records(record);
+
+ }
+ }
+
+#ifndef ACE_LACKS_LONGLONG_T
+ ACE_DEBUG ((LM_INFO,"B_test: Write_records: currentsize in bytes %Q.\n",
+ basicLog_->get_current_size()));
+#else
+ ACE_DEBUG ((LM_DEBUG,"B_test: Write_records: currentsize in bytes %u.\n",
+ basicLog_->get_current_size().lo()));
+#endif
+
+//dhanvey
+ CORBA::ULongLong nrecords = basicLog_->get_n_records();
+
+ ACE_DEBUG ((LM_ERROR,"The number of records in log is %d\n", ACE_U64_TO_U32(nrecords)));
+
+ ACE_RETURN(static_cast<int> (nrecords));
+}
+
+int
+BasicLog_Test::test_adminState()
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ basicLog_->set_administrative_state(DsLogAdmin::locked);
+ ACE_TRY
+ {
+ this->write_records(0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ERROR_RETURN((LM_ERROR,"Setting administrative state to lock failed. DsLogAdmin::LogLocked not thrown.\n"),-1);
+
+ }
+ ACE_CATCH(DsLogAdmin::LogLocked, xLocked)
+ {
+ ACE_DEBUG ((LM_DEBUG,"Setting administrative state to lock succeeded. DsLogAdmin::LogLocked was caught.\n"));
+ }
+ ACE_CATCHANY
+ {
+ basicLog_->set_administrative_state(DsLogAdmin::unlocked);
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "test_adminState");
+ ACE_ERROR_RETURN((LM_ERROR,"Setting administrative state to lock failed. Exception throw.\n"),-1);
+ }
+ ACE_ENDTRY;
+
+ basicLog_->set_administrative_state(DsLogAdmin::unlocked);
+ ACE_TRY_EX(SECOND)
+ {
+ this->write_records(0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SECOND);
+ ACE_DEBUG ((LM_DEBUG,"Setting administrative state to succeeded. DsLogAdmin::LogLocked not thrown.\n"));
+ ACE_RETURN(0);
+
+ }
+ ACE_CATCH(DsLogAdmin::LogLocked, xLocked)
+ {
+ ACE_DEBUG ((LM_DEBUG,"Setting administrative state to lock faild. DsLogAdmin::LogLocked was caught.\n"));
+ }
+ ACE_ENDTRY;
+ ACE_RETURN(0);
+}
+
+
+int
+BasicLog_Test::test_logSize (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ basicLog_->set_max_size (1);
+ ACE_TRY_CHECK;
+
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Setting max size less than current size failed.\n"
+ "DsLogAdmin::InvalidParam not thrown.\n"),
+ -1);
+ }
+ ACE_CATCH(DsLogAdmin::InvalidParam, xParam)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Setting max size less than current size succeeded.\n"
+ "DsLogAdmin::InvalidParam caught.\n"));
+ }
+ ACE_ENDTRY;
+
+ ACE_TRY_EX(SECOND)
+ {
+ basicLog_->set_max_size (10000);
+
+ CORBA::ULongLong nrecords = basicLog_->get_n_records ();
+ int i = this->write_records (0 ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK_EX (SECOND);
+ ACE_DEBUG ((LM_DEBUG,
+ "Increasing max size succeeded. Old record count, %d."
+ "New record count, %d\n",
+ ACE_U64_TO_U32(nrecords),
+ i));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "test_logSize");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Increasing max size failed. Exception thrown.\n"),
+ -1);
+ }
+ ACE_ENDTRY;
+ ACE_RETURN(0);
+}
+
+int
+BasicLog_Test::test_logCompaction(CORBA::ULong lifeExpectancy)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ CORBA::ULongLong old_n_records = basicLog_->get_n_records ();
+ if (old_n_records <= 0)
+ {
+ ACE_TRY
+ {
+ this->write_records (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "test_logCompaction");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Caught exception trying to write records "
+ "for test_logCompaction.\n"),
+ -1);
+ }
+ ACE_ENDTRY;
+ }
+
+ CORBA::ULong old_max_life = basicLog_->get_max_record_life ();
+
+ ACE_TRY_EX(SECOND)
+ {
+ basicLog_->set_max_record_life (lifeExpectancy);
+ // @@: need to modify set_max_record_life
+ ACE_TRY_CHECK_EX (SECOND);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "test_logCompaction");
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Caught exception setting max record life "
+ "test_logCompaction.\n"),
+ -1);
+ }
+ ACE_ENDTRY;
+
+ ACE_OS::sleep (lifeExpectancy + 1); // make sure the records have aged.
+ CORBA::ULongLong new_n_records = basicLog_->get_n_records ();
+ basicLog_->set_max_record_life (old_max_life);
+
+ ACE_DEBUG ((LM_ERROR,
+ "The number of records in log is %d\n",
+ ACE_U64_TO_U32 (new_n_records)));
+
+ if (new_n_records != 0)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "Log compaction failed, because %d records remain.\n",
+ ACE_U64_TO_U32 (new_n_records)),
+ -1 );
+ }
+
+ return 0;
+}
+
+//use ACE_U64_TO_U32 to convert ULongLong to ULong in call to this function
+//Writes and retrieves numberOfrecordsToWrite records.
+int
+BasicLog_Test::test_retrieval (CORBA::ULong /* numberOfRecordsToWrite */)
+{
+ int rc = 0;
+
+ if (!rc)
+ {
+ ACE_DEBUG ((LM_ERROR,"Test of retrieval: succeeded.\n"));
+ }
+
+ return rc;
+}
+
+
+
+int
+BasicLog_Test::test_query(CORBA::ULong numberOfRecordsToWrite)
+{
+ // save for compares
+ DsLogAdmin::Anys infos(numberOfRecordsToWrite);
+ return -1;
+}
+
+
+int
+BasicLog_Test::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "di");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ "\n"
+ " -d: increase debug level\n",
+ argv[0]),
+ -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+void
+BasicLog_Test::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (naming_sevice_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW (CORBA::UNKNOWN ());
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+BasicLog_Test::resolve_basic_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (basic_log_factory_name_);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->factory_ =
+ DsLogAdmin::BasicLogFactory::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+BasicLog_Test::destroy_log()
+{
+ ACE_TRY_NEW_ENV
+ {
+ if (!CORBA::is_nil(basicLog_.in ()))
+ {
+ basicLog_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ basicLog_ = DsLogAdmin::BasicLog::_nil ();
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Destroying log");
+ }
+ ACE_ENDTRY;
+}
+
+int
+BasicLog_Test::test_log_destroy (void)
+{
+
+ ACE_DEBUG ((LM_ERROR, "Testing destroy log\n"));
+ this->basicLog_->destroy ();
+
+ ACE_TRY_NEW_ENV
+ {
+ this->write_records (1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_INFO, "Wrote to log\n"));
+ }
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "Test of destroy log succeeded: "
+ "caught CORBA::OBJECT_NOT_EXIST exception.\n"));
+ return 0;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Destroying log");
+ ACE_DEBUG ((LM_ERROR,
+ "Test of destroy log failed: "
+ "caught unexpected exception.\n"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Test of destroy log failed: no exception thrown.\n"),
+ -1);
+}
+
+int
+BasicLog_Test::test_week_mask (void)
+{
+ DsLogAdmin::WeekMask masks;
+ masks.length (1);
+
+ masks[0].days =
+ DsLogAdmin::Monday
+ | DsLogAdmin::Tuesday
+ | DsLogAdmin::Wednesday
+ | DsLogAdmin::Friday
+ | DsLogAdmin::Saturday;
+
+ masks[0].intervals.length(1);
+
+ masks[0].intervals[0].start.hour = (CORBA::Short) 13;
+
+ masks[0].intervals[0].start.minute = (CORBA::Short) 30;
+ masks[0].intervals[0].stop.hour = (CORBA::Short) 14;
+ masks[0].intervals[0].stop.minute = (CORBA::Short) 30;
+
+ this->basicLog_->set_week_mask (masks);
+
+ return 0;
+}
+
+
+int BasicLog_Test::delete_records (CORBA::ULongLong /* numberOfRecords */)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+#ifndef ACE_LACKS_LONGLONG_T
+ ACE_DEBUG ((LM_INFO,
+ " before delete -- curr size %Q, max %Q\n",
+ basicLog_->get_current_size (),
+ basicLog_->get_max_size()));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "2ndThe current size %u , max size %u\n",
+ basicLog_->get_current_size().lo(),
+ basicLog_->get_max_size().lo()));
+#endif
+
+ CORBA::ULongLong nrecords = basicLog_->get_n_records ();
+
+ ACE_DEBUG ((LM_ERROR,
+ "The number of records was %d\n",
+ ACE_U64_TO_U32 (nrecords)));
+
+ CORBA::Long retVal =
+ basicLog_->delete_records ("EXTENDED_TCL", "id >= 0" ACE_ENV_ARG_PARAMETER);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Number of records in Log after delete = %d\n",
+ retVal));
+
+#ifndef ACE_LACKS_LONGLONG_T
+ ACE_DEBUG ((LM_INFO,
+ " after delete -- curr size %Q, max %Q\n",
+ basicLog_->get_current_size (),
+ basicLog_->get_max_size ()));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "2ndThe current size %u , max size %u\n",
+ basicLog_->get_current_size ().lo (),
+ basicLog_->get_max_size ().lo ()));
+#endif
+
+ nrecords = basicLog_->get_n_records ();
+
+ ACE_DEBUG ((LM_ERROR,
+ "The number of records is %d\n",
+ ACE_U64_TO_U32 (nrecords)));
+
+return 0;
+}
+
+int
+BasicLog_Test::test_capacity_alarm_threshold (void)
+{
+
+ //basicLog_->set_log_full_action(DsLogAdmin::halt);
+
+ DsLogAdmin::CapacityAlarmThresholdList list;
+ list.length(0);
+
+ basicLog_->set_capacity_alarm_thresholds (list);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ list.length (1);
+ list[0] = 200;
+
+ ACE_TRY
+ {
+ basicLog_->set_capacity_alarm_thresholds (list);
+ ACE_TRY_CHECK;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Setting an invalid alarm threshold failed. "
+ "DsLogAdmin::InvalidThreshold not thrown.\n"),
+ -1);
+ }
+ ACE_CATCH(DsLogAdmin::InvalidThreshold, xParam)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Setting an invalid alarm threshold succeeded. "
+ "DsLogAdmin::InvalidThreshold caught.\n"));
+ }
+ ACE_ENDTRY;
+
+ list.length (2);
+ list[0] = 70;
+ list[1] = 20;
+
+ ACE_TRY_EX(SECOND)
+ {
+ basicLog_->set_capacity_alarm_thresholds (list);
+ ACE_TRY_CHECK_EX (SECOND);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Setting an invalid alarm threshold failed. "
+ "DsLogAdmin::InvalidThreshold not thrown.\n"),
+ -1);
+ }
+ ACE_CATCH(DsLogAdmin::InvalidThreshold, xParam)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Setting an invalid alarm threshold succeeded. "
+ "DsLogAdmin::InvalidThreshold caught.\n"));
+ }
+ ACE_ENDTRY;
+
+ list.length (2);
+ list[0] = 20;
+ list[1] = 70;
+
+ basicLog_->set_capacity_alarm_thresholds (list);
+
+ CORBA::ULongLong nrecords = basicLog_->get_n_records();
+
+ ACE_DEBUG ((LM_ERROR,
+ "The number of records is %d\n",
+ ACE_U64_TO_U32(nrecords)));
+
+ this->write_records (0 ACE_ENV_ARG_PARAMETER);
+
+ return 0;
+
+}
diff --git a/TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.h b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.h
new file mode 100644
index 00000000000..cde2e00f5a0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Basic_Log_Test.h
@@ -0,0 +1,160 @@
+/* -*- C++ -*- */
+
+// ============================================================================
+/**
+ * @file Basic_Log_Test.h
+ *
+ * $Id$
+ *
+ * An test of using the Basic_Logging_Service
+ *
+ *
+ *
+ * @author D A Hanvey (d.hanvey@qub.ac.uk)
+ */
+// ============================================================================
+
+#ifndef TAO_BASIC_LOG_TEST_H
+#define TAO_BASIC_LOG_TEST_H
+
+#include "orbsvcs/DsLogAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+
+class BasicLog_Test
+{
+ // = TITLE
+ // Class to test the BasicLog interface.
+ // = DESCRIPTION
+ // This class exercises various methods of the DsLogAdmin::BasicLog
+ // interface.
+ public:
+
+
+ enum
+ { MAX_LOG_SIZE = 8192 };
+
+ BasicLog_Test(void);
+ // constructor
+
+ ~BasicLog_Test(void);
+ // destructor
+
+ int init(int argc, char *argv[]);
+
+ int
+ test_CreateLog(CORBA::ULongLong maxSize = MAX_LOG_SIZE);
+ // 1. Test simple create for the log used by the other test
+ //
+
+int display_records ();
+
+int
+delete_records (CORBA::ULongLong numberOfRecords);
+
+ int
+ test_LogAction ();
+ // Method to test the LogAction operation.
+ // 1. Set the max_size of the log to a value, MAX.
+ // 2. Set the log_full_action to DsLogAdmin::halt
+ // 3. Write MAX+1 records to the Log.
+ // 4. Catch exception DsLogAdmin::LogFull. Get the number of records.This should be MAX, the MAX+1'th record
+ // should have been discarded
+ // 5. Get availability status should be log_full
+ // 6. Set the log_full_action to DsLogAdmin::wrap
+ // 7. Write MAX records to the Log. Previous records should be over written.
+
+ int
+ test_adminState();
+ // 1. set administrative state to DsLogAdmin::locked
+ // 2. get administrative state.Is it locked
+ // 3. write a record to the log.
+ // 4. Catch exception DsLogAdmin::LogLocked
+
+ int test_logSize();
+ // 1. get current log size
+ // 2. set log to less than current size. Exception DsLogAdmin::InvalidParam should be thrown.
+ // 3. set log to greater than current.
+
+ int test_logCompaction(CORBA::ULong record_life = 1);
+ // 1. get number of records in log. Should have records from prior test.
+ // If not write some.
+ // 2. get maximum record life.
+ // 3. set maximum record life. Wait record_life seconds.
+ // 4. get maximum record life.
+ // 5. get number of records in log.
+ // 6. set maximum record life to entry value.
+
+ int test_retrieval(CORBA::ULong numberOfRecordsToWrite = 1000);
+ // 1. get time.
+ // 2. write the records
+ // 3. retrieve the records forwards. Compare to records written.
+ // 4. retrieve the records backwards. Compare to records writen.
+ // 5. repeat 3 and 4 using iterator.
+
+ int test_query(CORBA::ULong numberOfRecords = 1000 );
+ // 1. write the records with NVList.
+ // 2. query the records and compare the records
+
+ int test_log_destroy();
+ // 1. destroy the log.
+ // 2. attemp to write to log. Should throw exception (?).
+
+
+ int test_week_mask();
+
+ int test_capacity_alarm_threshold();
+
+private:
+ // not implemented
+
+ BasicLog_Test(const BasicLog_Test&);
+ BasicLog_Test& operator=(const BasicLog_Test&);
+
+ int
+ init_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ int
+ parse_args(int argc, char *argv[]);
+ // command line argument parser
+
+ int write_records(CORBA::ULongLong numberOfRecordsToWrite ACE_ENV_ARG_DECL_NOT_USED);
+ // writes enough records to fill the log. Default write enough to fill log. Hopefully, not infinite.
+
+ void
+ resolve_basic_factory (ACE_ENV_SINGLE_ARG_DECL);
+ // resolve log factory
+
+ void
+ resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // resolve nameing service
+
+ void
+ destroy_log();
+ // destroys the is log is it exists
+
+ int argc_;
+ char **argv_;
+ // command line
+
+ char* logServiceIor_;
+
+ DsLogAdmin::BasicLog_var basicLog_;
+ // the log used for all of the test
+
+ DsLogAdmin::BasicLogFactory_var factory_;
+ // pointer to logging factory
+
+ CORBA::ORB_var orb_;
+ // pointer to the ORB
+
+ CosNaming::NamingContext_var naming_context_;
+ // naming context
+
+ static const char* basic_log_factory_name_;
+
+ static const char* naming_sevice_name_;
+ // strings for log factory and naming service
+
+};
+
+#endif /* TAO_BASIC_LOG_TEST_H */
diff --git a/TAO/orbsvcs/tests/Log/Basic_Log_Test/Log_Basic_Log_Test.mpc b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Log_Basic_Log_Test.mpc
new file mode 100644
index 00000000000..3213ff1542c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Log_Basic_Log_Test.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project : orbsvcsexe, dslogadmin, naming, dynamicany, iortable, etcl {
+ exename = client
+}
diff --git a/TAO/orbsvcs/tests/Log/Basic_Log_Test/Makefile.am b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Makefile.am
new file mode 100644
index 00000000000..b4e0f64554f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Basic_Log_Test/Makefile.am
@@ -0,0 +1,49 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Log_Basic_Log_Test.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ Basic_Log_Test.cpp \
+ client.cpp \
+ Basic_Log_Test.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_DsLogAdmin.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Log/Basic_Log_Test/README b/TAO/orbsvcs/tests/Log/Basic_Log_Test/README
new file mode 100644
index 00000000000..a38bcb3f888
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Basic_Log_Test/README
@@ -0,0 +1,18 @@
+// $Id$
+
+Telecom Log Service (TLS) Client example
+----------------------------------------
+
+This is a simple example example to show how to create a basic log and
+write events to the Log.
+
+To run this example:
+1) You need a running Naming Service, $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service
+2) You need a running Log Service, $TAO_ROOT/orbsvcs/Logging_Service/Logging_Service
+3) ./client
+
+The client locates the log service factory from the naming service.
+Then it creates a DsLogAdmin::BasicLog does the following operations:
+- writes records, query records, delete records.
+
+report bugs to D A Hanvey <d.hanvey@qub.ac.uk>
diff --git a/TAO/orbsvcs/tests/Log/Basic_Log_Test/client.cpp b/TAO/orbsvcs/tests/Log/Basic_Log_Test/client.cpp
new file mode 100644
index 00000000000..b906b2fb1e5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Basic_Log_Test/client.cpp
@@ -0,0 +1,119 @@
+#include "Basic_Log_Test.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_main.h"
+
+ACE_RCSID (Basic_Log_Test,
+ client,
+ "$Id$")
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[])
+{
+ BasicLog_Test log_test;
+
+ ACE_DEBUG((LM_DEBUG, "\nBasic Log test \n\n"));
+
+ if (log_test.init(argc, argv) == -1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "xx - Failed initializing BasicLog_Test.\n"),-1);
+ }
+
+ // We may want to replace this with a run on the BasicLog_Test.
+ // If we cannot create a log, there is no use continuing.
+ // Create a log with max size (octets) of 1000.
+ if (log_test.test_CreateLog(1000) == -1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "xx - Failed creating log and bailing out.\n"),-1);
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The creating log test succeeded.\n\n"));
+ }
+
+ // go easy until this works
+ //@@ use ACE_U64_TO_U32 to convert ULongLong to ULong
+ //in call to test_retrieval
+ /* if (log_test.test_retrieval(10) == -1)
+ {
+ ACE_DEBUG((LM_ERROR,"The test of retrieval failed.\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"The test of retrieval succeeded.\n"));
+ }
+*/
+ if (log_test.test_log_destroy() == -1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "xx - Failed destroying log.\n\n"),-1);
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The destroying log test succeeded.\n\n"));
+ }
+
+ if (log_test.test_CreateLog(1000) == -1)
+ {
+ ACE_ERROR_RETURN((LM_ERROR,
+ "xx - Failed creating log and bailing out.\n\n"),-1);
+ }
+
+ if (log_test.test_capacity_alarm_threshold() == -1)
+ {
+ ACE_DEBUG((LM_ERROR,"xx - The capacity alarm threshold test failed.\n\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The capacity alarm threshold test succeeded.\n\n"));
+ }
+
+ if (log_test.test_LogAction() == -1)
+ {
+ ACE_DEBUG((LM_ERROR,"xx - The log action test failed.\n\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The log action test succeeded.\n\n"));
+ }
+
+ if (log_test.test_adminState() == -1)
+ {
+ ACE_DEBUG((LM_ERROR,"xx - The administration test failed.\n\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The administration test succeeded.\n\n"));
+ }
+
+ if (log_test.test_logSize() == -1)
+ {
+ ACE_DEBUG((LM_ERROR,"xx - The log size test failed.\n\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The log size test succeeded.\n\n"));
+ }
+
+ /* if (log_test.test_logCompaction(30) == -1)
+ {
+ ACE_DEBUG((LM_ERROR,"xx - The test of log compaction failed.\n\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The test of log compaction succeeded.\n\n"));
+ }
+ */
+
+ if (log_test.test_week_mask() == -1)
+ {
+ ACE_DEBUG((LM_ERROR,"xx - The week mask test failed.\n\n"));
+ }
+ else
+ {
+ ACE_DEBUG((LM_ERROR,"** - The week mask test succeeded.\n\n"));
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Log/Basic_Log_Test/run_test.pl b/TAO/orbsvcs/tests/Log/Basic_Log_Test/run_test.pl
new file mode 100755
index 00000000000..8cd52e4559d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Basic_Log_Test/run_test.pl
@@ -0,0 +1,57 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+
+unlink $nsior;
+
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
+$LS = new PerlACE::Process ("../../../Logging_Service/Basic_Logging_Service/Basic_Logging_Service", "-ORBInitRef NameService=file://$nsior");
+$CLIENT = new PerlACE::Process ("client", "-ORBInitRef NameService=file://$nsior");
+
+
+print STDERR "Starting Naming Service\n";
+
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 20) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Logging Service\n";
+
+$LS->Spawn ();
+
+# Give time for logging service to initialize and install its object
+# reference in the nameing service.
+sleep (5);
+
+print STDERR "Starting client\n";
+
+$CLIENT->Spawn ();
+
+$client = $CLIENT->WaitKill (10);
+
+$NS->Kill ();
+
+$LS->Kill ();
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+unlink $nsior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Log/Makefile.am b/TAO/orbsvcs/tests/Log/Makefile.am
new file mode 100644
index 00000000000..af99ab0bd2b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/Makefile.am
@@ -0,0 +1,13 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ Basic_Log_Test
+
diff --git a/TAO/orbsvcs/tests/Log/README b/TAO/orbsvcs/tests/Log/README
new file mode 100644
index 00000000000..9dae3bd4f90
--- /dev/null
+++ b/TAO/orbsvcs/tests/Log/README
@@ -0,0 +1,10 @@
+Telecom Logging Service Tests
+=============================
+
+Please see the README document in the Basic_Log_Test subdirectory for
+details on how to execute the Telecom Logging Service tests.
+
+Author:
+-------
+David Hanvey
+send suggestions, bugs, to David Hanvey <d.hanvey@qub.ac.uk>
diff --git a/TAO/orbsvcs/tests/Makefile.am b/TAO/orbsvcs/tests/Makefile.am
new file mode 100644
index 00000000000..3db8a30cb7f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Makefile.am
@@ -0,0 +1,56 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ AVStreams \
+ BiDir_CORBALOC \
+ Bug_1334_Regression \
+ Bug_1393_Regression \
+ Bug_1395_Regression \
+ Bug_1630_Regression \
+ Bug_2074_Regression \
+ Bug_2137_Regression \
+ Bug_2247_Regression \
+ Bug_2248_Regression \
+ Bug_2285_Regression \
+ Bug_2287_Regression \
+ Bug_2316_Regression \
+ Bug_2377_Regression \
+ Concurrency \
+ CosEvent \
+ EC_Custom_Marshal \
+ EC_MT_Mcast \
+ EC_Mcast \
+ EC_Multiple \
+ EC_Throughput \
+ Event \
+ FT_App \
+ FaultTolerance \
+ FtRtEvent \
+ HTIOP \
+ IOR_MCast \
+ ImplRepo \
+ InterfaceRepo \
+ Interoperable_Naming \
+ LoadBalancing \
+ Log \
+ Miop \
+ Notify \
+ Property \
+ Redundant_Naming \
+ Sched \
+ Sched_Conf \
+ Security \
+ Simple_Naming \
+ Time \
+ Trading \
+ ior_corbaname \
+ tests_svc_loader
+
diff --git a/TAO/orbsvcs/tests/Miop/Makefile.am b/TAO/orbsvcs/tests/Miop/Makefile.am
new file mode 100644
index 00000000000..2cf8fffb790
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/Makefile.am
@@ -0,0 +1,13 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ McastHello
+
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/Makefile.am b/TAO/orbsvcs/tests/Miop/McastHello/Makefile.am
new file mode 100644
index 00000000000..a0a511d4393
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/Makefile.am
@@ -0,0 +1,130 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.McastHello_Idl.am
+
+BUILT_SOURCES = \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+CLEANFILES = \
+ Test-stamp \
+ TestC.cpp \
+ TestC.h \
+ TestC.inl \
+ TestS.cpp \
+ TestS.h \
+ TestS.inl
+
+TestC.cpp TestC.h TestC.inl TestS.cpp TestS.h TestS.inl: Test-stamp
+
+Test-stamp: $(srcdir)/Test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Test.idl
+
+## Makefile.McastHello_Client.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ TestC.cpp \
+ client.cpp \
+ McastHello.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.McastHello_Server.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ McastHello.cpp \
+ TestC.cpp \
+ TestS.cpp \
+ server.cpp \
+ McastHello.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/McastHello.cpp b/TAO/orbsvcs/tests/Miop/McastHello/McastHello.cpp
new file mode 100644
index 00000000000..c9b304c57bd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/McastHello.cpp
@@ -0,0 +1,68 @@
+//
+// $Id$
+//
+#include "McastHello.h"
+
+ACE_RCSID(McastHello, McastHello, "$Id$")
+
+McastHello::McastHello (CORBA::ORB_ptr orb,
+ int instance)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ instance_ (instance),
+ small_request_status_ (0),
+ large_request_status_ (0)
+{
+}
+
+void
+McastHello::send_forty_two (CORBA::Long forty_two ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->small_request_status_ == 0 &&
+ forty_two == 42)
+ {
+ this->small_request_status_ = 1;
+ }
+ else
+ this->small_request_status_ = 0;
+}
+
+void
+McastHello::send_large_octet_array (const Test::Octets &payload ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Boolean valid_payload = 1;
+ for (CORBA::ULong i = 0; i < payload.length (); ++i)
+ {
+ if ((CORBA::ULong) payload [i] != i % 256)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "ERROR: (%P|%t) McastHello::send_large_octet_array, "
+ "unexpected value at index %d (%d != %d)\n",
+ i, payload [i], i % 256));
+ valid_payload = 0;
+ break;
+ }
+ }
+
+ if (this->large_request_status_ == 0 &&
+ valid_payload == 1)
+ {
+ this->large_request_status_ = 1;
+ }
+ else
+ this->large_request_status_ = 0;
+}
+
+void
+McastHello::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+CORBA::Boolean
+McastHello::get_status ()
+{
+ return this->large_request_status_ && this->small_request_status_;
+}
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/McastHello.h b/TAO/orbsvcs/tests/Miop/McastHello/McastHello.h
new file mode 100644
index 00000000000..d0135f3ae55
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/McastHello.h
@@ -0,0 +1,51 @@
+//
+// $Id$
+//
+
+#ifndef MCASTHELLO_H
+#define MCASTHELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+/// Implement the Test::McastHello interface
+class McastHello
+ : public virtual POA_Test::McastHello
+{
+public:
+ /// Constructor
+ McastHello (CORBA::ORB_ptr orb,
+ int instance);
+
+ // = The skeleton methods
+ virtual void send_forty_two (CORBA::Long forty_two ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return whether all test requests have been received successfully.
+ CORBA::Boolean get_status ();
+
+ // Silence the builds
+ void send_large_octet_array (const Test::Octets &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to convert strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+
+ /// The instance number. (Useful when debugging multiple servants)
+ int instance_;
+
+ /// Track the success/failure of the small request.
+ CORBA::Boolean small_request_status_;
+
+ /// Track the success/failure of the large request.
+ CORBA::Boolean large_request_status_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* MCASTHELLO_H */
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/McastHello.mpc b/TAO/orbsvcs/tests/Miop/McastHello/McastHello.mpc
new file mode 100644
index 00000000000..8e9210a7702
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/McastHello.mpc
@@ -0,0 +1,32 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*server): orbsvcsexe, portablegroup, portableserver {
+ after += *idl
+ Source_Files {
+ McastHello.cpp
+ TestS.cpp
+ TestC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*client): orbsvcsexe, portablegroup, portableserver {
+ after += *idl
+ Source_Files {
+ TestC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/README b/TAO/orbsvcs/tests/Miop/McastHello/README
new file mode 100644
index 00000000000..2b7205b555d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/README
@@ -0,0 +1,34 @@
+/**
+
+@page McastHello Test README File
+
+This test verifies basic functionality of the MIOP support in TAO.
+It creates two servers that listen on the same group id for requests.
+A client then sends a few requests using MIOP. If both servers
+receive the multicast requests as expected, the test is successful.
+The most likely failure of the test is if the servers don't receive
+the requests and subsequently time out.
+
+ To run the test, use the run_test.pl script:
+
+$ ./run_test.pl
+
+ the script returns 0 if the test was successful.
+
+The test has some unique features that should be noted by
+users. Firstly, server.cpp includes MIOP.h, which has some magic for
+loading MIOP protocol in static builds. Secondly, the svc.conf has
+a directive for loading the right protocol factory. Both of them are
+required for static builds in addition to linking with the
+TAO_PortableGroup library.
+
+However for dynamic builds things are different
+
+. One need not include MIOP.h. Including MIOP.h will require linking
+ in the TAO_PortableGroup library
+
+. The entries in the svc.conf should have dynamic directives. In
+ svc.conf you would be required to remove commented parts and run
+ the test.
+
+*/
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/Test.idl b/TAO/orbsvcs/tests/Miop/McastHello/Test.idl
new file mode 100644
index 00000000000..e3babc5d5a2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/Test.idl
@@ -0,0 +1,26 @@
+//
+// $Id$
+//
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ /// A sequence of octets for sending large messages.
+ typedef sequence<octet> Octets;
+
+ /// A very simple interface
+ interface McastHello
+ {
+ /// A method to test out a small request
+ oneway void send_forty_two (in long forty_two);
+
+ /// A method to test bigger requests
+ oneway void send_large_octet_array (in Octets payload);
+
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+ };
+};
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/client.conf.xml b/TAO/orbsvcs/tests/Miop/McastHello/client.conf.xml
new file mode 100644
index 00000000000..17625811005
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/client.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Miop/McastHello/client.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="UIPMC_Factory" type="Service_Object">
+ <initializer path="TAO_PortableGroup" init="_make_TAO_UIPMC_Protocol_Factory"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/client.cpp b/TAO/orbsvcs/tests/Miop/McastHello/client.cpp
new file mode 100644
index 00000000000..10180538dbf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/client.cpp
@@ -0,0 +1,103 @@
+// $Id$
+
+#include "TestC.h"
+#include "ace/Get_Opt.h"
+#include "tao/Object_T.h"
+#include "orbsvcs/PortableGroup/MIOP.h"
+
+ACE_RCSID(Hello, client, "$Id$")
+
+#define MAX_MIOP_OCTET_SEQUENCE (ACE_MAX_DGRAM_SIZE - 272 /* MIOP_MAX_HEADER_SIZE */)
+
+const char *ior = "file://test.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates successful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ /* Do an unchecked narrow since there's no way to do an is_a on
+ * a multicast reference (yet...).
+ */
+ Test::McastHello_var hello =
+ TAO::Narrow_Utils<Test::McastHello>::unchecked_narrow (
+ tmp.in (),
+ Test__TAO_McastHello_Proxy_Broker_Factory_function_pointer
+ );
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ hello->send_forty_two (42 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Octets payload (MAX_MIOP_OCTET_SEQUENCE);
+ payload.length (MAX_MIOP_OCTET_SEQUENCE);
+
+ for (CORBA::ULong j = 0; j != MAX_MIOP_OCTET_SEQUENCE; ++j)
+ {
+ payload[j] = j % 256;
+ }
+
+ hello->send_large_octet_array (payload ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ hello->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/run_test.pl b/TAO/orbsvcs/tests/Miop/McastHello/run_test.pl
new file mode 100755
index 00000000000..316cf14a560
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+$iorfile_server2 = PerlACE::LocalFile ("server.ior.unused");
+unlink $iorfile;
+unlink $iorfile_server2;
+$status = 0;
+
+$SV1 = new PerlACE::Process ("server", "-o $iorfile");
+$SV2 = new PerlACE::Process ("server", "-o $iorfile_server2 ");
+$CL = new PerlACE::Process ("client", " -k file://$iorfile ");
+
+$SV1->Spawn ();
+$SV2->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ($iorfile_server2, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile_server2>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV1->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+$server = $SV2->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+unlink $iorfile_server2;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/server.conf.xml b/TAO/orbsvcs/tests/Miop/McastHello/server.conf.xml
new file mode 100644
index 00000000000..22bb269016c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/server.conf.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Miop/McastHello/server.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="UIPMC_Factory" type="Service_Object">
+ <initializer path="TAO_PortableGroup" init="_make_TAO_UIPMC_Protocol_Factory"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory"/>
+ <!-- static PortableGroup_Loader "" -->
+ <dynamic id="PortableGroup_Loader" type="Service_Object">
+ <initializer path="TAO_PortableGroup" init="_make_TAO_PortableGroup_Loader"/>
+ </dynamic>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/server.cpp b/TAO/orbsvcs/tests/Miop/McastHello/server.cpp
new file mode 100644
index 00000000000..ecf06638ce2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/server.cpp
@@ -0,0 +1,144 @@
+// $Id$
+
+#include "McastHello.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "orbsvcs/PortableGroup/MIOP.h"
+#include "orbsvcs/PortableGroup/GOA.h"
+
+ACE_RCSID (McastHello,
+ server,
+ "$Id$")
+
+static const char *ior_output_file = "test.ior";
+
+// Use a multicast address in the administrative "site local" range, 239.255.0.0 to
+// 239.255.255.255. The range 224.255.0.0 to 238.255.255.255 should also be valid
+// too.
+//static const char *group_ior = "corbaloc:miop:1.0@1.0-TestDomain-1/239.255.0.1:16000";
+static const char *group_ior = "corbaloc:miop:1.0@1.0-TestDomain-1/224.1.239.2:1234";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case 'g':
+ group_ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "-g <group ior corbaloc>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableGroup::GOA_var root_poa =
+ PortableGroup::GOA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // Get the group IOR.
+ CORBA::String_var ior = CORBA::string_dup (group_ior);
+
+
+ CORBA::Object_var group1 =
+ orb->string_to_object (ior.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the Group IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ PortableServer::ObjectId_var id =
+ root_poa->create_id_for_reference (group1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create and activate an instance of our servant.
+ McastHello server_impl (orb.in (), 0);
+
+ root_poa->activate_object_with_id (id.in (),
+ &server_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Validate that our servants got the right requests.
+ if (server_impl.get_status () == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Multicast Servant did not receive expected requests!\n"),
+ 1);
+ else
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - Success!\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Miop/McastHello/svc.conf b/TAO/orbsvcs/tests/Miop/McastHello/svc.conf
new file mode 100644
index 00000000000..d509909846c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/McastHello/svc.conf
@@ -0,0 +1,4 @@
+#dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() ""
+static Resource_Factory "-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory"
+#static PortableGroup_Loader ""
+#dynamic PortableGroup_Loader Service_Object * TAO_PortableGroup:_make_TAO_PortableGroup_Loader() ""
diff --git a/TAO/orbsvcs/tests/Miop/README b/TAO/orbsvcs/tests/Miop/README
new file mode 100644
index 00000000000..a18f066d6b1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Miop/README
@@ -0,0 +1,13 @@
+$Id$
+
+This directory houses a collection of tests that exercise TAO support
+for features defined in the MIOP specification.
+
+Each individual subdirectory contains a README file with more
+information on the corresponding test. The list of tests so far
+includes the following:
+
+ . McastHello
+
+ Tests basic MIOP functionality.
+
diff --git a/TAO/orbsvcs/tests/Notify/Basic/AdminProperties.cpp b/TAO/orbsvcs/tests/Notify/Basic/AdminProperties.cpp
new file mode 100644
index 00000000000..08309efacca
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/AdminProperties.cpp
@@ -0,0 +1,490 @@
+// $Id$
+
+#include "AdminProperties.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/debug.h"
+
+/***************************************************************************/
+
+AdminProperties_Task::AdminProperties_Task (void)
+ : supplier_ (0)
+ , client_ (0)
+{
+}
+
+void
+AdminProperties_Task::init (TAO_Notify_Tests_StructuredPushSupplier *supplier, AdminProperties* client)
+{
+ supplier_ = supplier;
+ client_ = client;
+}
+
+int
+AdminProperties_Task::init (int argc, ACE_TCHAR *argv[])
+{
+ return ACE_Task_Base::init (argc, argv);
+}
+
+int
+AdminProperties_Task::svc (void)
+{
+ // operations:
+ CosNotification::StructuredEvent event;
+
+ // EventHeader
+
+ // FixedEventHeader
+ // EventType
+ // string
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ event.header.variable_header.length (0); // put nothing here
+
+ // FilterableEventBody
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup("threshold");
+
+ event.filterable_data[1].name = CORBA::string_dup("temperature");
+ event.filterable_data[1].value <<= (CORBA::Long)70;
+
+ event.filterable_data[2].name = CORBA::string_dup("pressure");
+ event.filterable_data[2].value <<= (CORBA::Long)80;
+
+ // @@ CORBA::Short prio = CosNotification::LowestPriority;
+
+ int event_count = this->client_->event_count_;
+
+ ACE_DEBUG ((LM_DEBUG, "\n1 supplier sending %d events...\n", event_count));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ for (int i = 0 ; i < event_count; ++i)
+ {
+ event.filterable_data[0].value <<= (CORBA::Long)i;
+
+ event.remainder_of_body <<= (CORBA::Long)i;
+
+ ACE_TRY
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ this->supplier_->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::IMP_LIMIT, impl_limit)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "\nEvent %d was not send due to Impl Limit reached\n", i));
+
+ ++ this->client_->rejections_;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: Exception sending event\n");
+ return 1;
+ }
+ ACE_ENDTRY;
+ }
+
+return 0;
+}
+/***************************************************************************/
+
+AdminProperties_StructuredPushConsumer::AdminProperties_StructuredPushConsumer (AdminProperties* client)
+ : client_ (client)
+ , events_received_ (0)
+{
+ client_->consumer_start(this);
+}
+
+void
+AdminProperties_StructuredPushConsumer::push_structured_event (const CosNotification::StructuredEvent & /*notification*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,CosEventComm::Disconnected))
+{
+ ++events_received_;
+
+ if (events_received_ >= client_->max_queue_length_)
+ client_->consumer_done(this);
+
+ ACE_DEBUG((LM_DEBUG, "-"));
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "\nConsumer %x received event %d\n", this, events_received_.value ()));
+}
+
+/***************************************************************************/
+
+AdminProperties::AdminProperties (void)
+ : max_queue_length_ (10),
+ max_consumers_ (3),
+ max_suppliers_ (3),
+ reject_new_events_ (0),
+ consumers_ (4),
+ suppliers_ (4),
+ event_count_ (30),
+ suppliers_connected_count_ (0),
+ consumers_connected_count_ (0),
+ rejections_ (0)
+{
+}
+
+AdminProperties::~AdminProperties (void)
+{
+}
+
+int
+AdminProperties::parse_args(int argc, char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-max_queue_length")))
+ {
+ this->max_queue_length_ = ACE_OS::atoi (current_arg);
+ // Max. queue length.
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-max_consumers")))
+ {
+ this->max_consumers_ = ACE_OS::atoi (current_arg);
+ // Max consumers allowed to connect.
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-max_suppliers")))
+ {
+ this->max_suppliers_ = ACE_OS::atoi (current_arg);
+ // Max. number of suppliers allowed to connect.
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-reject_new_events") == 0)
+ {
+ this->reject_new_events_ = 1;
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-consumers")))
+ {
+ this->consumers_ = ACE_OS::atoi (current_arg);
+ // Number of consumers to create.
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-suppliers")))
+ {
+ this->suppliers_ = ACE_OS::atoi (current_arg);
+ // Number of suppliers to create.
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s "
+ "-max_queue_length [max_queue_length] "
+ "-max_consumers [max_consumers] "
+ "-max_suppliers [max_suppliers] "
+ "-reject_new_events [reject_new_events] "
+ "-consumers [consumers] "
+ "-suppliers [suppliers] "
+ "-event_count [event_count] ",
+ argv[0],
+ argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+ return 0;
+}
+
+void
+AdminProperties::create_channel(bool reject ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ initial_admin_.length (4);
+
+ this->initial_admin_[0].name =
+ CORBA::string_dup (CosNotification::MaxQueueLength);
+ this->initial_admin_[0].value <<= this->max_queue_length_;
+
+
+ this->initial_admin_[1].name =
+ CORBA::string_dup (CosNotification::MaxSuppliers);
+ this->initial_admin_[1].value <<= this->max_suppliers_;
+
+ this->initial_admin_[2].name =
+ CORBA::string_dup (CosNotification::MaxConsumers);
+ this->initial_admin_[2].value <<= this->max_consumers_;
+
+
+ this->initial_admin_[3].name =
+ CORBA::string_dup (CosNotification::RejectNewEvents);
+ this->initial_admin_[3].value <<= CORBA::Any::from_boolean (reject);
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ this->supplier_admin_ = ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ this->consumer_admin_ = ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+}
+
+void
+AdminProperties::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool reject = true;
+ this->create_channel(reject ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->test_max_queue_length (reject ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ec_->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ reject = false;
+ this->create_channel(reject ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->test_max_queue_length (reject ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->test_max_clients (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+AdminProperties::test_max_queue_length (bool reject ACE_ENV_ARG_DECL)
+{
+ // Create the consumer
+ AdminProperties_StructuredPushConsumer *consumer;
+ ACE_NEW (consumer, AdminProperties_StructuredPushConsumer (this));
+ consumer->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ consumer->connect (this->consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create the supplier
+ TAO_Notify_Tests_StructuredPushSupplier *supplier = 0;
+ ACE_NEW (supplier, TAO_Notify_Tests_StructuredPushSupplier ());
+ supplier->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier->connect (this->supplier_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ AdminProperties_Task supplier_task;
+
+ // Init the Task to send events;
+ supplier_task.init (supplier, this);
+
+ if (supplier_task.activate (THR_NEW_LWP | THR_JOINABLE, 1) != 0)
+ {
+ ACE_ERROR ((LM_ERROR, "\nCannot activate supplier task\n"));
+ }
+
+ // All supplier events should be sent before the first consumer event is
+ // received. This relies on our use of -ORBClientConnectionHandler RW.
+ supplier_task.wait ();
+
+ this->ORB_run(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // consumer is destroyed by consumer->disconnect()
+ CORBA::Long received_count = consumer->events_received_.value ();
+
+ // disconnect the participants.
+ consumer->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ supplier->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // If the reject_new_events setting == true, then the supplier should
+ // have received an imp_limit exception for each event it tried to push
+ // after the maximum was reached.
+ // If the reject_new_events setting == false, then the events should
+ // have been discarded according to the DiscardPolicy, which for this
+ // test we leave as AnyOrder.
+
+ ACE_DEBUG ((LM_DEBUG, "\nSupplier sent %d events, consumer received %d events, max_queue_length = %d\n",
+ event_count_, received_count, max_queue_length_));
+
+ int expected_min = max_queue_length_;
+ int expected_max = max_queue_length_ + max_consumers_;
+ if (reject)
+ {
+ expected_max = event_count_ - rejections_;
+ expected_min = expected_max;
+ }
+
+ if (reject && rejections_ != event_count_ - received_count)
+ {
+ ACE_ERROR ((LM_ERROR, "\nError: Expected %d rejections, but got %d\n",
+ event_count_ - received_count, rejections_));
+ return;
+ }
+
+ if (received_count < expected_min || received_count > expected_max)
+ {
+ ACE_ERROR ((LM_ERROR, "\nError: Expected %d to %d events, but received %d\n",
+ expected_min, expected_max, received_count));
+ }
+}
+
+void
+AdminProperties::test_max_clients (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->create_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->create_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // check the results and print the assessment.
+ if (this->consumers_connected_count_ > this->max_consumers_)
+ ACE_DEBUG ((LM_ERROR, "\nConnected consumers %d, exceed MaxConsumers %d\n",
+ this->consumers_connected_count_ > this->max_consumers_));
+
+ if (this->suppliers_connected_count_ > this->max_suppliers_)
+ ACE_DEBUG ((LM_ERROR, "\nConnected suppliers %d, exceed MaxSuppliers %d\n",
+ this->suppliers_connected_count_ > this->max_suppliers_));
+}
+
+void
+AdminProperties::create_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Create the requested number of suppliers.
+ // @@ CosNotifyChannelAdmin::AdminID adminid;
+ // @@ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ // @@ CosNotifyChannelAdmin::OR_OP;
+
+ int index = 0;
+
+ ACE_TRY
+ {
+ TAO_Notify_Tests_StructuredPushSupplier *supplier;
+
+ for (index = 0; index < this->suppliers_; ++index)
+ {
+ ACE_NEW (supplier,
+ TAO_Notify_Tests_StructuredPushSupplier ());
+ supplier->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ supplier->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->suppliers_connected_count_++;
+ }
+ }
+ ACE_CATCH (CORBA::IMP_LIMIT, impl_limit)
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "\nImpl Limit excpetion when connecting supplier\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "\nError: Exception in connecting supplier\n");
+ }
+ ACE_ENDTRY;
+}
+
+void
+AdminProperties::create_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Create the requested number of suppliers.
+ // @@ CosNotifyChannelAdmin::AdminID adminid;
+ // @@ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ // @@ CosNotifyChannelAdmin::OR_OP;
+
+ int index = 0;
+
+ ACE_TRY
+ {
+ TAO_Notify_Tests_StructuredPushConsumer *consumer;
+
+ for (index = 0; index < this->consumers_; ++index)
+ {
+ ACE_NEW (consumer, TAO_Notify_Tests_StructuredPushConsumer ());
+ consumer->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer->connect (this->consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->consumers_connected_count_++;
+ }
+ }
+ ACE_CATCH (CORBA::IMP_LIMIT, impl_limit)
+ {
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "\nImpl Limit exception when connecting consumer\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "\nError: Exception in connecting consumer \n");
+ }
+ ACE_ENDTRY;
+}
+
+/***************************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ AdminProperties test;
+
+ ACE_TRY_NEW_ENV
+ {
+ test.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ test.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/AdminProperties.h b/TAO/orbsvcs/tests/Notify/Basic/AdminProperties.h
new file mode 100644
index 00000000000..44abf483bf7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/AdminProperties.h
@@ -0,0 +1,153 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// AdminProperties.h
+//
+// = DESCRIPTION
+// Test for EC Admin QoS properties.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef ADMINPROPERTIES
+#define ADMINPROPERTIES
+
+#include "ace/Task.h"
+#include "Notify_Test_Client.h"
+#include "Notify_StructuredPushConsumer.h"
+#include "Notify_StructuredPushSupplier.h"
+
+class AdminProperties;
+/***************************************************************************/
+
+class AdminProperties_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+ friend class AdminProperties;
+public:
+ AdminProperties_StructuredPushConsumer (AdminProperties* client);
+
+ // = StructuredPushSupplier methods
+ virtual void push_structured_event (const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+protected:
+ AdminProperties* client_;
+
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, CORBA::Long> events_received_;
+};
+
+
+class AdminProperties_Task : public ACE_Task_Base
+{
+ // = TITLE
+ // Run a thread to dispatch events.
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class.
+ //
+
+public:
+ AdminProperties_Task (void);
+ // Constructor.
+
+ /// Init this object.
+ void init (TAO_Notify_Tests_StructuredPushSupplier *supplier, AdminProperties* client);
+
+ virtual int init (int argc, ACE_TCHAR *argv []);
+
+ virtual int svc (void);
+ // The thread entry point.
+
+private:
+ /// Supplier
+ TAO_Notify_Tests_StructuredPushSupplier *supplier_;
+
+ /// Client Object.
+ AdminProperties* client_;
+};
+
+/***************************************************************************/
+
+class AdminProperties : public Notify_Test_Client
+{
+ // = TITLE
+ // AdminProperties
+ //
+ // = DESCRIPTION
+ // Test for Notify EC properties -
+ // max_queue_length
+ // max_consumers
+ // max_suppliers
+ // reject_new_events
+ //
+
+ friend class AdminProperties_StructuredPushConsumer;
+ friend class AdminProperties_Task;
+
+public:
+ AdminProperties (void);
+ ~AdminProperties (void);
+
+ int parse_args (int argc, char *argv[]) ;
+
+ // Initialization.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+private:
+ void create_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ void create_consumers (ACE_ENV_SINGLE_ARG_DECL);
+ void create_channel(bool reject ACE_ENV_ARG_DECL);
+
+ /// Test MaxSuppliers and MaxConsumers
+ void test_max_clients (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Test MaxQueueLength properties
+ void test_max_queue_length (bool reject ACE_ENV_ARG_DECL);
+
+ // Data Members
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ CORBA::Long max_queue_length_;
+ CORBA::Long max_consumers_;
+ CORBA::Long max_suppliers_;
+ CORBA::Boolean reject_new_events_;
+ // Values for Admin Properties supplied by user.
+
+ /// Number of consumers to connect to check MaxConsumers property.
+ CORBA::Long consumers_;
+
+ /// Number of suppliers to connect to check MaxSuppliers property.
+ CORBA::Long suppliers_;
+
+ CORBA::Long event_count_;
+ // Number of events to send to the channel.
+
+ /// Count of consumers successfully connect to the EC.
+ int suppliers_connected_count_;
+
+ /// Count of consumers successfully connect to the EC.
+ int consumers_connected_count_;
+
+ // Number of supplier pushes that resulted in an IMP_LIMIT exception
+ int rejections_;
+};
+
+#endif /* ADMINPROPERTIES */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Basic.mpc b/TAO/orbsvcs/tests/Notify/Basic/Basic.mpc
new file mode 100644
index 00000000000..8ffdc65eb82
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Basic.mpc
@@ -0,0 +1,73 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Notify ConnectDisconnect): notifytest {
+ exename = ConnectDisconnect
+ Source_Files {
+ ConnectDisconnect.cpp
+ }
+}
+
+
+project(*Notify LifeCycle): notifytest {
+ exename = LifeCycle
+ Source_Files {
+ LifeCycle.cpp
+ }
+}
+
+project(*Notify IdAssignment): notifytest {
+ exename = IdAssignment
+ Source_Files {
+ IdAssignment.cpp
+ }
+}
+
+project(*Notify Events): notifytest {
+ exename = Events
+ Source_Files {
+ Events.cpp
+ }
+}
+
+project(*Notify AdminProperties): notifytest {
+ exename = AdminProperties
+ Source_Files {
+ AdminProperties.cpp
+ }
+}
+
+project(*Notify Simple): notifytest {
+ exename = Simple
+ Source_Files {
+ Simple.cpp
+ }
+}
+
+project(*Notify MultiTypes): notifytest {
+ exename = MultiTypes
+ Source_Files {
+ MultiTypes.cpp
+ }
+}
+
+project(*Notify Filter): notifytest {
+ exename = Filter
+ Source_Files {
+ Filter.cpp
+ }
+}
+
+project(*Notify Updates): notifytest {
+ exename = Updates
+ Source_Files {
+ Updates.cpp
+ }
+}
+
+project(*Notify Sequence): notifytest {
+ exename = Sequence
+ Source_Files {
+ Sequence.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.cpp b/TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.cpp
new file mode 100644
index 00000000000..f3087187a05
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.cpp
@@ -0,0 +1,382 @@
+//$Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "ConnectDisconnect.h"
+
+ACE_RCSID (Notify_Tests, ConnectDisconnect, "$Id$")
+
+#define CD_IMPLEMENT_ENTITY(X)\
+\
+CD_##X::CD_##X (ConnectDisconnect* cd, int id) \
+ :CD_Entity (cd, id) \
+{ \
+}
+
+CD_Entity::CD_Entity (ConnectDisconnect* cd, int id)
+ :id_ (id),
+ cd_ (cd)
+{
+}
+
+CD_Entity::~CD_Entity ()
+{
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Entity #%d destroyed\n", this->id_));
+ }
+
+ cd_->on_entity_destroyed ();
+}
+
+CD_IMPLEMENT_ENTITY(PushConsumer)
+CD_IMPLEMENT_ENTITY(StructuredPushConsumer)
+CD_IMPLEMENT_ENTITY(SequencePushConsumer)
+
+CD_IMPLEMENT_ENTITY(PushSupplier)
+CD_IMPLEMENT_ENTITY(StructuredPushSupplier)
+CD_IMPLEMENT_ENTITY(SequencePushSupplier)
+
+//*****************************************************************************************************
+
+ConnectDisconnect::ConnectDisconnect (void)
+ :any_consumer_ (0),
+ structured_consumer_ (0),
+ sequence_consumer_ (0),
+ any_supplier_ (0),
+ structured_supplier_ (0),
+ sequence_supplier_ (0),
+ count_ (3),
+ consumers_ (3),
+ suppliers_ (3)
+{
+}
+
+ConnectDisconnect::~ConnectDisconnect ()
+{
+ delete [] this->any_consumer_;
+ delete [] this->structured_consumer_;
+ delete [] this->sequence_consumer_;
+
+ delete [] this->any_supplier_;
+ delete [] this->structured_supplier_;
+ delete [] this->sequence_supplier_;
+}
+
+void
+ConnectDisconnect::on_entity_destroyed (void)
+{
+ this->result_count_++;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "result_count = %d\n",
+ this->result_count_.value ()));
+}
+
+int
+ConnectDisconnect::init (int argc,
+ char* argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the base class.
+ Notify_Test_Client::init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);;
+
+ // Create all participants.
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ this->supplier_admin_ =
+ ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);;
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ this->consumer_admin_ =
+ ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ // How many are we counting..?
+ this->expected_count_ = count_ * (consumers_ * 3 + suppliers_ * 3);
+
+ // Create the consumers and suppliers.
+
+ // Arrays of Consumers.
+ ACE_NEW_RETURN (this->any_consumer_,
+ TAO_Notify_Tests_PushConsumer*[this->consumers_],
+ -1);
+ ACE_NEW_RETURN (this->structured_consumer_,
+ TAO_Notify_Tests_StructuredPushConsumer*[this->consumers_],
+ -1);
+ ACE_NEW_RETURN (this->sequence_consumer_,
+ TAO_Notify_Tests_SequencePushConsumer*[this->consumers_],
+ -1);
+
+ // Arrays of Suppliers.
+ ACE_NEW_RETURN (this->any_supplier_,
+ TAO_Notify_Tests_PushSupplier*[this->suppliers_],
+ -1);
+ ACE_NEW_RETURN (this->structured_supplier_,
+ TAO_Notify_Tests_StructuredPushSupplier*[this->suppliers_],
+ -1);
+ ACE_NEW_RETURN (this->sequence_supplier_,
+ TAO_Notify_Tests_SequencePushSupplier*[this->suppliers_],
+ -1);
+
+ consumer_start( 0 );
+ return 0;
+}
+
+int
+ConnectDisconnect::parse_args(int argc, char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc,
+ argv);
+
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-count")))
+ {
+ this->count_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-consumers")))
+ {
+ this->consumers_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-suppliers")))
+ {
+ this->suppliers_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s "
+ "-count testcount \n"
+ "-consumers number_of_consumers"
+ "-suppliers number_of_suppliers",
+ argv[0],
+ argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+ConnectDisconnect::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+}
+
+void
+ConnectDisconnect::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int iterations = 0; iterations < count_; ++iterations)
+ {
+ int i = 0;
+
+ for (i = 0; i < this->consumers_; ++i)
+ {
+ // Create and connect Any consumers.
+ ACE_NEW (this->any_consumer_[i],
+ CD_PushConsumer (this,
+ i));
+ this->any_consumer_[i]->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->any_consumer_[i]->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create and connect Structured consumers.
+ ACE_NEW (this->structured_consumer_[i],
+ CD_StructuredPushConsumer (this,
+ i));
+ this->structured_consumer_[i]->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->structured_consumer_[i]->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create and connect Sequence consumers.
+ ACE_NEW (this->sequence_consumer_[i],
+ CD_SequencePushConsumer (this,
+ i));
+ this->sequence_consumer_[i]->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->sequence_consumer_[i]->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ }
+
+ for (i = 0; i < this->suppliers_; ++i)
+ {
+ ACE_NEW (this->any_supplier_[i],
+ CD_PushSupplier (this,
+ i));
+ this->any_supplier_[i]->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->any_supplier_[i]->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create and connect Structured suppliers.
+ ACE_NEW (this->structured_supplier_[i],
+ CD_StructuredPushSupplier (this,
+ i));
+ this->structured_supplier_[i]->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->structured_supplier_[i]->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Create and connect Sequence suppliers.
+ ACE_NEW (this->sequence_supplier_[i],
+ CD_SequencePushSupplier (this,
+ i));
+ this->sequence_supplier_[i]->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->sequence_supplier_[i]->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ for (i = 0; i < this->consumers_; ++i)
+ {
+ // Disconnnect Any consumers.
+ this->any_consumer_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Disconnect Structured Consumers.
+ this->structured_consumer_[i]->disconnect (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ // Disconnect Sequence Consumers.
+ this->sequence_consumer_[i]->disconnect (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+ ACE_CHECK;
+ }
+
+ for (i = 0; i < this->suppliers_; ++i)
+ {
+ // Disconnnect Any suppliers.
+ this->any_supplier_[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Disconnect Structured Suppliers.
+ this->structured_supplier_[i]->disconnect (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ // Disconnect Sequence Suppliers.
+ this->sequence_supplier_[i]->disconnect (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+ ACE_CHECK;
+ }
+ }
+}
+
+void
+ConnectDisconnect::end_test (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ consumer_done( 0 );
+}
+
+int
+ConnectDisconnect::check_results (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "result_count_ = %d", this->result_count_.value ()));
+ ACE_DEBUG ((LM_DEBUG, " expected_count_ = %d\n", this->expected_count_));
+
+ if (this->result_count_ != this->expected_count_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "ConnectDisconnect test failed\n"));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "ConnectDisconnect test succeeded\n"));
+ }
+
+ // Destroy the channel.
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+/***************************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ ConnectDisconnect client;
+
+ if (client.parse_args (argc, argv) == -1)
+ {
+ return 1;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.end_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return client.check_results ();
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.h b/TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.h
new file mode 100644
index 00000000000..a08cd5dd3ad
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/ConnectDisconnect.h
@@ -0,0 +1,136 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// ConnectDisconnect.h
+//
+// = DESCRIPTION
+// Test connect-disconnect methods of Notify.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_CONNECT_DISCONNECT_H
+#define NOTIFY_CONNECT_DISCONNECT_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_StructuredPushConsumer.h"
+#include "Notify_StructuredPushSupplier.h"
+#include "Notify_PushConsumer.h"
+#include "Notify_PushSupplier.h"
+#include "Notify_SequencePushConsumer.h"
+#include "Notify_SequencePushSupplier.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class ConnectDisconnect;
+
+class CD_Entity
+{
+ // The entity that connects/disconnects.
+public:
+ CD_Entity (ConnectDisconnect* cd, int id);
+ ~CD_Entity ();
+private:
+ int id_;
+ ConnectDisconnect* cd_;
+};
+
+#define CD_DECLARE_ENTITY(X) \
+class CD_##X : public TAO_Notify_##X, public CD_Entity \
+{ \
+public: \
+ CD_##X (ConnectDisconnect* cd, int id); \
+};
+
+CD_DECLARE_ENTITY(PushConsumer)
+CD_DECLARE_ENTITY(StructuredPushConsumer)
+CD_DECLARE_ENTITY(SequencePushConsumer)
+
+CD_DECLARE_ENTITY(PushSupplier)
+CD_DECLARE_ENTITY(StructuredPushSupplier)
+CD_DECLARE_ENTITY(SequencePushSupplier)
+
+/***************************************************************************/
+
+class ConnectDisconnect : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code.
+ ConnectDisconnect (void);
+ virtual ~ConnectDisconnect ();
+
+ void on_entity_destroyed (void);
+ // Keeps track of how many objects were destroyed.
+
+ int parse_args (int argc,
+ char *argv[]);
+
+ int init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialization.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+ void end_test (ACE_ENV_SINGLE_ARG_DECL);
+ // End the test.
+
+ int check_results (void);
+ // Check if we got the expected results.
+
+protected:
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create EC.
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ TAO_Notify_Tests_PushConsumer** any_consumer_;
+ TAO_Notify_Tests_StructuredPushConsumer** structured_consumer_;
+ TAO_Notify_Tests_SequencePushConsumer** sequence_consumer_;
+ // Arrays of Consumers.
+
+ TAO_Notify_Tests_PushSupplier** any_supplier_;
+ TAO_Notify_Tests_StructuredPushSupplier** structured_supplier_;
+ TAO_Notify_Tests_SequencePushSupplier** sequence_supplier_;
+ // arrays of Suppliers
+
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> result_count_;
+ // Count of clients destroyed. for c consumers, s suppliers and for t times.
+ // this should be (s+c)*t.
+
+ int expected_count_; // (s+c)*t
+
+ // = command line params
+
+ int count_;
+ // The number of iterations to connect disconnect.
+
+ int consumers_;
+ // The number of counsumers to create.
+
+ int suppliers_;
+ // The number of suppliers to create.
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_TESTS_UPDATES_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Events.cpp b/TAO/orbsvcs/tests/Notify/Basic/Events.cpp
new file mode 100644
index 00000000000..58d348d5859
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Events.cpp
@@ -0,0 +1,355 @@
+//$Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "Events.h"
+
+ACE_RCSID (Notify_Tests, Events, "$Id$")
+
+/***************************************************************************/
+
+Event_StructuredPushConsumer::Event_StructuredPushConsumer (Events *test_client)
+ : test_client_ (test_client)
+{
+}
+
+void
+Event_StructuredPushConsumer::push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ int event_num;
+ notification.filterable_data[0].value >>= event_num;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "Received event# %d\n",
+ event_num));
+
+ this->test_client_->on_event_received ();
+}
+
+/***************************************************************************/
+
+Event_StructuredPushSupplier::Event_StructuredPushSupplier (
+ Events* test_client
+ )
+ : test_client_ (test_client)
+{
+}
+
+Event_StructuredPushSupplier::~Event_StructuredPushSupplier (void)
+{
+}
+
+/***************************************************************************/
+Events::Events (void)
+ : use_default_admin_ (0), event_count_ (5)
+{
+}
+
+Events::~Events (void)
+{
+}
+
+int
+Events::init (int argc,
+ char* argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the base class.
+ Notify_Test_Client::init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create all participents.
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ if (use_default_admin_ == 1)
+ {
+ this->supplier_admin_ =
+ this->ec_->default_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ this->supplier_admin_ =
+ this->ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ if (use_default_admin_ == 1)
+ {
+ this->consumer_admin_ =
+ this->ec_->default_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ this->consumer_admin_ =
+ this->ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ ACE_NEW_RETURN (this->consumer_,
+ Event_StructuredPushConsumer (this),
+ -1);
+ this->consumer_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->consumer_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ Event_StructuredPushConsumer* consumer2 = 0;
+ ACE_NEW_RETURN (consumer2,
+ Event_StructuredPushConsumer (this),
+ -1);
+ consumer2->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ consumer2->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->supplier_,
+ Event_StructuredPushSupplier (this),
+ -1);
+ this->supplier_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->supplier_->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ consumer_start( 0 );
+
+ return 0;
+}
+
+int
+Events::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc,
+ argv);
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-use_default_admin") == 0)
+ {
+ this->use_default_admin_ = 1;
+ arg_shifter.consume_arg ();
+
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-events")))
+ {
+ this->event_count_ = ACE_OS::atoi (current_arg);
+ // The number of events to send/receive.
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s "
+ "-use_default_admin "
+ "-events event_count \n",
+ argv[0], argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+Events::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /****************************************************************/
+ /*
+ CosNotification::AdminProperties admin(2);
+ admin.length (2);
+
+ admin[0].name =
+ CORBA::string_dup(CosNotification::MaxQueueLength);
+
+ admin[0].value <<= (CORBA::Long)5;
+
+ admin[1].name =
+ CORBA::string_dup(CosNotification::MaxConsumers);
+
+ admin[1].value <<= (CORBA::Long)2;
+
+ ec_->set_admin (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;*/
+
+ /****************************************************************/
+ ACE_ASSERT (!CORBA::is_nil (this->ec_.in ()));
+}
+
+void
+Events::on_event_received (void)
+{
+ ++this->result_count_;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "event count = #%d\n",
+ this->result_count_.value ()));
+
+ if (this->result_count_ == 2 * this->event_count_)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->end_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Events::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // operations:
+ CosNotification::StructuredEvent event;
+
+ // EventHeader.
+
+ // FixedEventHeader.
+ // EventType.
+ // string.
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields.
+ // PropertySeq.
+ // sequence<Property>: string name, any value
+ CosNotification::PropertySeq& qos = event.header.variable_header;
+ qos.length (1); // put nothing here
+
+ // FilterableEventBody
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup("threshold");
+
+ event.filterable_data[1].name = CORBA::string_dup("temperature");
+ event.filterable_data[1].value <<= (CORBA::Long)70;
+
+ event.filterable_data[2].name = CORBA::string_dup("pressure");
+ event.filterable_data[2].value <<= (CORBA::Long)80;
+
+ CORBA::Short prio = CosNotification::LowestPriority;
+
+ for (int i = 0; i < this->event_count_; ++i)
+ {
+ event.filterable_data[0].value <<= (CORBA::Long)i;
+
+ // any
+ event.remainder_of_body <<= (CORBA::Long)i;
+
+ qos[0].name = CORBA::string_dup (CosNotification::Priority);
+ qos[0].value <<= (CORBA::Short)prio++;
+
+ this->supplier_->send_event (event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Events::end_test (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ consumer_done( 0 );
+}
+
+int
+Events::check_results (void)
+{
+ // Destroy the channel.
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->result_count_ == 2 * this->event_count_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Events test success\n"));
+ return 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Events test failed!\n"));
+ return 1;
+ }
+}
+
+/***************************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ Events events;
+
+ if (events.parse_args (argc, argv) == -1)
+ {
+ return 1;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ events.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ events.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ events.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return events.check_results ();
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Events.h b/TAO/orbsvcs/tests/Notify/Basic/Events.h
new file mode 100644
index 00000000000..e7493489b67
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Events.h
@@ -0,0 +1,132 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Events.h
+//
+// = DESCRIPTION
+// Test to check if events are received by all 3 types of consumers.
+// This is intended to be a simple test without any filters with default subscription (all events).
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_TESTS_EventS_H
+#define NOTIFY_TESTS_EventS_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_StructuredPushConsumer.h"
+#include "Notify_StructuredPushSupplier.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class Events;
+
+class Event_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Event_StructuredPushConsumer (Events *test_client);
+ // Contructor.
+
+ // = StructuredPushSupplier methods.
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+
+protected:
+ Events * test_client_;
+};
+
+/***************************************************************************/
+
+class Event_StructuredPushSupplier : public TAO_Notify_Tests_StructuredPushSupplier
+{
+public:
+ Event_StructuredPushSupplier (Events * test_client);
+ // Constructor.
+
+ virtual ~Event_StructuredPushSupplier (void);
+ // Destructor.
+
+protected:
+ Events* test_client_;
+};
+
+/***************************************************************************/
+
+class Events : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code.
+ Events (void);
+ virtual ~Events (void);
+
+ int parse_args (int argc,
+ char *argv[]) ;
+
+ int init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // Initialization.
+
+ void on_event_received (void);
+ // Called when an event is received.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+ void end_test (ACE_ENV_SINGLE_ARG_DECL);
+ // End the test.
+
+ int check_results (void);
+ // check if we got the expected results.
+
+protected:
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create EC
+
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> result_count_;
+ // Number of events received so far.
+
+ /// Use the default admins.
+ int use_default_admin_;
+
+ int event_count_;
+ // Number of events to send
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ TAO_Notify_Tests_StructuredPushConsumer* consumer_;
+ // Consumer
+
+ TAO_Notify_Tests_StructuredPushSupplier* supplier_;
+ // Supplier
+
+private:
+ friend class Event_StructuredPushSupplier;
+ friend class Event_StructuredPushConsumer;
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_TESTS_EventS_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Filter.cpp b/TAO/orbsvcs/tests/Notify/Basic/Filter.cpp
new file mode 100644
index 00000000000..3d54679c307
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Filter.cpp
@@ -0,0 +1,249 @@
+//$Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "Filter.h"
+
+ACE_RCSID (Notify_Tests, Filter, "$Id$")
+
+Filter::Filter (void)
+ : event_count_ (5)
+{
+}
+
+Filter::~Filter (void)
+{
+}
+
+int
+Filter::init (int argc, char* argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Initialized the base class.
+ Notify_Test_Client::init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create all participents.
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ this->supplier_admin_ =
+ this->ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ this->consumer_admin_ =
+ this->ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ this->ffact_ =
+ ec_->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+Filter::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, " Obtaining FilterAdmin interface from ConsumerAdmin\n"));
+
+ CosNotifyFilter::FilterAdmin_var ca_filter_admin =
+ CosNotifyFilter::FilterAdmin::_narrow (consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->run_filter_test (consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Filter::run_filter_test (CosNotifyFilter::FilterAdmin_ptr filter_admin ACE_ENV_ARG_DECL)
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, " Calling remove_all_filters\n"));
+
+ // Clear all filters.
+ filter_admin->remove_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->verify_filter_count (filter_admin, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Adding a filter \n"));
+
+ CosNotifyFilter::FilterID id_1 = this->add_filter (filter_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->verify_filter_count (filter_admin, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Adding another filter \n"));
+
+ this->add_filter (filter_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->verify_filter_count (filter_admin, 2 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling print_filters \n"));
+ this->print_filters (filter_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Calling remove_filter\n"));
+
+ // remove the filter.
+ filter_admin->remove_filter (id_1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->verify_filter_count (filter_admin, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling print_filters \n"));
+ this->print_filters (filter_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Calling remove_all_filters \n"));
+
+ filter_admin->remove_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling print_filters \n"));
+ this->print_filters (filter_admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Make sure all filters are removed -
+ this->verify_filter_count (filter_admin, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Filters test has run successfully\n"));
+}
+
+void
+Filter::verify_filter_count (CosNotifyFilter::FilterAdmin_ptr filter_admin, CORBA::ULong expected_count ACE_ENV_ARG_DECL)
+{
+ expected_count = expected_count; // if we don;t do this, we get a warning on linux about arg not used.
+ CosNotifyFilter::FilterIDSeq_var filter_seq = filter_admin->get_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_ASSERT (filter_seq->length () == expected_count);
+}
+
+CosNotifyFilter::FilterID
+Filter::add_filter (CosNotifyFilter::FilterAdmin_ptr filter_admin ACE_ENV_ARG_DECL)
+{
+ // setup a filter at the filter admin
+ CosNotifyFilter::Filter_var filter =
+ this->ffact_->create_filter ("ETCL" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (filter.in ()));
+
+ const char* test_filter_string = "A > B";
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup (test_filter_string);
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyFilter::FilterID id = filter_admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Print the ID
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Added Filter %d\n", id));
+
+ return id;
+}
+
+void
+Filter::print_filters (CosNotifyFilter::FilterAdmin_ptr filter_admin ACE_ENV_ARG_DECL)
+{
+ CosNotifyFilter::FilterIDSeq_var filter_seq = filter_admin->get_all_filters (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Getting all %d filters...\n ", filter_seq->length ()));
+
+ for (CORBA::ULong i = 0; i < filter_seq->length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, " Filter %d\n", filter_seq[i]));
+ }
+}
+
+
+void
+Filter::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+}
+
+//***************************************************************************
+
+int
+main (int argc, char* argv[])
+{
+ Filter events;
+
+ if (events.parse_args (argc, argv) == -1)
+ {
+ return 1;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ events.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ events.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Filter.h b/TAO/orbsvcs/tests/Notify/Basic/Filter.h
new file mode 100644
index 00000000000..9bd93156d6d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Filter.h
@@ -0,0 +1,92 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Filter.h
+//
+// = DESCRIPTION
+// Filter test any supplier to any consumer.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_TESTS_FILTER_H
+#define NOTIFY_TESTS_FILTER_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_PushConsumer.h"
+#include "Notify_PushSupplier.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class Filter;
+
+class Filter : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code
+ Filter (void);
+ virtual ~Filter (void);
+
+ int init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialization.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+protected:
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create EC
+
+ /// Run some tests to check the filters.
+ void run_filter_test (CosNotifyFilter::FilterAdmin_ptr ACE_ENV_ARG_DECL);
+
+ /// Print the filter ids.
+ void print_filters (CosNotifyFilter::FilterAdmin_ptr filter_seq ACE_ENV_ARG_DECL);
+
+ /// Verify filter count.
+ void verify_filter_count (CosNotifyFilter::FilterAdmin_ptr filter_admin, CORBA::ULong expected_count ACE_ENV_ARG_DECL);
+
+ /// Add a filter.
+ CosNotifyFilter::FilterID add_filter (CosNotifyFilter::FilterAdmin_ptr filter_admin ACE_ENV_ARG_DECL);
+
+ /// The default filter factory.
+ CosNotifyFilter::FilterFactory_var ffact_;
+
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> result_count_;
+ // Number of events received so far.
+
+ int event_count_;
+ // Number of events to send
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ TAO_Notify_Tests_PushConsumer* consumer_;
+ // Consumer.
+
+ TAO_Notify_Tests_PushSupplier* supplier_;
+ // Supplier.
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_TESTS_FILTER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/IdAssignment.cpp b/TAO/orbsvcs/tests/Notify/Basic/IdAssignment.cpp
new file mode 100644
index 00000000000..ebfd98f3df1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/IdAssignment.cpp
@@ -0,0 +1,489 @@
+// $Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "IdAssignment.h"
+
+ACE_RCSID (Notify_Tests,
+ IdAssignment,
+ "$Id$")
+
+IdAssignment::IdAssignment (void)
+ : iter_ (3),
+ ec_count_ (3),
+ consumer_admin_count_ (3),
+ supplier_admin_count_ (3)
+{
+}
+
+IdAssignment::~IdAssignment (void)
+{
+}
+
+int
+IdAssignment::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-iter")))
+ {
+ this->iter_ = ACE_OS::atoi (current_arg);
+ // The number of times to repeat the test.
+ arg_shifter.consume_arg ();
+ }
+ if ((current_arg = arg_shifter.get_the_parameter ("-ec_count")))
+ {
+ this->ec_count_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ if ((current_arg = arg_shifter.get_the_parameter ("-ca_count")))
+ {
+ this->consumer_admin_count_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ if ((current_arg = arg_shifter.get_the_parameter ("-sa_count")))
+ {
+ this->supplier_admin_count_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s "
+ "-iter <count>",
+ "-ec_count <count>",
+ "-ca_count <count>",
+ "-sa_count <count>\n",
+ argv[0],
+ argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+IdAssignment::init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var rootObj =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (rootObj.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to resolve naming service !\n"));
+ return;
+
+ }
+ CosNaming::NamingContext_var rootNC =
+ CosNaming::NamingContext::_narrow (rootObj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = rootNC->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to locate Notify_Service \n"));
+ return;
+ }
+
+ this->notify_factory_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ obj.in()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+}
+
+CosNotifyChannelAdmin::ChannelID
+IdAssignment::create_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ this->notify_factory_->create_channel (initial_qos,
+ initial_admin,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return id;
+}
+
+
+void
+IdAssignment::destroy_ec(CosNotifyChannelAdmin::ChannelID id
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ this->notify_factory_->get_event_channel (id
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ if (CORBA::is_nil (ec.in()))
+ {
+ ACE_ERROR((LM_ERROR,
+ " (%P|%t) Unable to find event channel\n"));
+ return;
+ }
+
+ ec->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+CosNotifyChannelAdmin::AdminID
+IdAssignment::create_supplier_admin (CosNotifyChannelAdmin::ChannelID channel_id
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ this->notify_factory_->get_event_channel (channel_id
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ if (CORBA::is_nil (ec.in ()))
+ {
+ ACE_ERROR((LM_ERROR,
+ " (%P|%t) Unable to find event channel\n"));
+ return 0;
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->new_for_suppliers (ifgop,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (CORBA::is_nil (supplier_admin.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to create supplier admin\n"),0);
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "created supplier admin\n"));
+
+ return adminid;
+}
+
+CosNotifyChannelAdmin::AdminID
+IdAssignment::create_consumer_admin (CosNotifyChannelAdmin::ChannelID channel_id
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ this->notify_factory_->get_event_channel (channel_id
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ if (CORBA::is_nil (ec.in ()))
+ {
+ ACE_ERROR((LM_ERROR,
+ " (%P|%t) Unable to find event channel\n"));
+ return 0;
+ }
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers (ifgop,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (CORBA::is_nil (consumer_admin.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to create consumer admin\n"),0);
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "created consumer admin\n"));
+
+ return adminid;
+}
+
+
+void
+IdAssignment::destroy_consumer_admin (
+ CosNotifyChannelAdmin::ChannelID channel_id,
+ CosNotifyChannelAdmin::AdminID admin_id
+ ACE_ENV_ARG_DECL
+ )
+{
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ this->notify_factory_->get_event_channel (channel_id
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ if (CORBA::is_nil (ec.in ()))
+ {
+ ACE_ERROR((LM_ERROR,
+ " (%P|%t) Unable to find event channel\n"));
+ return;
+ }
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->get_consumeradmin (admin_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (consumer_admin.in()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to get consumer admin\n"));
+ }
+
+ consumer_admin->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "destroyed consumer admin\n"));
+}
+
+
+void
+IdAssignment::destroy_supplier_admin (
+ CosNotifyChannelAdmin::ChannelID channel_id,
+ CosNotifyChannelAdmin::AdminID admin_id
+ ACE_ENV_ARG_DECL
+ )
+{
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ this->notify_factory_->get_event_channel (channel_id
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK;
+
+ if (CORBA::is_nil (ec.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to find event channel\n"));
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin =
+ ec->get_supplieradmin (admin_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier_admin.in ()))
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to get supplier admin\n"));
+
+ supplier_admin->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "destroyed supplier admin\n"));
+}
+
+void
+IdAssignment::run_test(ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID* ec_id = 0;
+ ACE_NEW (ec_id,
+ CosNotifyChannelAdmin::ChannelID [this->ec_count_]);
+
+ CosNotifyChannelAdmin::AdminID* consumer_admin_id = 0;
+ ACE_NEW (consumer_admin_id,
+ CosNotifyChannelAdmin::AdminID [this->consumer_admin_count_]);
+
+ CosNotifyChannelAdmin::AdminID* supplier_admin_id = 0;
+ ACE_NEW (supplier_admin_id,
+ CosNotifyChannelAdmin::AdminID [this->supplier_admin_count_]);
+
+ // *******************************************************************
+
+ int i;
+
+ for (i = 0; i < this->iter_; ++i)
+ {
+ int ec_count;
+
+ for (ec_count = 0; ec_count < this->ec_count_; ++ec_count)
+ {
+ ec_id[ec_count] = this->create_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Connect <consumer_admin_count_> number of consumers
+ // to the current ec.
+ for (int cons_count = 0;
+ cons_count < this->consumer_admin_count_;
+ ++cons_count)
+ {
+ consumer_admin_id [cons_count] =
+ this->create_consumer_admin (ec_id [ec_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Connect <supplier_admin_count_> number of suppliers
+ // to the current ec.
+ for (int supp_count = 0;
+ supp_count < this->supplier_admin_count_;
+ ++supp_count)
+ {
+ supplier_admin_id [supp_count] =
+ this->create_supplier_admin (ec_id [ec_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+
+ // Destroy the ec, the admins should destroy too.
+ for (ec_count = 0; ec_count < this->ec_count_; ++ec_count)
+ {
+ this->destroy_ec (ec_id[ec_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ } // for
+
+
+ //******************************************************************************
+ // Repeat, but this time destroy the admins explicity.
+ for (i = 0; i < this->iter_; ++i)
+ {
+ int ec_count;
+
+ for (ec_count = 0; ec_count < this->ec_count_; ++ec_count)
+ {
+ ec_id[ec_count] = this->create_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ int cons_count, supp_count;
+ // Connect <consumer_admin_count_> number of consumers
+ // to the current ec.
+ for (cons_count = 0;
+ cons_count < this->consumer_admin_count_;
+ ++cons_count)
+ {
+ consumer_admin_id[cons_count] =
+ this->create_consumer_admin (ec_id[ec_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Connect <supplier_admin_count_> number of suppliers
+ // to the current ec.
+ for (supp_count = 0; supp_count < this->supplier_admin_count_; ++supp_count)
+ {
+ supplier_admin_id[supp_count] =
+ this->create_supplier_admin (ec_id[ec_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Destroy the admins.
+
+ // Destroy consumer admins.
+ for (cons_count = 0;
+ cons_count < this->consumer_admin_count_;
+ ++cons_count)
+ {
+ this->destroy_consumer_admin (ec_id[ec_count],
+ consumer_admin_id[cons_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Destroy supplier admins
+ for (supp_count = 0;
+ supp_count < this->supplier_admin_count_;
+ ++supp_count)
+ {
+ this->destroy_supplier_admin (ec_id[ec_count],
+ supplier_admin_id[supp_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ }
+
+ // Destroy the ec,
+ for (ec_count = 0; ec_count < this->ec_count_; ++ec_count)
+ {
+ this->destroy_ec (ec_id[ec_count]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ } // for
+
+ //********************************************************************************
+}
+
+int main (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ IdAssignment test;
+
+ test.parse_args (argc,
+ argv);
+
+ test.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ test.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "IdAssignment test suceeded\n"));
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/IdAssignment.h b/TAO/orbsvcs/tests/Notify/Basic/IdAssignment.h
new file mode 100644
index 00000000000..7b4a7e3920f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/IdAssignment.h
@@ -0,0 +1,71 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// IdAssignment.h
+//
+// = DESCRIPTION
+// Test to check if ec, admin are assigned id's correctly.
+//
+// = AUTHORS
+// Chanaka Liyanaarachchi <chanaka@ociweb.com> and Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef IDASSIGNMENT_H
+#define IDASSIGNMENT_H
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+
+class IdAssignment
+{
+public:
+ IdAssignment (void);
+ ~IdAssignment (void);
+
+ int parse_args (int argc,
+ char *argv[]);
+ void init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL);
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ CosNotifyChannelAdmin::ChannelID create_ec (ACE_ENV_SINGLE_ARG_DECL);
+ void destroy_ec (CosNotifyChannelAdmin::ChannelID id
+ ACE_ENV_ARG_DECL);
+
+ CosNotifyChannelAdmin::AdminID create_supplier_admin (
+ CosNotifyChannelAdmin::ChannelID channel_id
+ ACE_ENV_ARG_DECL
+ );
+ CosNotifyChannelAdmin::AdminID create_consumer_admin (
+ CosNotifyChannelAdmin::ChannelID channel_id
+ ACE_ENV_ARG_DECL
+ );
+
+ void destroy_consumer_admin (CosNotifyChannelAdmin::ChannelID channel_id,
+ CosNotifyChannelAdmin::AdminID admin_id
+ ACE_ENV_ARG_DECL);
+ void destroy_supplier_admin (CosNotifyChannelAdmin::ChannelID channel_id,
+ CosNotifyChannelAdmin::AdminID admin_id
+ ACE_ENV_ARG_DECL);
+
+ // = Data members.
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+
+ int iter_;
+ // Number of iterations for the test.
+
+ int ec_count_;
+ // Numbers of EC's to create.
+
+ int consumer_admin_count_;
+ // Number of consumer admins to create per ec.
+
+ int supplier_admin_count_;
+ // Number of consumer admins to create per ec.
+};
+
+#endif /* IDASSIGNMENT_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/LifeCycle.cpp b/TAO/orbsvcs/tests/Notify/Basic/LifeCycle.cpp
new file mode 100644
index 00000000000..0bb420600c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/LifeCycle.cpp
@@ -0,0 +1,271 @@
+//$Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include <orbsvcs/CosNamingC.h>
+#include <orbsvcs/CosNotifyCommC.h>
+#include <orbsvcs/CosNotifyChannelAdminC.h>
+
+#include "LifeCycle.h"
+
+ACE_RCSID (Notify_Tests,
+ LifeCycle,
+ "$Id$")
+
+LifeCycle::LifeCycle (void)
+ : count_ (10)
+{
+}
+
+LifeCycle::~LifeCycle (void)
+{
+}
+
+int
+LifeCycle::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc,
+ argv);
+
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-count")))
+ {
+ this->count_ = ACE_OS::atoi (current_arg);
+ // The number of times to create and destroy.
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "usage: %s "
+ "-count testcount \n",
+ argv[0],
+ argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+LifeCycle::init (int argc,
+ char* argv[]
+ ACE_ENV_ARG_DECL)
+{
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var rootObj =
+ orb->resolve_initial_references ("NameService"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (rootObj.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to resolve naming service !\n"));
+ return;
+ }
+
+ CosNaming::NamingContext_var rootNC =
+ CosNaming::NamingContext::_narrow (rootObj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("NotifyEventChannelFactory");
+
+ CORBA::Object_var obj = rootNC->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ notify_factory_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ obj.in()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ if (CORBA::is_nil (notify_factory_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to locate Notify_Service \n"));
+
+ return;
+ }
+}
+
+void
+LifeCycle::run_test(ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (int i = 0; i < this->count_; ++i)
+ {
+ this->create_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->create_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->create_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->destroy_ec (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+LifeCycle::create_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ this->ec_ = notify_factory_->create_channel (initial_qos,
+ initial_admin,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (ec_.in ())) {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to create event channel\n"));
+ return;
+ }
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "created event channel\n"));
+}
+
+void
+LifeCycle::create_supplier_admin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ supplier_admin_ = this->ec_->new_for_suppliers (ifgop,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (supplier_admin_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to create supplier admin\n"));
+ return;
+ }
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "created supplier admin\n"));
+}
+
+void
+LifeCycle::create_consumer_admin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid;
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop =
+ CosNotifyChannelAdmin::OR_OP;
+
+ consumer_admin_ = ec_->new_for_consumers (ifgop, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (consumer_admin_.in()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to find supplier admin\n"));
+ return;
+ }
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "created consumer admin\n"));
+}
+
+void
+LifeCycle::destroy_supplier_admin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->supplier_admin_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "destroyed supplier admin\n"));
+}
+
+void
+LifeCycle::destroy_consumer_admin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->consumer_admin_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "destroyed consumer admin\n"));
+}
+
+void
+LifeCycle::destroy_ec (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "destroyed event channel\n"));
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ LifeCycle test;
+
+ test.parse_args (argc,
+ argv);
+
+ test.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ test.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/LifeCycle.h b/TAO/orbsvcs/tests/Notify/Basic/LifeCycle.h
new file mode 100644
index 00000000000..94a2869641b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/LifeCycle.h
@@ -0,0 +1,49 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// LifeCycle.h
+//
+// = DESCRIPTION
+// Test to check it ec and admin objects are destroyed.
+//
+// = AUTHOR
+// Chanaka Liyanaarachchi <chanaka@ociweb.com>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_LIFECYCLETST_H
+#define NOTIFY_LIFECYCLETST_H
+
+class LifeCycle
+{
+public:
+ LifeCycle (void);
+ ~LifeCycle (void);
+
+ void init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL);
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ int parse_args (int argc,
+ char *argv[]);
+
+private:
+ void create_ec (ACE_ENV_SINGLE_ARG_DECL);
+ void create_supplier_admin (ACE_ENV_SINGLE_ARG_DECL);
+ void create_consumer_admin (ACE_ENV_SINGLE_ARG_DECL);
+ void destroy_ec (ACE_ENV_SINGLE_ARG_DECL);
+ void destroy_supplier_admin (ACE_ENV_SINGLE_ARG_DECL);
+ void destroy_consumer_admin (ACE_ENV_SINGLE_ARG_DECL);
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+
+ int count_;
+ // Number of times to create destroy.
+};
+
+#endif /* NOTIFY_LIFECYCLETST_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Makefile.am b/TAO/orbsvcs/tests/Notify/Basic/Makefile.am
new file mode 100644
index 00000000000..3a4a36013ce
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Makefile.am
@@ -0,0 +1,494 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Basic_Notify_AdminProperties.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += AdminProperties
+
+AdminProperties_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+AdminProperties_SOURCES = \
+ AdminProperties.cpp \
+ AdminProperties.h
+
+AdminProperties_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_ConnectDisconnect.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += ConnectDisconnect
+
+ConnectDisconnect_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+ConnectDisconnect_SOURCES = \
+ ConnectDisconnect.cpp \
+ ConnectDisconnect.h
+
+ConnectDisconnect_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_Events.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Events
+
+Events_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Events_SOURCES = \
+ Events.cpp \
+ Events.h
+
+Events_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_Filter.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Filter
+
+Filter_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Filter_SOURCES = \
+ Filter.cpp \
+ Filter.h
+
+Filter_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_IdAssignment.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += IdAssignment
+
+IdAssignment_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+IdAssignment_SOURCES = \
+ IdAssignment.cpp \
+ IdAssignment.h
+
+IdAssignment_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_LifeCycle.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += LifeCycle
+
+LifeCycle_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+LifeCycle_SOURCES = \
+ LifeCycle.cpp \
+ LifeCycle.h
+
+LifeCycle_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_MultiTypes.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += MultiTypes
+
+MultiTypes_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+MultiTypes_SOURCES = \
+ MultiTypes.cpp \
+ MultiTypes.h
+
+MultiTypes_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_Sequence.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence
+
+Sequence_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_SOURCES = \
+ Sequence.cpp \
+ Sequence.h
+
+Sequence_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_Simple.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Simple
+
+Simple_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Simple_SOURCES = \
+ Simple.cpp \
+ Simple.h
+
+Simple_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Basic_Notify_Updates.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Updates
+
+Updates_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Updates_SOURCES = \
+ Updates.cpp \
+ Updates.h
+
+Updates_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Basic/MultiTypes.cpp b/TAO/orbsvcs/tests/Notify/Basic/MultiTypes.cpp
new file mode 100644
index 00000000000..f8bb9dd472a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/MultiTypes.cpp
@@ -0,0 +1,412 @@
+//$Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "MultiTypes.h"
+
+ACE_RCSID (Notify_Tests, MultiTypes, "$Id$")
+
+//*****************************************************************************************************
+
+MultiTypes_PushConsumer::MultiTypes_PushConsumer (MultiTypes* client)
+ :client_ (client)
+{
+}
+
+void
+MultiTypes_PushConsumer::push (const CORBA::Any & /*data*/
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ client_->on_received_event (this);
+}
+
+/***************************************************************************/
+
+MultiTypes_StructuredPushConsumer::MultiTypes_StructuredPushConsumer (MultiTypes* client)
+ :client_ (client)
+{
+}
+
+void
+MultiTypes_StructuredPushConsumer::push_structured_event (const CosNotification::StructuredEvent & /*notification*/
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ client_->on_received_event (this);
+}
+
+/***************************************************************************/
+
+MultiTypes_SequencePushConsumer::MultiTypes_SequencePushConsumer (MultiTypes* client)
+ :client_ (client)
+{
+}
+
+// TODO: if the batch contains more than one event this counts only one received event
+// Since this should *never* happen, I'm not fixing it now.
+void
+MultiTypes_SequencePushConsumer::push_structured_events (const CosNotification::EventBatch & /*notifications*/
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ client_->on_received_event (this);
+}
+
+/***************************************************************************/
+
+MultiTypes::MultiTypes (void)
+ :any_consumer_ (0),
+ structured_consumer_ (0),
+ sequence_consumer_ (0),
+ any_supplier_ (0),
+ structured_supplier_ (0),
+ sequence_supplier_ (0),
+ any_event_count_ (0),
+ struct_event_count_ (0),
+ seq_event_count_ (0),
+ disconnect_on_last_event_ (0)
+{
+
+}
+
+MultiTypes::~MultiTypes ()
+{
+}
+
+void
+MultiTypes::on_received_event (MultiTypes_PushConsumer* consumer)
+{
+ ++any_event_count_;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "PushConsumer received event #%d\n", any_event_count_.value ()));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ if (disconnect_on_last_event_ == 1)
+ {
+ consumer->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "PushConsumer has been disconnected.\n"));
+ consumer = 0;
+ }
+}
+
+void
+MultiTypes::on_received_event (MultiTypes_StructuredPushConsumer* consumer)
+{
+ ++struct_event_count_;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "StructuredPushConsumer received event #%d\n", struct_event_count_.value ()));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ if (disconnect_on_last_event_ == 1)
+ {
+ consumer->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "StructuredPushConsumer has been disconnected.\n"));
+ consumer = 0;
+ }
+}
+
+void
+MultiTypes::on_received_event (MultiTypes_SequencePushConsumer* consumer)
+{
+ ++seq_event_count_;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "SequencePushConsumer received event #%d\n", seq_event_count_.value ()));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ if (disconnect_on_last_event_ == 1)
+ {
+ consumer->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "SequencePushConsumer has been disconnected.\n"));
+ consumer = 0;
+ }
+}
+
+int
+MultiTypes::init (int argc,
+ char* argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize the base class.
+ Notify_Test_Client::init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);;
+
+ // Create all participants.
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ this->supplier_admin_ =
+ ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);;
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ this->consumer_admin_ =
+ ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ // Create the consumers and suppliers.
+ any_consumer_ = new MultiTypes_PushConsumer (this);
+ structured_consumer_ = new MultiTypes_StructuredPushConsumer (this);
+ sequence_consumer_ = new MultiTypes_SequencePushConsumer (this);
+
+ any_supplier_ = new TAO_Notify_Tests_PushSupplier;
+ structured_supplier_ = new TAO_Notify_Tests_StructuredPushSupplier ();
+ sequence_supplier_ = new TAO_Notify_Tests_SequencePushSupplier ();
+
+ // Init and connect all consumers.
+ structured_consumer_->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ structured_consumer_->connect (this->consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ any_consumer_->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ any_consumer_->connect (this->consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+
+ sequence_consumer_->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ sequence_consumer_->connect (this->consumer_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Init and connect all suppliers.
+ any_supplier_->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ any_supplier_->connect (this->supplier_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ structured_supplier_->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ structured_supplier_->connect (this->supplier_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ sequence_supplier_->init (root_poa_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ sequence_supplier_->connect (this->supplier_admin_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ consumer_start( 0 );
+
+ return 0;
+}
+
+int
+MultiTypes::parse_args(int, char **)
+{
+ // Doesn't accept any arguments
+ return 0;
+}
+
+void
+MultiTypes::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+}
+
+void
+MultiTypes::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Send an Any, all consumers should receive it.
+ CORBA::Any any;
+ any <<= (CORBA::Long)0;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Sending Any Event..\n"));
+ any_supplier_->send_event (any ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Waiting for consumers to receive the 1 event..\n"));
+ this->wait_for_all_consumers (1);
+
+ /*****************************************************************************/
+
+ // Reset Count
+ any_event_count_ = 0;
+ struct_event_count_ = 0;
+ seq_event_count_ = 0;
+
+ // Send Structured Event, all consumers should receive it.
+ CosNotification::StructuredEvent event;
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("*");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup("*");
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent");
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Sending Structured Event..\n"));
+ structured_supplier_->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Waiting for consumers to receive the 1 event..\n"));
+ this->wait_for_all_consumers (1);
+
+ /*****************************************************************************/
+
+ // Reset Count
+ any_event_count_ = 0;
+ struct_event_count_ = 0;
+ seq_event_count_ = 0;
+
+ // Send Structured Events, all consumers should receive it.
+ CosNotification::EventBatch events;
+ events.length (2);
+
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent_1");
+
+ events[0] = event;
+
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent_2");
+
+ events[1] = event;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Sending Sequence Event..\n"));
+ sequence_supplier_->send_events (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Waiting for consumers to receive the 2 events..\n"));
+ this->wait_for_all_consumers (2);
+
+ /*****************************************************************************/
+ // Reset Count
+ any_event_count_ = 0;
+ struct_event_count_ = 0;
+ seq_event_count_ = 0;
+
+ // set flag to disconnect consumers when event received.
+ disconnect_on_last_event_ = 1;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Sending LAST Any Event, Consumers will attempt disconnect..\n"));
+ any_supplier_->send_event (any ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Waiting for consumers to receive the 1 event..\n"));
+ this->wait_for_all_consumers (1);
+
+ ACE_DEBUG ((LM_DEBUG, "MultiTypes test has run successfully!\n"));
+}
+
+void
+MultiTypes::wait_for_all_consumers (int expected_count_per_consumer)
+{
+ while (true)
+ {
+ if (any_event_count_.value () >= expected_count_per_consumer &&
+ struct_event_count_.value () >= expected_count_per_consumer &&
+ seq_event_count_.value () >= expected_count_per_consumer)
+ {
+ break;
+ }
+
+ ACE_Time_Value tv (0, 100 * 1000);
+ this->orb_->run(tv);
+ }
+}
+
+void
+MultiTypes::end_test (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ consumer_done( 0 );
+}
+
+int
+MultiTypes::check_results (void)
+{
+ // Destroy the channel.
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+/***************************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ MultiTypes client;
+
+ if (client.parse_args (argc, argv) == -1)
+ {
+ return 1;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ client.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.end_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return client.check_results ();
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/MultiTypes.h b/TAO/orbsvcs/tests/Notify/Basic/MultiTypes.h
new file mode 100644
index 00000000000..ac2701e61b8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/MultiTypes.h
@@ -0,0 +1,169 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// MultiTypes.h
+//
+// = DESCRIPTION
+// Test connect-disconnect methods of Notify.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_MULTI_TYPES_H
+#define NOTIFY_MULTI_TYPES_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_StructuredPushConsumer.h"
+#include "Notify_StructuredPushSupplier.h"
+#include "Notify_PushConsumer.h"
+#include "Notify_PushSupplier.h"
+#include "Notify_SequencePushConsumer.h"
+#include "Notify_SequencePushSupplier.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class MultiTypes;
+
+/***************************************************************************/
+
+class MultiTypes_PushConsumer : public TAO_Notify_Tests_PushConsumer
+{
+public:
+ MultiTypes_PushConsumer (MultiTypes* client);
+
+ void push (
+ const CORBA::Any & data
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+protected:
+ MultiTypes* client_;
+};
+
+/***************************************************************************/
+
+class MultiTypes_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ MultiTypes_StructuredPushConsumer (MultiTypes* client);
+
+ // = StructuredPushSupplier methods
+ virtual void push_structured_event (const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+protected:
+ MultiTypes* client_;
+};
+
+class MultiTypes_SequencePushConsumer : public TAO_Notify_Tests_SequencePushConsumer
+{
+public:
+ MultiTypes_SequencePushConsumer (MultiTypes* client);
+
+ // = SequencePushConsumer methods
+ virtual void push_structured_events (
+ const CosNotification::EventBatch & notifications
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+protected:
+ MultiTypes* client_;
+};
+
+
+/***************************************************************************/
+
+class MultiTypes : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code.
+ MultiTypes (void);
+ virtual ~MultiTypes ();
+
+ void on_received_event (MultiTypes_PushConsumer* consumer);
+ void on_received_event (MultiTypes_StructuredPushConsumer* consumer);
+ void on_received_event (MultiTypes_SequencePushConsumer* consumer);
+
+ int parse_args (int argc,
+ char *argv[]);
+
+ int init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialization.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+ void end_test (ACE_ENV_SINGLE_ARG_DECL);
+ // End the test.
+
+ int check_results (void);
+ // Check if we got the expected results.
+
+protected:
+ // Wait to receive events.
+ void wait_for_all_consumers (int expected_count_per_consumer);
+
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create EC.
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ TAO_Notify_Tests_PushConsumer* any_consumer_;
+ TAO_Notify_Tests_StructuredPushConsumer* structured_consumer_;
+ TAO_Notify_Tests_SequencePushConsumer* sequence_consumer_;
+ // Consumers.
+
+ TAO_Notify_Tests_PushSupplier* any_supplier_;
+ TAO_Notify_Tests_StructuredPushSupplier* structured_supplier_;
+ TAO_Notify_Tests_SequencePushSupplier* sequence_supplier_;
+ // Suppliers
+
+ // Count of Any events received;
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> any_event_count_;
+
+ // Count of Structured events received;
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> struct_event_count_;
+
+ // Count of Sequence events received;
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> seq_event_count_;
+
+ // disconnect_on_last_event_
+ int disconnect_on_last_event_;
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_MULTI_TYPES_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/README b/TAO/orbsvcs/tests/Notify/Basic/README
new file mode 100644
index 00000000000..ed9a0128716
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/README
@@ -0,0 +1,109 @@
+
+ Basic Tests
+ ===========
+
+Updates:
+-------
+This test will check if the subscription and publication update messages
+from the event channel are properly received from the Notify Service.
+
+Command line parameters:
+none.
+
+ConnectDisconnect:
+-----------------
+Connects/Disconnects consumers and suppliers in a loop to test connect
+and disconnect to admin objects.
+
+Command line parameters:
+
+"-count <testcount>",
+"-consumers <number_of_consumers>",
+"-suppliers <number_of_suppliers>",
+
+LifeCycle:
+-------------
+Creates and destroys EC and Admin objects.
+
+Command line parameters:
+"-count testcount"
+
+where <testcount> is how many times we want to create/destroy.
+
+IdAssignment:
+------------
+This test exercies Id generation by creating ec and admin objects and
+using the assigned ids to lookup these objects and destroy them.
+
+Command line parameters:
+"-iter <count>", count is how many times to repeat this test.
+"-ec_count <count>", count is number of ec objects to create
+"-ca_count <count>", count is number of consumer admin (ca) objects to create
+"-sa_count <count>\n", count is number of supplier admin (sa) objects to create
+
+
+AdminProperties
+--------------------
+Tests out the EC Admin QoSproperties:
+
+command line parameters:
+
+-max_queue_length [max_queue_length]
+-max_consumers [max_consumers]
+-max_suppliers [max_suppliers]
+-reject_new_events [reject_new_events]
+-consumers [consumers]
+-suppliers [suppliers]
+-event_count [event_count]
+-ConsumerDelay [delay in secs]
+// sleep period per push for the consumer created to test MaxQueueLength
+-InitialDelay [delay in secs]
+
+Events:
+----------
+This test creates 1 structured supplier and 2 structured consumers.
+Each consumer should receive all the events send by the supplier.
+The uses the default ConsumerAdmin and default Supplier Admin if the
+-use_default_admin option is specified.
+
+command line options:
+-use_default_admin
+-events [number of events to send]
+
+MultiTypes:
+-----------
+Creates a Supplier and Consumer each for the 3 Client types that send
+and receive Any, Structured and Sequence event types.
+Each type of the supplier then sends an event each to the Notification
+channel. All 3 types of consumers should receive 3 events each.
+
+command line options:
+none.
+
+Simple:
+-------
+Creates 1 Any Supplier and 1 Any Consumer. Events received by the
+supplier must be equal to the count send.
+
+command line options:
+-events [number of events to send]
+
+Filter:
+------
+Tests the FilterAdmin and Filter interface methods.
+
+command line options:
+none.
+
+Sequence:
+---------
+In the default run, this test sends 15 events in batches of 5 events
+via a sequence supplier. It sets the consumer's batch size to 3 and
+sets a pacing interval of 2 seconds. It checks to see if 15 events are indeed received.
+
+command line options:
+-events [count]
+-SupplierBatchSize [count]
+-ConsumerBatchSize [count]
+-ConsumerDelay [delay]
+-InitialDelay [delay] \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp b/TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp
new file mode 100644
index 00000000000..7842be55e57
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Sequence.cpp
@@ -0,0 +1,387 @@
+// $Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/debug.h"
+#include "Sequence.h"
+
+ACE_RCSID (Notify_Tests, Sequence, "$Id$")
+
+/***************************************************************************/
+
+SequencePushConsumer::SequencePushConsumer (Sequence *test_client)
+ : test_client_ (test_client)
+{
+}
+
+void
+SequencePushConsumer::push_structured_events (
+ const CosNotification::EventBatch &batch
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ this->test_client_->events_received_ += batch.length ();
+
+ if (batch.length () > this->test_client_->consumer_batch_size_)
+ ACE_DEBUG ((LM_ERROR,
+ "Error: Received more than max event batch %d\n",
+ batch.length ()));
+
+ this->test_client_->on_event_received ();
+
+ ACE_OS::sleep (this->test_client_->consumer_delay_);
+}
+
+/***************************************************************************/
+
+SequencePushSupplier::SequencePushSupplier (
+ Sequence* test_client
+ )
+ : test_client_ (test_client)
+{
+}
+
+SequencePushSupplier::~SequencePushSupplier (void)
+{
+}
+
+/***************************************************************************/
+Sequence::Sequence (void)
+ : event_count_ (15), supplier_batch_size_ (5), consumer_batch_size_ (3),
+ pacing_ (2), order_policy_ (CosNotification::PriorityOrder), events_received_ (0),
+ consumer_delay_ (1)
+{
+}
+
+Sequence::~Sequence (void)
+{
+}
+
+int
+Sequence::init (int argc,
+ char* argv []
+ ACE_ENV_ARG_DECL)
+{
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Options: event count = %d \n"
+ "supplier batch size = %d \n"
+ "consumer batch size = %d \n"
+ "pacing = %d secs \n"
+ , event_count_
+ , supplier_batch_size_
+ , consumer_batch_size_
+ , pacing_));
+
+ ACE_DEBUG ((LM_DEBUG, "consumer delay = %d\n", consumer_delay_.sec ()));
+ }
+
+ // Initialize the base class.
+ Notify_Test_Client::init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create all participents.
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ this->supplier_admin_ =
+ this->ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ this->consumer_admin_ =
+ this->ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ ACE_NEW_RETURN (this->consumer_,
+ SequencePushConsumer (this),
+ -1);
+ this->consumer_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->consumer_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotification::QoSProperties properties (3);
+ properties.length (3);
+
+ properties[0].name = CORBA::string_dup (CosNotification::MaximumBatchSize);
+ properties[0].value <<= (CORBA::Long) this->consumer_batch_size_;
+ properties[1].name = CORBA::string_dup (CosNotification::PacingInterval);
+ properties[1].value <<= (TimeBase::TimeT) (this->pacing_ * 1000 * 10000);
+ properties[2].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ properties[2].value <<= this->order_policy_;
+
+ this->consumer_->get_proxy_supplier ()->set_qos (properties);
+
+ ACE_NEW_RETURN (this->supplier_,
+ SequencePushSupplier (this),
+ -1);
+ this->supplier_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->supplier_->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ consumer_start( 0 );
+
+ return 0;
+}
+
+int
+Sequence::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc,
+ argv);
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-events")))
+ {
+ this->event_count_ = ACE_OS::atoi (current_arg); // The number of events to send/receive.
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-SupplierBatchSize")))
+ {
+ this->supplier_batch_size_ = ACE_OS::atoi (current_arg); // Supplier batch size
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-ConsumerBatchSize")))
+ {
+ this->consumer_batch_size_ = ACE_OS::atoi (current_arg); // Consumer batch size
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-ConsumerDelay")))
+ {
+ this->consumer_delay_ = ACE_Time_Value (ACE_OS::atoi (current_arg), 0); // Consumer delay in secs.
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-Pacing"))) // in seconds
+ {
+ this->pacing_ = (TimeBase::TimeT) ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+ }
+
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s "
+ "-events event_count "
+ "-SupplierBatchSize size "
+ "-ConsumerBatchSize size "
+ "-ConsumerDelay delay "
+ "-Pacing pacing \n",
+ argv[0], argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+void
+Sequence::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ACE_ASSERT (!CORBA::is_nil (this->ec_.in ()));
+}
+
+void
+Sequence::on_event_received (void)
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "Events received = %d\n",
+ this->events_received_.value ()));
+
+ if (this->events_received_.value () == this->event_count_)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->end_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Sequence::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // operations:
+ CosNotification::StructuredEvent event;
+
+ // EventHeader.
+
+ // FixedEventHeader.
+ // EventType.
+ // string.
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields.
+ // PropertySeq.
+ // sequence<Property>: string name, any value
+ CosNotification::PropertySeq& qos = event.header.variable_header;
+ qos.length (1); // put nothing here
+
+ // FilterableEventBody
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup("threshold");
+
+ event.filterable_data[1].name = CORBA::string_dup("temperature");
+ event.filterable_data[1].value <<= (CORBA::Long)70;
+
+ event.filterable_data[2].name = CORBA::string_dup("pressure");
+ event.filterable_data[2].value <<= (CORBA::Long)80;
+
+ CORBA::Short prio = CosNotification::LowestPriority;
+
+ CosNotification::EventBatch batch;
+ batch.length (this->supplier_batch_size_);
+ CORBA::ULong batch_index = 0;
+
+ for (int i = 0; i < this->event_count_; ++i)
+ {
+ event.filterable_data[0].value <<= (CORBA::Long)i;
+
+ // any
+ event.remainder_of_body <<= (CORBA::Long)i;
+
+ qos[0].name = CORBA::string_dup (CosNotification::Priority);
+ qos[0].value <<= (CORBA::Short)prio++;
+
+ batch[batch_index] = event;
+ batch_index++;
+
+ if (batch_index == this->supplier_batch_size_)
+ {
+ batch.length (batch_index); // set the correct length
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Sending batch with %d events\n", batch.length ()));
+
+ this->supplier_->send_events (batch
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // reset
+ batch.length (this->supplier_batch_size_);
+ batch_index = 0;
+ }
+ } // for
+
+ // send the last batch.
+ if (batch_index > 0)
+ {
+ batch.length (batch_index); // set the correct length
+
+ this->supplier_->send_events (batch
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+}
+
+void
+Sequence::end_test (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ consumer_done( 0 );
+}
+
+int
+Sequence::check_results (void)
+{
+ // Destroy the channel.
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->events_received_.value () == this->event_count_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Sequence test success\n"));
+ return 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Sequence test failed!\n"));
+ return 1;
+ }
+}
+
+/***************************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ Sequence events;
+
+ if (events.parse_args (argc, argv) == -1)
+ {
+ return 1;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ events.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ events.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ events.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return events.check_results ();
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Sequence.h b/TAO/orbsvcs/tests/Notify/Basic/Sequence.h
new file mode 100644
index 00000000000..5a8e1138f3b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Sequence.h
@@ -0,0 +1,142 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Events.h
+//
+// = DESCRIPTION
+// Test Sequence support in Notification.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_TESTS_SEQUENCE_H
+#define NOTIFY_TESTS_SEQUENCE_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_SequencePushConsumer.h"
+#include "Notify_SequencePushSupplier.h"
+#include "orbsvcs/TimeBaseC.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class Sequence;
+
+class SequencePushConsumer : public TAO_Notify_Tests_SequencePushConsumer
+{
+public:
+ SequencePushConsumer (Sequence* client);
+
+ // = SequencePushConsumer methods
+ virtual void push_structured_events (
+ const CosNotification::EventBatch & notifications
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+protected:
+ Sequence* test_client_;
+};
+
+/***************************************************************************/
+
+class SequencePushSupplier : public TAO_Notify_Tests_SequencePushSupplier
+{
+public:
+ SequencePushSupplier (Sequence * test_client);
+ // Constructor.
+
+ virtual ~SequencePushSupplier (void);
+ // Destructor.
+
+protected:
+ Sequence* test_client_;
+};
+
+/***************************************************************************/
+
+class Sequence : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code.
+ Sequence (void);
+ virtual ~Sequence (void);
+
+ int parse_args (int argc,
+ char *argv[]) ;
+
+ int init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // Initialization.
+
+ void on_event_received (void);
+ // Called when an event is received.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+ void end_test (ACE_ENV_SINGLE_ARG_DECL);
+ // End the test.
+
+ int check_results (void);
+ // check if we got the expected results.
+
+protected:
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create EC
+
+ int event_count_;
+ // Number of events to send
+
+ /// Batch size send by supplier.
+ CORBA::ULong supplier_batch_size_;
+
+ /// Max Batch size expected by consumer.
+ CORBA::ULong consumer_batch_size_;
+
+ TimeBase::TimeT pacing_;
+
+ CORBA::Short order_policy_;
+
+ /// Count the number of events received by the consumer.
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> events_received_;
+
+ ACE_Time_Value consumer_delay_;
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ TAO_Notify_Tests_SequencePushConsumer* consumer_;
+ // Consumer
+
+ TAO_Notify_Tests_SequencePushSupplier* supplier_;
+ // Supplier
+
+private:
+ friend class SequencePushSupplier;
+ friend class SequencePushConsumer;
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_TESTS_SEQUENCE_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Simple.cpp b/TAO/orbsvcs/tests/Notify/Basic/Simple.cpp
new file mode 100644
index 00000000000..fd0dffb4620
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Simple.cpp
@@ -0,0 +1,271 @@
+//$Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "Simple.h"
+
+ACE_RCSID (Notify_Tests, Simple, "$Id$")
+
+//***************************************************************************
+
+Event_AnyPushConsumer::Event_AnyPushConsumer (Simple_Test *test_client)
+ : test_client_ (test_client)
+{
+}
+
+void
+Event_AnyPushConsumer::push (const CORBA::Any & data
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ int event_num;
+ data >>= event_num;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "Received event# %d\n",
+ event_num));
+
+ this->test_client_->on_event_received ();
+}
+
+//***************************************************************************
+
+Event_AnyPushSupplier::Event_AnyPushSupplier (Simple_Test* test_client)
+ : test_client_ (test_client)
+{
+}
+
+Event_AnyPushSupplier::~Event_AnyPushSupplier (void)
+{
+}
+
+//***************************************************************************
+
+Simple_Test::Simple_Test (void)
+ : event_count_ (5)
+{
+}
+
+Simple_Test::~Simple_Test (void)
+{
+}
+
+int
+Simple_Test::init (int argc,
+ char* argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Initialized the base class.
+ Notify_Test_Client::init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create all participents.
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ supplier_admin_ =
+ this->ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ consumer_admin_ =
+ this->ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ ACE_NEW_RETURN (this->consumer_,
+ Event_AnyPushConsumer (this),
+ -1);
+ this->consumer_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->consumer_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ Event_AnyPushConsumer* consumer2;
+ ACE_NEW_RETURN (consumer2,
+ Event_AnyPushConsumer (this),
+ -1);
+ consumer2->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ consumer2->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (this->supplier_,
+ Event_AnyPushSupplier (this),
+ -1);
+ this->supplier_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->supplier_->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ consumer_start( 0 );
+
+ return 0;
+}
+
+int
+Simple_Test::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc,
+ argv);
+
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-events")))
+ {
+ this->event_count_ = ACE_OS::atoi (current_arg);
+ // The number of events to send/receive.
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "usage: %s "
+ "-events event_count \n",
+ argv[0],
+ argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+ return 0;
+}
+
+void
+Simple_Test::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+}
+
+void
+Simple_Test::on_event_received (void)
+{
+ ++this->result_count_;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "event count = #%d\n",
+ this->result_count_.value ()));
+
+ if (this->result_count_ == 2 * this->event_count_)
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->end_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Simple_Test::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any data;
+
+ for (int i = 0; i < this->event_count_; ++i)
+ {
+ data <<= (CORBA::Long)i;
+
+ this->supplier_->send_event (data
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+Simple_Test::end_test (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ consumer_done( 0 );
+}
+
+int
+Simple_Test::check_results (void)
+{
+ // Destroy the channel
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->result_count_ == 2 * this->event_count_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Events test success\n"));
+ return 0;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Events test failed!\n"));
+ return 1;
+ }
+}
+
+//***************************************************************************
+
+int
+main (int argc, char* argv[])
+{
+ Simple_Test events;
+
+ if (events.parse_args (argc, argv) == -1)
+ {
+ return 1;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ events.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ events.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ events.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return events.check_results ();
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Simple.h b/TAO/orbsvcs/tests/Notify/Basic/Simple.h
new file mode 100644
index 00000000000..a941fcfb027
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Simple.h
@@ -0,0 +1,130 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Simple_Test.h
+//
+// = DESCRIPTION
+// Simple test any supplier to any consumer.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_TESTS_SIMPLE_H
+#define NOTIFY_TESTS_SIMPLE_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_PushConsumer.h"
+#include "Notify_PushSupplier.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class Simple_Test;
+
+/***************************************************************************/
+
+class Event_AnyPushConsumer : public TAO_Notify_Tests_PushConsumer
+{
+public:
+ Event_AnyPushConsumer (Simple_Test *test_client);
+ // Contructor.
+
+ // = PushSupplier methods
+ virtual void push (
+ const CORBA::Any & data
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+
+protected:
+ Simple_Test * test_client_;
+};
+
+/***************************************************************************/
+
+class Event_AnyPushSupplier : public TAO_Notify_Tests_PushSupplier
+{
+public:
+ Event_AnyPushSupplier (Simple_Test * test_client);
+ // Constructor.
+
+ virtual ~Event_AnyPushSupplier (void);
+ // Destructor.
+
+protected:
+ Simple_Test* test_client_;
+};
+
+/***************************************************************************/
+
+class Simple_Test : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code
+ Simple_Test (void);
+ virtual ~Simple_Test (void);
+
+ int parse_args (int argc,
+ char *argv[]) ;
+
+ int init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // initialization.
+
+ void on_event_received (void);
+ // Called when an event is received.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+ void end_test (ACE_ENV_SINGLE_ARG_DECL);
+ // End the test.
+
+ int check_results (void);
+ // check if we got the expected results.
+
+protected:
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create EC
+
+ ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> result_count_;
+ // Number of events received so far.
+
+ int event_count_;
+ // Number of events to send
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ TAO_Notify_Tests_PushConsumer* consumer_;
+ // Consumer.
+
+ TAO_Notify_Tests_PushSupplier* supplier_;
+ // Supplier.
+
+private:
+ friend class Event_AnyPushSupplier;
+ friend class Event_AnyPushConsumer;
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_TESTS_SIMPLE_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Updates.cpp b/TAO/orbsvcs/tests/Notify/Basic/Updates.cpp
new file mode 100644
index 00000000000..3933aaa37a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Updates.cpp
@@ -0,0 +1,488 @@
+//$Id$
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "Updates.h"
+
+ACE_RCSID (Notify_Tests, Updates, "$Id$")
+
+Updates_StructuredPushConsumer::Updates_StructuredPushConsumer (Updates *test_client)
+ : test_client_ (test_client)
+{
+}
+
+void
+Updates_StructuredPushConsumer::offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "StructuredPushConsumer::offer_change invoked:\n"));
+ this->test_client_->types_changed (added, removed);
+}
+
+/***************************************************************************/
+
+Updates_StructuredPushSupplier::Updates_StructuredPushSupplier (Updates* test_client)
+ :test_client_ (test_client)
+{
+}
+
+Updates_StructuredPushSupplier::~Updates_StructuredPushSupplier ()
+{
+}
+
+void
+Updates_StructuredPushSupplier::subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "StructuredPushSupplier::subscription_change invoked:\n"));
+ this->test_client_->types_changed (added, removed);
+}
+
+/***************************************************************************/
+
+Updates::Updates (void)
+ : added_count_ (0), removed_count_ (0)
+{
+}
+
+Updates::~Updates ()
+{
+}
+
+int
+Updates::init (int argc,
+ char* argv []
+ ACE_ENV_ARG_DECL)
+{
+ // Initialize base class.
+ Notify_Test_Client::init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Create all participents.
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ supplier_admin_ =
+ ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ consumer_admin_ =
+ ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ ACE_NEW_RETURN (consumer_,
+ Updates_StructuredPushConsumer (this),
+ -1);
+ consumer_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ consumer_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_NEW_RETURN (supplier_,
+ Updates_StructuredPushSupplier (this),
+ -1);
+ supplier_->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ supplier_->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+Updates::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ ec_ = notify_factory_->create_channel (initial_qos_,
+ initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+}
+
+void
+Updates::types_changed (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed)
+{
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Added Types.. \n"));
+ this->print_event_types (added);
+
+ ACE_DEBUG ((LM_DEBUG, "Removed Types.. \n"));
+ this->print_event_types (removed);
+ }
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ this->added_count_ += added.length ();
+ this->removed_count_ += removed.length ();
+}
+
+void
+Updates::print_event_types (const CosNotification::EventTypeSeq &types)
+{
+ for (CORBA::ULong i = 0; i < types.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%s, %s)\n", types[i].domain_name.in (), types[i].type_name. in()));
+ }
+}
+
+void
+Updates::add_type (CosNotification::EventTypeSeq& type_seq, const char* type)
+{
+ // Make space.
+ int index = type_seq.length ();
+ type_seq.length (index + 1);
+
+ type_seq[index].domain_name = CORBA::string_dup (type);
+ type_seq[index].type_name = CORBA::string_dup (type);
+}
+
+void
+Updates::wait_for_updates (int expected_added, int expected_removed)
+{
+ while (1)
+ {
+ if (added_count_ == expected_added &&
+ removed_count_ == expected_removed)
+ break;
+
+ ACE_Time_Value tv(0, 100 * 1000);
+ orb_->run(tv);
+ }
+}
+
+void
+Updates::reset_counts (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+ this->added_count_ = 0;
+ this->removed_count_ = 0;
+}
+
+void
+Updates::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->test_subscription_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "Finished testing subscription_change!\n"));
+
+ this->test_offer_change (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Updates test has run successfully!\n"));
+}
+
+void
+Updates::test_subscription_change (ACE_ENV_SINGLE_ARG_DECL)
+{
+ {
+ // reset counts.
+ this->reset_counts ();
+
+ /// Currently we're subscribed for "*"
+ /// Add RED, GREEN and BLUE
+ /// Remove ORANGE and PINK
+
+ CosNotification::EventTypeSeq added, removed;
+
+ this->add_type (added, "RED");
+ this->add_type (added, "GREEN");
+ this->add_type (added, "BLUE");
+
+ this->add_type (removed, "ORANGE");
+ this->add_type (removed, "PINK");
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling subscription_change with added types:\n"));
+ this->print_event_types (added);
+ ACE_DEBUG ((LM_DEBUG, "Calling subscription_change with removed types:\n"));
+ this->print_event_types (removed);
+ }
+
+ this->consumer_->get_proxy_supplier ()->subscription_change (added,
+ removed
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->wait_for_updates (3, 0); // The supplier should receive Added (RED, GREEN, BLUE)
+
+ // Get the subscriptions visible to the supplier.
+ CosNotification::EventTypeSeq_var obtained =
+ this->supplier_->get_proxy_consumer ()->obtain_subscription_types (CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON);
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "obtain_subscription_types \n"));
+ this->print_event_types (obtained.in ());
+ }
+ }
+
+ {
+ // reset counts.
+ this->reset_counts ();
+
+ // Now, add PURPLE, RED and GREEN
+ CosNotification::EventTypeSeq added, removed;
+
+ this->add_type (added, "PURPLE");
+ this->add_type (added, "GREEN");
+ this->add_type (added, "BLUE");
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling subscription_change with added types:\n"));
+ this->print_event_types (added);
+ ACE_DEBUG ((LM_DEBUG, "Calling subscription_change with removed types:\n"));
+ this->print_event_types (removed);
+ }
+
+ this->consumer_->get_proxy_supplier ()->subscription_change (added,
+ removed
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->wait_for_updates (1, 0); // The supplier should receive Added (PURPLE).
+
+ // Get the subscriptions visible to the supplier.
+ CosNotification::EventTypeSeq_var obtained =
+ this->supplier_->get_proxy_consumer ()->obtain_subscription_types (CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON);
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "obtain_subscription_types \n"));
+ this->print_event_types (obtained.in ());
+ }
+ }
+
+ {
+ // reset counts.
+ this->reset_counts ();
+
+ // Next, Remove everything by subcribing to "*"
+ CosNotification::EventTypeSeq added, removed;
+
+ this->add_type (added, "*");
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling subscription_change with added types:\n"));
+ this->print_event_types (added);
+ ACE_DEBUG ((LM_DEBUG, "Calling subscription_change with removed types:\n"));
+ this->print_event_types (removed);
+ }
+
+ this->consumer_->get_proxy_supplier ()->subscription_change (added,
+ removed
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->wait_for_updates (0, 4);
+ // The supplier should receive Remove {RED, GREEN} out of the 4 actally removed (RED, GREEN, BLUE, PURPLE) becaue that whats it offered for.
+
+ // Get the subscriptions visible to the supplier.
+ CosNotification::EventTypeSeq_var obtained =
+ this->supplier_->get_proxy_consumer ()->obtain_subscription_types (CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON);
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "obtain_subscription_types \n"));
+ this->print_event_types (obtained.in ());
+ }
+ }
+
+}
+
+void
+Updates::test_offer_change (ACE_ENV_SINGLE_ARG_DECL)
+{
+ {
+ // reset counts.
+ this->reset_counts ();
+
+ /// Currently we're subscribed for "*"
+ /// Add RED, GREEN and BLUE
+ /// Remove ORANGE and PINK
+
+ CosNotification::EventTypeSeq added, removed;
+
+ this->add_type (added, "RED");
+ this->add_type (added, "GREEN");
+ this->add_type (added, "BLUE");
+
+ this->add_type (removed, "ORANGE");
+ this->add_type (removed, "PINK");
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling offer_change with added types:\n"));
+ this->print_event_types (added);
+ ACE_DEBUG ((LM_DEBUG, "Calling offer_change with removed types:\n"));
+ this->print_event_types (removed);
+ }
+
+ this->supplier_->get_proxy_consumer ()->offer_change (added,
+ removed
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->wait_for_updates (3, 0); // The consumer should receive Added (RED, GREEN, BLUE)
+
+ // Get the offers visible to the supplier.
+ CosNotification::EventTypeSeq_var obtained =
+ this->consumer_->get_proxy_supplier ()->obtain_offered_types (CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON);
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "obtain_offer_types \n"));
+ this->print_event_types (obtained.in ());
+ }
+ }
+
+ {
+ // reset counts.
+ this->reset_counts ();
+
+ // Now, add PURPLE, RED and GREEN
+ CosNotification::EventTypeSeq added, removed;
+
+ this->add_type (added, "PURPLE");
+ this->add_type (added, "GREEN");
+ this->add_type (added, "BLUE");
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling offer_change with added types:\n"));
+ this->print_event_types (added);
+ ACE_DEBUG ((LM_DEBUG, "Calling offer_change with removed types:\n"));
+ this->print_event_types (removed);
+ }
+
+ this->supplier_->get_proxy_consumer ()->offer_change (added,
+ removed
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->wait_for_updates (1, 0); // The consumer should receive Added (PURPLE).
+
+ // Get the offers visible to the consumer.
+ CosNotification::EventTypeSeq_var obtained =
+ this->consumer_->get_proxy_supplier ()->obtain_offered_types (CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON);
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "obtain_offer_types \n"));
+ this->print_event_types (obtained.in ());
+ }
+ }
+
+ {
+ // reset counts.
+ this->reset_counts ();
+
+ // Next, Remove everything by subcribing to "*"
+ CosNotification::EventTypeSeq added, removed;
+
+ this->add_type (added, "*");
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Calling offer_change with added types:\n"));
+ this->print_event_types (added);
+ ACE_DEBUG ((LM_DEBUG, "Calling offer_change with removed types:\n"));
+ this->print_event_types (removed);
+ }
+
+ this->supplier_->get_proxy_consumer ()->offer_change (added,
+ removed
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ this->wait_for_updates (0, 4);
+ // The consumer should receive Remove {RED, GREEN} out of the 4 actally removed (RED, GREEN, BLUE, PURPLE) becaue that whats it offered for.
+
+ // Get the offers visible to the consumer.
+ CosNotification::EventTypeSeq_var obtained =
+ this->consumer_->get_proxy_supplier ()->obtain_offered_types (CosNotifyChannelAdmin::ALL_NOW_UPDATES_ON);
+
+ if (TAO_debug_level)
+ {
+ ACE_DEBUG ((LM_DEBUG, "obtain_offer_types \n"));
+ this->print_event_types (obtained.in ());
+ }
+ }
+
+}
+
+/***************************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ Updates updates;
+
+ ACE_TRY_NEW_ENV
+ {
+ updates.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ updates.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Basic/Updates.h b/TAO/orbsvcs/tests/Notify/Basic/Updates.h
new file mode 100644
index 00000000000..e4c7104f9bf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/Updates.h
@@ -0,0 +1,148 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Updates.h
+//
+// = DESCRIPTION
+// Test to check if <offer_change> and <subscription_change> messages are
+// received correctly.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_TESTS_UPDATES_H
+#define NOTIFY_TESTS_UPDATES_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_StructuredPushConsumer.h"
+#include "Notify_StructuredPushSupplier.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class Updates;
+
+class Updates_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Updates_StructuredPushConsumer (Updates *test_client);
+ // Contructor.
+
+ virtual void offer_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+ // Offer change is conveyed here.
+
+protected:
+ Updates * test_client_;
+};
+
+/***************************************************************************/
+
+class Updates_StructuredPushSupplier : public TAO_Notify_Tests_StructuredPushSupplier
+{
+public:
+ Updates_StructuredPushSupplier (Updates * test_client);
+ // Constructor.
+
+ virtual ~Updates_StructuredPushSupplier ();
+ // Destructor.
+
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+ // Subscription change is conveyed here.
+
+protected:
+ Updates* test_client_;
+};
+
+/***************************************************************************/
+
+class Updates : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code
+ Updates (void);
+ virtual ~Updates ();
+
+ int init (int argc, char *argv [] ACE_ENV_ARG_DECL);
+ // initialization.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+ /// print_event_types
+ void print_event_types (const CosNotification::EventTypeSeq &types);
+
+ /// Invoked by Supplier and Consumer when they receive updates
+ void types_changed (const CosNotification::EventTypeSeq & added, const CosNotification::EventTypeSeq & removed);
+
+ /// Wait for expected count of updates.
+ void wait_for_updates (int expected_added, int expected_removed);
+
+protected:
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create EC
+
+ /// Helper to add types.
+ void add_type (CosNotification::EventTypeSeq& type_seq, const char* type);
+
+ // test subscription_change
+ void test_subscription_change (ACE_ENV_SINGLE_ARG_DECL);
+
+ // test offer_change
+ void test_offer_change (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Reset the counts.
+ void reset_counts (void);
+
+ /// Lock to serialize internal state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// Count of added updates received
+ int added_count_;
+
+ /// Count of removed updates received
+ int removed_count_;
+ // Check if these are equal to <update_count_> at the end of the test.
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ TAO_Notify_Tests_StructuredPushConsumer* consumer_;
+ // Consumer
+
+ TAO_Notify_Tests_StructuredPushSupplier* supplier_;
+ // Supplier
+
+private:
+ friend class Updates_StructuredPushSupplier;
+ friend class Updates_StructuredPushConsumer;
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_TESTS_UPDATES_H */
diff --git a/TAO/orbsvcs/tests/Notify/Basic/adminproperties.conf b/TAO/orbsvcs/tests/Notify/Basic/adminproperties.conf
new file mode 100644
index 00000000000..7ed22785ab7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/adminproperties.conf
@@ -0,0 +1,6 @@
+## $Id$
+
+## Load the static Cos Notification Service
+## We must use the following settings, because the supplier and consumer are co-located, and
+## the test needs to prevent the threads from mixing during upcalls.
+static Client_Strategy_Factory "-ORBWaitStrategy RW -ORBTransportMuxStrategy exclusive"
diff --git a/TAO/orbsvcs/tests/Notify/Basic/notify.mt.conf b/TAO/orbsvcs/tests/Notify/Basic/notify.mt.conf
new file mode 100644
index 00000000000..1ed64ed8d98
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/notify.mt.conf
@@ -0,0 +1,2 @@
+##$Id$
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 2"
diff --git a/TAO/orbsvcs/tests/Notify/Basic/notify.reactive.conf b/TAO/orbsvcs/tests/Notify/Basic/notify.reactive.conf
new file mode 100644
index 00000000000..ca5144bd072
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/notify.reactive.conf
@@ -0,0 +1,2 @@
+##$Id$
+static Notify_Default_Event_Manager_Objects_Factory ""
diff --git a/TAO/orbsvcs/tests/Notify/Basic/notify.rt.conf b/TAO/orbsvcs/tests/Notify/Basic/notify.rt.conf
new file mode 100644
index 00000000000..50faf80e5ee
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/notify.rt.conf
@@ -0,0 +1,5 @@
+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 SYSTEM -ORBPriorityMapping continuous"
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () "" \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/Basic/run_test.pl b/TAO/orbsvcs/tests/Notify/Basic/run_test.pl
new file mode 100755
index 00000000000..4139898c4ce
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/run_test.pl
@@ -0,0 +1,152 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$namingior = PerlACE::LocalFile ("naming.ior");
+$status = 0;
+
+@tests =
+ (
+ {
+ name => "AdminProperties",
+ args => "-ORBSvcConf adminproperties.conf",
+ },
+ {
+ name => "ConnectDisconnect",
+ args => "",
+ extra => 300,
+ },
+ {
+ name => "Events",
+ args => "",
+ },
+ {
+ name => "IdAssignment",
+ args => "",
+ },
+ {
+ name => "LifeCycle",
+ args => "",
+ },
+ {
+ name => "Simple",
+ args => "",
+ },
+ {
+ name => "MultiTypes",
+ args => "",
+ },
+ {
+ name => "Filter",
+ args => "",
+ },
+ {
+ name => "Updates",
+ args => "",
+ },
+ {
+ name => "Sequence",
+ args => "",
+ },
+ );
+
+@default_test_configs =
+ (
+ "notify.rt.conf",
+ "notify.reactive.conf",
+ "notify.mt.conf",
+ );
+
+if ($#ARGV == -1)
+ {
+ @test_configs = @default_test_configs;
+ }
+else
+ {
+ @test_configs = @ARGV;
+ }
+
+$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $namingior");
+unlink $namingior;
+
+$naming_spawn = $Naming->Spawn ();
+if ($naming_spawn != 0)
+ {
+ exit 1;
+ }
+
+if (PerlACE::waitforfile_timed ($namingior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+for $config (@test_configs)
+ {
+ print STDERR "\nTesting Notification Service with config file = $config ....\n\n";
+
+ $Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=file://$namingior " .
+ "-IORoutput $notifyior " .
+ "-ORBSvcConf $config");
+ unlink $notifyior;
+ $Notification->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($notifyior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+ for $name (@tests)
+ {
+ ## The MaxQueueLength and MaxEventsPerConsumer are not supported in the Reactive
+ ## configuration, so we skip this test for now.
+ ## The Notification should actually throw an exception for the property not supported.
+ if ($name->{name} eq "AdminProperties"
+ && ($config eq "notify.reactive.conf" || $config eq "notify.rt.conf"))
+ {
+ next;
+ }
+
+ print STDERR "\nTesting $name->{name}....\n\n";
+ $test = new PerlACE::Process ("./$name->{name}",
+ "-ORBInitRef NameService=file://$namingior " .
+ "$name->{args} ");
+ $test_spawn = $test->Spawn ();
+ if ($test_spawn != 0)
+ {
+ break;
+ }
+
+ $status = $test->WaitKill ($experiment_timeout +
+ (defined $name->{extra} ?
+ $name->{extra} : 0));
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $name->{name} returned $status\n";
+ break;
+ }
+ }
+
+ $Notification->Kill ();
+ }
+
+$Naming->Kill ();
+
+unlink $namingior;
+unlink $notifyior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl b/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
new file mode 100755
index 00000000000..a118126af0b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
@@ -0,0 +1,145 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$namingior = PerlACE::LocalFile ("naming.ior");
+$status = 0;
+
+@tests =
+ (
+ {
+ name => "AdminProperties",
+ args => "-ORBSvcConf adminproperties.conf -ORBConnectIPV6Only 1",
+ },
+ {
+ name => "ConnectDisconnect",
+ args => "-ORBConnectIPV6Only 1",
+ extra => 300,
+ },
+ {
+ name => "Events",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ {
+ name => "IdAssignment",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ {
+ name => "LifeCycle",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ {
+ name => "Simple",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ {
+ name => "MultiTypes",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ {
+ name => "Filter",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ {
+ name => "Updates",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ {
+ name => "Sequence",
+ args => "-ORBConnectIPV6Only 1",
+ },
+ );
+
+@default_test_configs =
+ (
+ "notify.rt.conf",
+ "notify.reactive.conf",
+ "notify.mt.conf",
+ );
+
+if ($#ARGV == -1)
+ {
+ @test_configs = @default_test_configs;
+ }
+else
+ {
+ @test_configs = @ARGV;
+ }
+
+$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $namingior");
+unlink $namingior;
+
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($namingior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+for $config (@test_configs)
+ {
+ print STDERR "\nTesting Notification Service with config file = $config ....\n\n";
+
+ $Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=file://$namingior " .
+ "-IORoutput $notifyior " .
+ "-ORBSvcConf $config " .
+ "-ORBListenEndpoints iiop://1.2@[::1]");
+ unlink $notifyior;
+ $Notification->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($notifyior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+ for $name (@tests)
+ {
+ ## The MaxQueueLength and MaxEventsPerConsumer are not supported in the Reactive
+ ## configuration, so we skip this test for now.
+ ## The Notification should actually throw an exception for the property not supported.
+ if ($name->{name} eq "AdminProperties"
+ && ($config eq "notify.reactive.conf" || $config eq "notify.rt.conf"))
+ {
+ next;
+ }
+
+ print STDERR "\nTesting $name->{name}....\n\n";
+ $test = new PerlACE::Process ("./$name->{name}",
+ "-ORBInitRef NameService=file://$namingior " .
+ "$name->{args} ");
+ $test->Spawn ();
+
+ $status = $test->WaitKill ($experiment_timeout +
+ (defined $name->{extra} ?
+ $name->{extra} : 0));
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $name->{name} returned $status\n";
+ break;
+ }
+ }
+
+ $Notification->Kill ();
+ }
+
+$Naming->Kill ();
+
+unlink $namingior;
+unlink $notifyior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Blocking.mpc b/TAO/orbsvcs/tests/Notify/Blocking/Blocking.mpc
new file mode 100644
index 00000000000..7a7aa3a1a27
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/Blocking.mpc
@@ -0,0 +1,35 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Struct Supp): notifytest {
+ exename = Structured_Supplier
+
+ after += *idl
+ Source_Files {
+ Structured_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Struct Cons): notifytest {
+ exename = Structured_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Structured_Push_Consumer.cpp
+ Structured_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Makefile.am b/TAO/orbsvcs/tests/Notify/Blocking/Makefile.am
new file mode 100644
index 00000000000..c03d37e861b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/Makefile.am
@@ -0,0 +1,154 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Blocking_Idl.am
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+## Makefile.Blocking_Ntf_Struct_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Consumer
+
+Structured_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Consumer_SOURCES = \
+ Notify_Structured_Push_Consumer.cpp \
+ Structured_Consumer.cpp \
+ goC.cpp \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Blocking_Ntf_Struct_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Supplier
+
+Structured_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Supplier_SOURCES = \
+ Structured_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.cpp
new file mode 100644
index 00000000000..3e7c1986bb9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.cpp
@@ -0,0 +1,116 @@
+// $Id$
+
+#include "ace/OS_NS_unistd.h"
+#include "Notify_Structured_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "orbsvcs/Notify/Notify_Extensions.h"
+#include "common.h"
+#include "tao/debug.h"
+
+static const int CONSUMER_DELAY = 1; // seconds.
+
+Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer (
+ const char* name,
+ TimeBase::TimeT block,
+ unsigned int expected,
+ Notify_Test_Client& client)
+ : name_ (name),
+ blocking_timeout_ (block),
+ expected_ (expected),
+ count_ (0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+void
+Notify_Structured_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties properties (2);
+ properties.length (2);
+ // The discard policy and admin properties tests already test using
+ // the MaxQueueLength policy, so we'll use MEPC instead. It should
+ // make no difference.
+ // If the blocking timeout is less than CONSUMER_DELAY seconds, then
+ // we want to ensure that exactly one event is discarded, so we set
+ // the MEPC to expected_ - 1. If the supplier sends 20, then we expect 19,
+ // and we set MEPC to 18. The first event will be dispatched at once, but
+ // will block in the consumer. This will allow the queue in the notify svc
+ // to fill up to 18. However, the blocking code will timeout before the
+ // consumer finishes which will cause an event to be discarded. This will
+ // allow the last event to be queued. Eventually the consumer will unblock
+ // and receive the remaining events
+ properties[0].name = CORBA::string_dup (CosNotification::MaxEventsPerConsumer);
+ if (blocking_timeout_ < CONSUMER_DELAY * 1000 * 1000 * 10)
+ properties[0].value <<= (CORBA::Long) expected_ - 1;
+ else
+ properties[0].value <<= (CORBA::Long) 10;
+
+
+ properties[1].name = CORBA::string_dup (TAO_Notify_Extensions::BlockingPolicy);
+ properties[1].value <<= this->blocking_timeout_;
+
+ this->proxy_->set_qos (properties);
+ this->proxy_->connect_structured_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Structured_Push_Consumer::push_structured_event (
+ const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "-"));
+ ACE_UNUSED_ARG(event);
+
+ this->count_++;
+ if (this->count_ > this->expected_)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Structured Consumer (%P|%t): ERROR: too "
+ "many events received.\n")));
+ }
+
+ if (this->count_ >= this->expected_)
+ {
+ ACE_DEBUG((LM_DEBUG, "\nConsumer received %u events.\n", count_));
+ this->client_.consumer_done (this);
+ }
+
+ // By pausing here, we force the channel to back up, which will
+ // either result in discarding of events, or blocking, depending
+ // on whether our BlockingPolicy is greater than the following
+ // delay time.
+ // A BlockingPolicy > 1 second should allow the first event.
+ // A BlockingPolicy < 1 second should discard the first event.
+ if (count_ == 1)
+ ACE_OS::sleep (CONSUMER_DELAY);
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.h
new file mode 100644
index 00000000000..502c28c924d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/Notify_Structured_Push_Consumer.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Structured_Push_Consumer.h
+//
+// = DESCRIPTION
+// A structured push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+#define TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+
+#include "Notify_StructuredPushConsumer.h"
+#include "orbsvcs/TimeBaseC.h"
+
+class Notify_Test_Client;
+
+class Notify_Structured_Push_Consumer: public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Notify_Structured_Push_Consumer (
+ const char* name,
+ TimeBase::TimeT blocking,
+ unsigned int expected,
+ Notify_Test_Client& client);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ void push_structured_event (const CosNotification::StructuredEvent&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ TimeBase::TimeT blocking_timeout_;
+ unsigned int expected_;
+ unsigned int count_;
+ Notify_Test_Client& client_;
+};
+
+#endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/README b/TAO/orbsvcs/tests/Notify/Blocking/README
new file mode 100644
index 00000000000..caa10b69a6f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/README
@@ -0,0 +1,42 @@
+Notification Blocking Policy Test
+================================
+
+Description
+-----------
+
+This test exercises the event blocking policy of the Notification
+Service. The Blocking policy is not one of the policies defined in the
+Notification Spec. It is a feature requested by CISCO.
+
+A number of events are sent by the supplier. The supplier should begin to
+block when the event queue begins to fill. The supplier should then
+continue to send events once the consumer catches up on the events that are
+sent out.
+
+
+Usage
+-----
+
+The test consists of a Structured_Supplier and Structured_Consumer.
+The usage for each as is follows:
+
+$ Structured_Supplier -\?
+usage: Structured_Supplier -o <iorfile> -e <# of events> -d
+
+$ Structured_Consumer -\?
+usage: Structured_Consumer -k <ior> -e <expected events>
+ -t <relative blocking timeout seconds>
+
+
+To run this test, just run the run_test.pl perl script. It will run both
+structured and sequence tests with each of the implemented discard policies.
+
+
+Expected Results
+----------------
+The consumers of each type expect to only receive a certain number of
+events. If you see:
+
+ERROR: too many events received.
+
+then the test has failed. Otherwise, the test was ok.
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp
new file mode 100644
index 00000000000..c1ef387256c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Consumer.cpp
@@ -0,0 +1,173 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "Notify_Structured_Push_Consumer.h"
+#include "goC.h"
+
+#include "Notify_Test_Client.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static const char* ior = "file://supplier.ior";
+// TimeT is in 10ths of a microsecond
+static TimeBase::TimeT blocking_timeout = 2 * 1000 * 1000 * 10; // 2 secs
+// Must match the number sent by supplier. (-1 if blocking_timeout less than 1)
+static unsigned int expected = 20;
+static Notify_Structured_Push_Consumer* consumer_1 = 0;
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:e:t:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'e':
+ expected = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 't':
+ blocking_timeout = ACE_OS::atoi (get_opts.optarg);
+ blocking_timeout *= 10 * 1000;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-e <expected events> "
+ "-t <relative blocking timeout milliseconds> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ // startup the consumer
+ ACE_NEW_THROW_EX (consumer_1,
+ Notify_Structured_Push_Consumer (
+ "consumer1",
+ blocking_timeout,
+ expected,
+ *client),
+ CORBA::NO_MEMORY ());
+ consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_1->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (status != 0)
+ ACE_ERROR_RETURN ((LM_ERROR, "Error: Client init failed.\n"),1);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (sig.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR, "Error: Narrow failed.\n"),1);
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (admin.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR, "Error: nil ConsumerAdmin.\n"),1);
+
+ create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "\nConsumer waiting for events...\n"));
+
+ client.ORB_run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+ consumer_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp
new file mode 100644
index 00000000000..8097361c468
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/Structured_Supplier.cpp
@@ -0,0 +1,255 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Auto_Ptr.h"
+#include "ace/Get_Opt.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "Notify_StructuredPushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0;
+static int max_events = 20;
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:d");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'e':
+ max_events = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events> -d"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvent (int id ACE_ENV_ARG_DECL_NOT_USED)
+{
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup ("");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup ("");
+ event.header.fixed_header.event_name = CORBA::string_dup ("blocking-test");
+
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup ("id");
+ event.filterable_data[0].value <<= id;
+
+ ACE_TRY_NEW_ENV
+ {
+ supplier_1->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ // startup the supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_StructuredPushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ // Activate the signaler with the POA
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", max_events));
+ for (int i = 0; i < max_events; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendEvent (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", max_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/go.idl b/TAO/orbsvcs/tests/Notify/Blocking/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/notify.conf b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf
new file mode 100644
index 00000000000..f15e4999f71
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf
@@ -0,0 +1,10 @@
+## $Id$
+#
+## Load the static Cos Notification Service
+## The BlockingPolicy requires the notify service to use the following settings to prevent
+## dispatch threads from handling supplier-side requests. This would allow dispatch threads
+## to block on the condition variables used for the blocking feature, which would prevent
+## the thread from handling the consumer response, resulting in deadlock.
+static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive -ORBConnectStrategy blocked"
+static Resource_Factory "-ORBFlushingStrategy blocking"
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml
new file mode 100644
index 00000000000..a499d551e4b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/notify.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/Blocking/notify.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/Blocking/run_test.pl b/TAO/orbsvcs/tests/Notify/Blocking/run_test.pl
new file mode 100755
index 00000000000..a91844db34e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Blocking/run_test.pl
@@ -0,0 +1,120 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$ior = PerlACE::LocalFile ("supplier.ior");
+$namingior = PerlACE::LocalFile ("naming.ior");
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+$status = 0;
+
+$port = PerlACE::uniqueid () + 10001;
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port " .
+ "-o $namingior");
+$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf");
+$STS = new PerlACE::Process ("Structured_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$STC = new PerlACE::Process ("Structured_Consumer");
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+$client_args = "-ORBInitRef NameService=iioploc://localhost:" .
+ "$port/NameService";
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($namingior, 20) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "****** Running consumer long blocking timeout ******\n";
+
+unlink $ior;
+$STS->Arguments($STS->Arguments());
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$STC->Arguments($client_args . " -t 2000");
+$client = $STC->SpawnWaitKill (10);
+if ($client != 0) {
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "****** Running consumer with short blocking timeout ******\n";
+
+unlink $ior;
+$STS->Arguments($STS->Arguments());
+$STS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$STC->Arguments($client_args . " -e 19 -t 500");
+$client = $STC->SpawnWaitKill (10);
+if ($client != 0) {
+ print STDERR "ERROR: Structured_Consumer did not run properly\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Destroy/Destroy.mpc b/TAO/orbsvcs/tests/Notify/Destroy/Destroy.mpc
new file mode 100644
index 00000000000..6f62f78f0c9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Destroy/Destroy.mpc
@@ -0,0 +1,9 @@
+// -*- MPC -*-
+// $Id$
+
+project (Notify_Test_Destroy): notifytest, etcl, iortable, dynamicany, portableserver {
+ exename = Notify_Tests_Destroy
+ Source_Files {
+ main.cpp
+ }
+} \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/Destroy/Makefile.am b/TAO/orbsvcs/tests/Notify/Destroy/Makefile.am
new file mode 100644
index 00000000000..a16dbea16ed
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Destroy/Makefile.am
@@ -0,0 +1,70 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Notify_Test_Destroy.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = Notify_Tests_Destroy
+
+Notify_Tests_Destroy_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Notify_Tests_Destroy_SOURCES = \
+ main.cpp
+
+Notify_Tests_Destroy_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Destroy/main.cpp b/TAO/orbsvcs/tests/Notify/Destroy/main.cpp
new file mode 100644
index 00000000000..09944124843
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Destroy/main.cpp
@@ -0,0 +1,36 @@
+//$Id$
+
+#include "../lib/Notify_Test_Client.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "ace/OS_main.h"
+
+int
+ACE_TMAIN (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize the base class.
+ Notify_Test_Client client;
+ client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf = client.notify_factory ();
+
+ NotifyExt::EventChannelFactory_var ecf_ext = NotifyExt::EventChannelFactory::_narrow (ecf);
+
+ ACE_DEBUG((LM_DEBUG, "Destroying ECF...\n"));
+
+ ecf_ext->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "ECF destroyed.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT("Error: \n"));
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Discarding.mpc b/TAO/orbsvcs/tests/Notify/Discarding/Discarding.mpc
new file mode 100644
index 00000000000..f8e99b34ec2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Discarding.mpc
@@ -0,0 +1,62 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Struct Supp): notifytest {
+ exename = Structured_Supplier
+
+ after += *idl
+ Source_Files {
+ Structured_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Struct Cons): notifytest {
+ exename = Structured_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Structured_Push_Consumer.cpp
+ Structured_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Seq Supp): notifytest {
+ exename = Sequence_Supplier
+
+ after += *idl
+ Source_Files {
+ Sequence_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Seq Cons): notifytest {
+ exename = Sequence_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Sequence_Push_Consumer.cpp
+ Sequence_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Makefile.am b/TAO/orbsvcs/tests/Notify/Discarding/Makefile.am
new file mode 100644
index 00000000000..fe056312136
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Makefile.am
@@ -0,0 +1,254 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Discarding_Idl.am
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+## Makefile.Discarding_Ntf_Seq_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Consumer
+
+Sequence_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Consumer_SOURCES = \
+ Notify_Sequence_Push_Consumer.cpp \
+ Sequence_Consumer.cpp \
+ goC.cpp \
+ Notify_Sequence_Push_Consumer.h
+
+Sequence_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Discarding_Ntf_Seq_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Supplier
+
+Sequence_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Supplier_SOURCES = \
+ Sequence_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h \
+ Notify_Structured_Push_Consumer.h
+
+Sequence_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Discarding_Ntf_Struct_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Consumer
+
+Structured_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Consumer_SOURCES = \
+ Notify_Structured_Push_Consumer.cpp \
+ Structured_Consumer.cpp \
+ goC.cpp \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Discarding_Ntf_Struct_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Supplier
+
+Structured_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Supplier_SOURCES = \
+ Structured_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp
new file mode 100644
index 00000000000..4a34581b4f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.cpp
@@ -0,0 +1,172 @@
+// $Id$
+
+#include "ace/OS_NS_unistd.h"
+#include "Notify_Sequence_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "common.h"
+#include "tao/debug.h"
+
+// The NS will try to send in M size chunks, but may send smaller if
+// the pacing interval expires. We set the pacing interval large
+// enough so that *should* not happen.
+// Note : This batch size must be coordinated with the events sent
+// by the supplier. For example, when discard policy is set to
+// PriorityOrder, then we want to have exactly BATCH_SIZE events
+// with the highest priority so that we know we received the right ones.
+// We also need to be sure to send a multiple of the batch size.
+static const CORBA::Long BATCH_SIZE = 4;
+
+static const TimeBase::TimeT PACING = 20 * 1000 * 10000;
+
+// This needs to be big enough to ensure that the supplier has sent
+// all the events.
+static const int FIRST_SLEEP_SECS = 1;
+
+Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer (
+ const char* name,
+ CORBA::Short policy,
+ Notify_Test_Client& client,
+ int sent)
+ : name_ (name)
+ , discard_policy_ (policy)
+ , count_ (0)
+ , client_ (client)
+ , sent_(sent)
+ , first_(0)
+{
+ this->client_.consumer_start (this);
+}
+
+
+void
+Notify_Sequence_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::SequencePushConsumer_var consumer =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties properties (4);
+ properties.length (4);
+ CORBA::ULong idx = 0;
+ properties[idx].name = CORBA::string_dup (CosNotification::MaximumBatchSize);
+ properties[idx].value <<= BATCH_SIZE;
+ properties[++idx].name = CORBA::string_dup (CosNotification::PacingInterval);
+ properties[idx].value <<= PACING;
+ properties[++idx].name = CORBA::string_dup (CosNotification::DiscardPolicy);
+ properties[idx].value <<= this->discard_policy_;
+ properties[++idx].name = CORBA::string_dup (CosNotification::MaxEventsPerConsumer);
+ // We set this equal to the batch size so that we conveniently always receive
+ // one more batch after the first.
+ properties[idx].value <<= BATCH_SIZE;
+
+ this->proxy_->set_qos (properties);
+ this->proxy_->connect_sequence_push_consumer (consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Sequence_Push_Consumer::push_structured_events (
+ const CosNotification::EventBatch& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ++count_;
+
+ // The pacing interval is set large enough that it should never come into
+ // play unless something goes wrong.
+ if (events.length() != static_cast<size_t>(BATCH_SIZE))
+ {
+ ACE_ERROR((LM_ERROR,
+ "Error : Unexpected batch size %u/%u\n", events.length(),
+ BATCH_SIZE));
+ this->client_.consumer_done (this);
+ }
+ ACE_ASSERT(ACE_OS::strcmp(events[0].header.variable_header[0].name.in(), "Id") == 0);
+
+ CORBA::Long id1 = 0;
+ CORBA::Long id2 = 0;
+ events[0].header.variable_header[0].value >>= id1;
+ events[events.length() - 1].header.variable_header[0].value >>= id2;
+
+ ACE_DEBUG((LM_DEBUG, "{%d-%d}\n", id1, id2));
+
+ if (count_ == 1)
+ {
+ // We sleep long enough after the first batch to ensure that
+ // the supplier has time to send all the events. This will allow
+ // the notify service to discard all but one batch.
+ ACE_OS::sleep(FIRST_SLEEP_SECS);
+
+ first_ = id1;
+ }
+
+ // Validate the batch is ordered
+ for (CORBA::Long i = 1; i < BATCH_SIZE; ++i)
+ {
+ CORBA::Long id = 0;
+ events[i].header.variable_header[0].value >>= id;
+ if (id != id1 + i)
+ {
+ ACE_ERROR((LM_ERROR, "Error: Invalid batch. Expected %d, Was %d\n", id1 + i, id));
+ this->client_.consumer_done (this);
+ return;
+ }
+ }
+
+ CORBA::Long expected = 0;
+
+ if (discard_policy_ == CosNotification::PriorityOrder)
+ {
+ expected = sent_ - BATCH_SIZE + 1; // e.g. 37, 38, 39, 40
+ }
+ else if (discard_policy_ == CosNotification::FifoOrder)
+ {
+ expected = sent_ - BATCH_SIZE + 1; // e.g. 37, 38, 39, 40
+ }
+ else
+ {
+ ACE_ASSERT(discard_policy_ == CosNotification::LifoOrder);
+ expected = BATCH_SIZE + 1; // e.g. 5, 6, 7, 8
+ }
+
+ // On some slower platforms, the discard policy may be applied before the first
+ // batch is sent. In that case we may only get a single batch.
+ // On other platforms we may get two batches, but the first batch
+ // may or may not conform to the discard policy.
+
+ if (count_ == 1 && id1 != expected && discard_policy_ != CosNotification::LifoOrder)
+ {
+ // We expect to get another batch with the correct one.
+ }
+ else
+ {
+ this->client_.consumer_done (this);
+ }
+
+ if (count_ > 2)
+ {
+ ACE_ERROR((LM_ERROR, "Error : Too many batches received.\n"));
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h
new file mode 100644
index 00000000000..e49cb83cab3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Sequence_Push_Consumer.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Sequence_Push_Consumer.h
+//
+// = DESCRIPTION
+// A sequence push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+#define TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+
+#include "Notify_SequencePushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Sequence_Push_Consumer: public TAO_Notify_Tests_SequencePushConsumer
+{
+public:
+ Notify_Sequence_Push_Consumer (const char* name,
+ CORBA::Short policy,
+ Notify_Test_Client& client,
+ int sent);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ void push_structured_events (const CosNotification::EventBatch&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ CORBA::Short discard_policy_;
+ unsigned int count_;
+ Notify_Test_Client& client_;
+ int sent_;
+ int first_;
+};
+
+#endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp
new file mode 100644
index 00000000000..f107177b9d5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.cpp
@@ -0,0 +1,144 @@
+// $Id$
+
+#include "ace/OS_NS_unistd.h"
+#include "Notify_Structured_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "common.h"
+#include "tao/debug.h"
+
+Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer (
+ const char* name,
+ CORBA::Short policy,
+ CORBA::Long max_events_per_consumer,
+ Notify_Test_Client& client)
+ : name_ (name),
+ discard_policy_ (policy),
+ max_events_per_consumer_ (max_events_per_consumer),
+ count_ (0),
+ first_ (0),
+ client_ (client),
+ sent_(40)
+{
+ this->client_.consumer_start (this);
+}
+
+
+void
+Notify_Structured_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties properties (2);
+ properties.length (2);
+ properties[0].name = CORBA::string_dup (CosNotification::DiscardPolicy);
+ properties[0].value <<= this->discard_policy_;
+ properties[1].name = CORBA::string_dup (CosNotification::MaxEventsPerConsumer);
+ properties[1].value <<= this->max_events_per_consumer_;
+
+ this->proxy_->set_qos (properties);
+ this->proxy_->connect_structured_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Structured_Push_Consumer::push_structured_event (
+ const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "-"));
+
+ this->count_++;
+ if (this->count_ > max_events_per_consumer_ + 1)
+ {
+ this->client_.consumer_done (this);
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Structured Consumer (%P|%t): ERROR: too "
+ "many events received (%d).\n"), this->count_));
+ }
+
+ ACE_ASSERT(ACE_OS::strcmp(event.header.variable_header[0].name.in(), "Id") == 0);
+ CORBA::Any v = event.header.variable_header[0].value;
+ CORBA::Long id = 0;
+ v >>= id;
+
+ // Force the notify service to queue events
+ if (this->count_ == 1)
+ {
+ ACE_OS::sleep(2);
+ first_ = id;
+ }
+
+ // @@ The priority header isn't making it through the notify service.
+ //n = event.header.variable_header[1].name;
+ //if (ACE_OS::strcmp(n.in(), CosNotification::Priority) != 0)
+ //{
+ // ACE_ERROR((LM_ERROR, "Error: Couldn't find Priority header in event.\n"));
+ // break;
+ //}
+ //v = event.header.variable_header[1].value;
+ //CORBA::Long priority = 0;
+ //v >>= priority;
+ CORBA::Long expected = 0;
+ if (discard_policy_ == CosNotification::PriorityOrder)
+ {
+ expected = sent_ - max_events_per_consumer_ + count_;
+ if (first_ != sent_ - max_events_per_consumer_ + 1)
+ --expected;
+ }
+ else if (discard_policy_ == CosNotification::FifoOrder)
+ {
+ expected = sent_ - max_events_per_consumer_ + count_;
+ if (first_ != sent_ - max_events_per_consumer_ + 1)
+ --expected;
+ }
+ else if (discard_policy_ == CosNotification::LifoOrder)
+ {
+ expected = count_;
+ }
+ else
+ {
+ ACE_ERROR((LM_ERROR, "Error: Unexpected discard policy.\n"));
+ return;
+ }
+
+ if (id != expected && count_ != 1)
+ {
+ ACE_DEBUG((LM_DEBUG, "Error: Expected %d, ", expected));
+ this->client_.consumer_done (this);
+ }
+
+ ACE_DEBUG((LM_DEBUG, "received %d\n", id));
+
+ // We should receive mepc + 1, because the first event will be in-transit
+ // before our sleep causes the notify to queue events.
+ // However, on some platforms, we'll only receive mepc, because filtering
+ // happened before the first event.
+ if (this->count_ >= this->max_events_per_consumer_)
+ {
+ this->client_.consumer_done (this);
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h
new file mode 100644
index 00000000000..6eac74346e4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Notify_Structured_Push_Consumer.h
@@ -0,0 +1,52 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Structured_Push_Consumer.h
+//
+// = DESCRIPTION
+// A structured push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+#define TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+
+#include "Notify_StructuredPushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Structured_Push_Consumer: public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Notify_Structured_Push_Consumer (
+ const char* name,
+ CORBA::Short policy,
+ CORBA::Long max_events_per_consumer,
+ Notify_Test_Client& client);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ void push_structured_event (const CosNotification::StructuredEvent&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ CORBA::Short discard_policy_;
+ CORBA::Long max_events_per_consumer_;
+ CORBA::Long count_;
+ CORBA::Long first_;
+ Notify_Test_Client& client_;
+ CORBA::Long sent_;
+};
+
+#endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/README b/TAO/orbsvcs/tests/Notify/Discarding/README
new file mode 100644
index 00000000000..1b83d695fe7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/README
@@ -0,0 +1,53 @@
+Notification Discard Policy Test
+================================
+
+Description
+-----------
+
+This test exercises the event discarding policies of the Notification
+Service. Each of the implemented polices are tested (fifo, lifo and
+priority) for both structured push consumers and sequence push consumers.
+
+A number of events are sent by the supplier and the consumer should receive
+a lesser number of events due queue size overflow. Note that with the
+sequence push consumer, it will actually receive more "events" than are sent
+by the supplier. This is due to the fact that the supplier is sending a
+sequence of events that is much larger than the maximum batch size (set by
+the consumer) and therefore the notification service breaks the sequence
+into smaller sets to honor the maximum batch size setting.
+
+
+Usage
+-----
+
+The test consists of a Structured_Supplier and Structured_Consumer as well
+as a Sequence_Supplier and Sequence_Consumer. The usage for each as is
+follows:
+
+$ Structured_Supplier -\?
+usage: Structured_Supplier -o <iorfile> -e <# of events>
+
+$ Structured_Consumer -\?
+usage: Structured_Consumer -k <ior> -e <expected events>
+ -d <fifo|priority|lifo>
+
+$ Sequence_Supplier -\?
+usage: Sequence_Supplier -o <iorfile> -e <# of events>
+
+$ Sequence_Consumer -\?
+usage: Sequence_Consumer -k <ior> -l <low expected events>
+ -h <high expected events> -d <fifo|priority|lifo>
+
+
+To run this test, just run the run_test.pl perl script. It will run both
+structured and sequence tests with each of the implemented discard policies.
+
+
+Expected Results
+----------------
+The consumers of each type expect to only receive a certain number of
+events. If you see:
+
+ERROR: too many events received.
+
+then the test has failed. Otherwise, the test was ok.
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp
new file mode 100644
index 00000000000..d357454f33d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Consumer.cpp
@@ -0,0 +1,193 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_Sequence_Push_Consumer.h"
+#include "goC.h"
+
+#include "Notify_Test_Client.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static const char* ior = "file://supplier.ior";
+static CORBA::Short discard_policy = CosNotification::AnyOrder;
+static int sent = 40;
+static Notify_Sequence_Push_Consumer* consumer_1 = 0;
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:l:h:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'd':
+ {
+ const char* discard = get_opts.optarg;
+ if (ACE_OS::strcmp (discard, "fifo") == 0)
+ {
+ discard_policy = CosNotification::FifoOrder;
+ }
+ else if (ACE_OS::strcmp (discard, "priority") == 0)
+ {
+ discard_policy = CosNotification::PriorityOrder;
+ }
+ else if (ACE_OS::strcmp (discard, "lifo") == 0)
+ {
+ discard_policy = CosNotification::LifoOrder;
+ }
+ else if (ACE_OS::strcmp (discard, "deadline") == 0)
+ {
+ discard_policy = CosNotification::DeadlineOrder;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message "
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#endif
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unknown discard policy: %s\n",
+ discard_policy),
+ -1);
+ }
+ break;
+ }
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-d <any|fifo|lifo|priority|deadline> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ // startup the consumer
+ ACE_NEW_THROW_EX (consumer_1,
+ Notify_Sequence_Push_Consumer ("consumer1", discard_policy, *client, sent),
+ CORBA::NO_MEMORY ());
+
+ consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_1->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (sig.in ()));
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+
+ create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell the supplier to go
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer waiting for events...\n"));
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+ consumer_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp
new file mode 100644
index 00000000000..95d08daca21
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Sequence_Supplier.cpp
@@ -0,0 +1,288 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "Notify_SequencePushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0;
+
+static CORBA::Boolean use_deadline_ordering = 0;
+
+// Must be a multiple of the consumers batch size.
+static int num_events = 40;
+
+// Must match the consumers batch size so that we send
+// the correct number of each type of event per batch, which
+// allows us to validate the discard policy.
+static const CORBA::Long BATCH_SIZE = 4;
+
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+// The supplier will not start sending events until the
+// go() operation is invoked.
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:d");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ use_deadline_ordering = 1;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message "
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#endif /* ACE_HAS_TIMED_MESSAGE_BLOCKS */
+ break;
+ case 'e':
+ num_events = ACE_OS::atoi (get_opts.optarg);
+ num_events -= num_events % BATCH_SIZE; // round down
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events> -d"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendBatch (int batch_id ACE_ENV_ARG_DECL)
+{
+ CosNotification::EventBatch events;
+ events.length(BATCH_SIZE);
+ for (CORBA::Long i = 0; i < BATCH_SIZE; ++i)
+ {
+ int id = batch_id * BATCH_SIZE + i + 1;
+
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup ("a");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup ("b");
+ event.header.fixed_header.event_name = CORBA::string_dup ("c");
+
+ event.header.variable_header.length (3);
+ event.header.variable_header[0].name =
+ CORBA::string_dup ("Id");
+ event.header.variable_header[0].value <<= (CORBA::Long)id;
+
+ event.header.variable_header[1].name =
+ CORBA::string_dup (CosNotification::Priority);
+ event.header.variable_header[1].value <<= (CORBA::Short)(id);
+
+ event.header.variable_header[2].name =
+ CORBA::string_dup (CosNotification::Timeout);
+ event.header.variable_header[2].value <<= (TimeBase::TimeT) (id * 10000);
+
+ events[i] = event;
+ }
+ supplier_1->send_events (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ // start up the supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_SequencePushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (use_deadline_ordering)
+ {
+ CosNotification::QoSProperties qos (1);
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ qos[0].value <<= (CORBA::Short)CosNotification::DeadlineOrder;
+ ec->set_qos (qos);
+ }
+
+ sig_impl.reset( new sig_i( client.orb() ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ client.orb()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ ACE_ASSERT(output_file != 0);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+ create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events));
+ for (int i = 0; i < num_events / BATCH_SIZE; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendBatch (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp
new file mode 100644
index 00000000000..b457324f6ed
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Consumer.cpp
@@ -0,0 +1,196 @@
+// $Id$
+
+#include "Notify_Structured_Push_Consumer.h"
+#include "goC.h"
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_strings.h"
+
+static const char* ior = "file://supplier.ior";
+static CORBA::Short discard_policy = CosNotification::FifoOrder;
+CORBA::Long max_events_per_consumer = 4;
+static Notify_Structured_Push_Consumer* consumer_1;
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:e:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'd':
+ {
+ const char* discard = get_opts.optarg;
+ if (ACE_OS::strcasecmp (discard, "fifo") == 0)
+ {
+ discard_policy = CosNotification::FifoOrder;
+ }
+ else if (ACE_OS::strcasecmp (discard, "priority") == 0)
+ {
+ discard_policy = CosNotification::PriorityOrder;
+ }
+ else if (ACE_OS::strcasecmp (discard, "lifo") == 0)
+ {
+ discard_policy = CosNotification::LifoOrder;
+ }
+ else if (ACE_OS::strcasecmp (discard, "deadline") == 0)
+ {
+ discard_policy = CosNotification::DeadlineOrder;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message "
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#endif
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unknown discard policy: %s\n",
+ discard_policy),
+ -1);
+ }
+ break;
+ }
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-d <fifo|priority|lifo|deadline> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "Max Events per Consumer = %d...\n", max_events_per_consumer));
+
+ // startup the consumer
+ ACE_NEW_THROW_EX (consumer_1,
+ Notify_Structured_Push_Consumer (
+ "consumer1",
+ discard_policy,
+ max_events_per_consumer,
+ *client),
+ CORBA::NO_MEMORY ());
+ consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_1->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (sig.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ // Tell the supplier to go
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer waiting for events...\n"));
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+ consumer_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp
new file mode 100644
index 00000000000..9fee28c5c34
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/Structured_Supplier.cpp
@@ -0,0 +1,270 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "Notify_StructuredPushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0;
+static CORBA::Boolean use_deadline_ordering = 0;
+static int num_events = 40;
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+// The supplier will not start sending events until the
+// go() operation is invoked.
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:d");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ use_deadline_ordering = 1;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message "
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#else
+ break;
+#endif /* ACE_HAS_TIMED_MESSAGE_BLOCKS */
+ case 'e':
+ num_events = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events> -d"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvent (int id ACE_ENV_ARG_DECL)
+{
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup ("a");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup ("b");
+ event.header.fixed_header.event_name = CORBA::string_dup ("c");
+
+ event.header.variable_header.length (3);
+
+ event.header.variable_header[0].name = CORBA::string_dup ("Id");
+ event.header.variable_header[0].value <<= (CORBA::Long)id;
+
+ event.header.variable_header[1].name =
+ CORBA::string_dup (CosNotification::Priority);
+ event.header.variable_header[1].value <<= (CORBA::Short) (id);
+
+ event.header.variable_header[2].name =
+ CORBA::string_dup (CosNotification::Timeout);
+ event.header.variable_header[2].value <<= (TimeBase::TimeT) (id * 10000);
+
+ supplier_1->send_event (event ACE_ENV_ARG_PARAMETER);
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_StructuredPushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (use_deadline_ordering)
+ {
+ CosNotification::QoSProperties qos (1);
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ qos[0].value <<= (CORBA::Short)CosNotification::DeadlineOrder;
+ ec->set_qos (qos);
+ }
+
+ sig_impl.reset( new sig_i( client.orb() ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ CORBA::String_var ior =
+ client.orb ()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ ACE_ASSERT (output_file != 0);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+
+ create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events));
+ for (int i = 0; i < num_events; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendEvent (i + 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/go.idl b/TAO/orbsvcs/tests/Notify/Discarding/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/notify.conf b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf
new file mode 100644
index 00000000000..a465090391d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf
@@ -0,0 +1,4 @@
+## $Id$
+#
+## Load the static Cos Notification Service
+static Notify_Default_Event_Manager_Objects_Factory "-AllocateTaskperProxy -DispatchingThreads 1"
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml
new file mode 100644
index 00000000000..33ecd35e7db
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/notify.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/Discarding/notify.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/Discarding/run_test.pl b/TAO/orbsvcs/tests/Notify/Discarding/run_test.pl
new file mode 100755
index 00000000000..5a361e4a495
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Discarding/run_test.pl
@@ -0,0 +1,217 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$ior = PerlACE::LocalFile ("supplier.ior");
+$namingior = PerlACE::LocalFile ("naming.ior");
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+$status = 0;
+$deadline = 0;
+
+foreach my $arg (@ARGV) {
+ if ($arg eq "-d") {
+ $deadline = 1;
+ }
+ else {
+ print "Usage: $0 [-d]\n" .
+ " -d specifies that deadline discarding be tested.\n";
+ exit(0);
+ }
+}
+
+unlink $notifyior;
+
+$port = PerlACE::uniqueid () + 10001;
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port " .
+ "-o $namingior");
+$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf");
+$STS = new PerlACE::Process ("Structured_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$STC = new PerlACE::Process ("Structured_Consumer");
+
+$SES = new PerlACE::Process ("Sequence_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$SEC = new PerlACE::Process ("Sequence_Consumer");
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+$client_args = "-ORBInitRef NameService=iioploc://localhost:" .
+ "$port/NameService";
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($namingior, 5) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notifyior, 5) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+@policies = ("fifo", "priority", "lifo");
+if ($deadline) {
+ push(@policies, "deadline");
+}
+
+@server_opts = ("", "", "", " -d");
+for($i = 0; $i <= $#policies; $i++) {
+ $discard_policy = $policies[$i];
+ print "****** Structured Supplier -> Structured Consumer with the " .
+ "$discard_policy policy ******\n";
+
+ unlink $ior;
+ $STS->Arguments($STS->Arguments() . $server_opts[$i]);
+ $STS->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ last;
+ }
+
+ $STC->Arguments($client_args . " -d $discard_policy");
+ $client = $STC->SpawnWaitKill (20);
+ if ($client != 0) {
+ $status = 1;
+ last;
+ }
+ $server = $STS->WaitKill (5);
+ if ($server != 0) {
+ $status = 1;
+ last;
+ }
+}
+
+if ($status == 0) {
+ for($i = 0; $i <= $#policies; $i++) {
+ $discard_policy = $policies[$i];
+ print "***** Structured Supplier -> Sequence Consumer with the " .
+ "$discard_policy policy *****\n";
+
+ unlink $ior;
+ $STS->Arguments($STS->Arguments() . $server_opts[$i]);
+ $STS->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ last;
+ }
+
+ $SEC->Arguments($client_args . " -d $discard_policy");
+ $client = $SEC->SpawnWaitKill (20);
+ if ($client != 0) {
+ $status = 1;
+ last;
+ }
+ $server = $STS->WaitKill (5);
+ if ($server != 0) {
+ $status = 1;
+ last;
+ }
+ }
+}
+
+if ($status == 0) {
+ for($i = 0; $i <= $#policies; $i++) {
+ $discard_policy = $policies[$i];
+ print "**** Sequence Supplier -> Sequence Consumer with the " .
+ "$discard_policy policy ****\n";
+
+ unlink $ior;
+ $SES->Arguments($SES->Arguments() . $server_opts[$i]);
+ $SES->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ last;
+ }
+
+ $SEC->Arguments($client_args . " -d $discard_policy");
+ $client = $SEC->SpawnWaitKill (20);
+ if ($client != 0) {
+ $status = 1;
+ last;
+ }
+ $server = $SES->WaitKill (5);
+ if ($server != 0) {
+ $status = 1;
+ last;
+ }
+ }
+}
+
+if ($status == 0) {
+ for($i = 0; $i <= $#policies; $i++) {
+ $discard_policy = $policies[$i];
+ print "**** Sequence Supplier -> Structured Consumer with the " .
+ "$discard_policy policy ****\n";
+
+ unlink $ior;
+ $SES->Arguments($SES->Arguments() . $server_opts[$i]);
+ $SES->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($ior, 5) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ last;
+ }
+
+ $STC->Arguments($client_args . " -d $discard_policy");
+ $client = $STC->SpawnWaitKill (20);
+ if ($client != 0) {
+ $status = 1;
+ last;
+ }
+ $server = $SES->WaitKill (5);
+ if ($server != 0) {
+ $status = 1;
+ last;
+ }
+ }
+}
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Driver/Driver.mpc b/TAO/orbsvcs/tests/Notify/Driver/Driver.mpc
new file mode 100644
index 00000000000..3c939bb9475
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Driver/Driver.mpc
@@ -0,0 +1,10 @@
+// -*- MPC -*-
+// $Id$
+
+project (Notify_Test_Driver): notifytest {
+ exename = Notify_Tests_Driver
+
+ Source_Files {
+ main.cpp
+ }
+} \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/Driver/Makefile.am b/TAO/orbsvcs/tests/Notify/Driver/Makefile.am
new file mode 100644
index 00000000000..aa14a71cd4f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Driver/Makefile.am
@@ -0,0 +1,69 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Notify_Test_Driver.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = Notify_Tests_Driver
+
+Notify_Tests_Driver_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Notify_Tests_Driver_SOURCES = \
+ main.cpp
+
+Notify_Tests_Driver_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Driver/main.cpp b/TAO/orbsvcs/tests/Notify/Driver/main.cpp
new file mode 100644
index 00000000000..1ad6142c0d4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Driver/main.cpp
@@ -0,0 +1,32 @@
+//$Id$
+
+#include "../lib/Driver.h"
+#include "ace/OS_main.h"
+
+int
+ACE_TMAIN (int argc, char *argv[])
+{
+ TAO_Notify_Tests_Driver driver;
+
+ ACE_TRY_NEW_ENV
+ {
+ int result = driver.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (result == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT("Failed to initialize the Notify Testing Driver.\n")),
+ 1);
+
+ driver.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT("Error: \n"));
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/README b/TAO/orbsvcs/tests/Notify/Lanes/README
new file mode 100644
index 00000000000..d9d9005e7f6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/README
@@ -0,0 +1,58 @@
+RT Notification test to verify lane support
+===========================================
+This test makes sure that events are send according to the lanes
+configured on the evnt channel.
+
+Description:
+===========
+
+notify.conf:
+-----------
+The notify.conf file specifies the Test Filter Factory to be used by
+the RT Notification library.
+The Test Filter factory create special filter objects. these objects
+check if the correct lane is being used for invocations.
+
+
+supplier.conf:
+-------------
+
+An event channel is created with 4 lanes. The lowest priority lane (0 in
+continuous mapping) is used to handle the administrative invocations
+by the driver program. 3 other lanes are used to handle 3 different
+event flow "paths" in the event channel.
+
+3 Periodic suppliers are created. Each supplier is configured to
+operate in its lane.
+
+consumer.conf:
+------------
+
+An RT POA is created with 4 lanes (identical to the one setup on the
+eventchannel).
+
+3 Periodic consumers and created and activated in the local RT POA.
+
+Expected Result:
+==============
+if a request reaches a Lane that it was not supposed to, an
+error message is printed. otherwise some housekeeping messages are
+generated when the test runs.
+
+
+Running the test on 1 host:
+-------------------------
+$> perl run_test.pl
+
+
+Running the test distributed:
+-------------------------
+
+on Host1:
+$1> perl run_test_notify.pl
+
+on Host2:
+$2> perl run_test_supplier.pl
+
+on Host3:
+$3> perl run_test_consumer.pl
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf b/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf
new file mode 100644
index 00000000000..98c0f0ed303
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf
@@ -0,0 +1,61 @@
+##---- Load the Factories------
+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_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
+#
+##--------- Consumer 1 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c1 -Admin ca1 -POA poa_1 -Proxy c1_proxy -MaxCount 5 -Check_Priority"
+static Command_Builder "PeriodicConsumer -Subscription c1 +Path1"
+#
+static Command_Builder "Filter -CreateFilter f_c1 ff"
+static Command_Builder "Filter -Add_Constraint f_c1 'PoolId = 1'"
+static Command_Builder "Filter -Add_Constraint f_c1 'LaneId = 1'"
+#
+#static Command_Builder "Filter -Add_Filter f_c1 c1_proxy"
+#
+##--------- Consumer 2 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c2 -Admin ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 5 -Check_Priority"
+static Command_Builder "PeriodicConsumer -Subscription c2 +Path2"
+#
+static Command_Builder "Filter -CreateFilter f_c2 ff"
+static Command_Builder "Filter -Add_Constraint f_c2 'PoolId = 1'"
+static Command_Builder "Filter -Add_Constraint f_c2 'LaneId = 2'"
+#
+#static Command_Builder "Filter -Add_Filter f_c2 c2_proxy"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c3 -Admin ca1 -POA poa_1 -Proxy c3_proxy -MaxCount 5 -Check_Priority"
+#
+static Command_Builder "PeriodicConsumer -Subscription c3 +Path3"
+#
+static Command_Builder "Filter -CreateFilter f_c3 ff"
+static Command_Builder "Filter -Add_Constraint f_c3 'PoolId = 1'"
+static Command_Builder "Filter -Add_Constraint f_c3 'LaneId = 3'"
+#
+static Command_Builder "Filter -Add_Filter f_c3 c3_proxy"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/notify.conf b/TAO/orbsvcs/tests/Notify/Lanes/notify.conf
new file mode 100644
index 00000000000..85d6b72357e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/notify.conf
@@ -0,0 +1,8 @@
+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_FilterFactory Service_Object* TAO_RT_NotifyTests_Filter:_make_TAO_Notify_Tests_RT_Test_FilterFactory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
+
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/run_test.pl b/TAO/orbsvcs/tests/Notify/Lanes/run_test.pl
new file mode 100755
index 00000000000..7d47e3d10ad
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/run_test.pl
@@ -0,0 +1,98 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$notify_conf = PerlACE::LocalFile ("notify.conf");
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service");
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
+
+$Supplier = new PerlACE::Process ("../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
+#$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf -ORBDebugLevel 1";
+
+$Consumer = new PerlACE::Process ("../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$Notification->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $supplier_ior;
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->Spawn ();
+
+if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Supplier->Kill ();
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/run_test_consumer.pl b/TAO/orbsvcs/tests/Notify/Lanes/run_test_consumer.pl
new file mode 100755
index 00000000000..a0dbfbe696f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/run_test_consumer.pl
@@ -0,0 +1,44 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 600;
+$startup_timeout = 600;
+$notify_conf = PerlACE::LocalFile ("notify.conf");
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$status = 0;
+
+$Consumer = new PerlACE::Process ("../Driver/Notify_Tests_Driver");
+
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+
+if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ exit 1;
+}
+
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ exit 1;
+ }
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/run_test_notify.pl b/TAO/orbsvcs/tests/Notify/Lanes/run_test_notify.pl
new file mode 100755
index 00000000000..28289b96e22
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/run_test_notify.pl
@@ -0,0 +1,48 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 600;
+$startup_timeout = 600;
+$notify_conf = PerlACE::LocalFile ("notify.conf");
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service");
+
+#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$status = $Notification->SpawnWaitKill ($experiment_timeout);
+
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/run_test_supplier.pl b/TAO/orbsvcs/tests/Notify/Lanes/run_test_supplier.pl
new file mode 100755
index 00000000000..38c7449268d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/run_test_supplier.pl
@@ -0,0 +1,46 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 600;
+$startup_timeout = 600;
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$status = 0;
+
+$Supplier = new PerlACE::Process ("../Driver/Notify_Tests_Driver");
+
+#$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf -ORBDebugLevel 1";
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ exit 1;
+}
+
+unlink $supplier_ior;
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$status = $Supplier->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Supplier returned $status\n";
+ $Supplier->Kill ();
+ exit 1;
+ }
+
+$Supplier->Kill ();
+unlink $supplier_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/supplier.conf b/TAO/orbsvcs/tests/Notify/Lanes/supplier.conf
new file mode 100644
index 00000000000..78ecd334aa8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Lanes/supplier.conf
@@ -0,0 +1,65 @@
+## $Id$
+## This file has the following configuration:
+## EventChannel ec1 with 1 Thread
+## SupplierAdmim sa1 with 1 Thread
+## SupplierAdmin sa2
+##
+## Supplier s1 has 1 Thread and is connected to sa1
+## Supplier s2 is connected to sa1
+##
+## Supplier s3 is connected to sa2
+##
+#
+##---- Load the Factories------
+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_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+static Command_Builder "Filter -CreateFactory ff ec1"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s1 -Admin sa1 -Proxy s1_proxy -EventType Path1 -Priority 1 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 "
+#
+static Command_Builder "Filter -CreateFilter f1 ff"
+static Command_Builder "Filter -Add_Constraint f1 'PoolId = 1'"
+static Command_Builder "Filter -Add_Constraint f1 'LaneId = 1'"
+#static Command_Builder "Filter -Add_Filter f1 s1_proxy"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s2 -Admin sa1 -Proxy s2_proxy -EventType Path2 -Priority 2 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 "
+#
+static Command_Builder "Filter -CreateFilter f2 ff"
+static Command_Builder "Filter -Add_Constraint f2 'PoolId = 1'"
+static Command_Builder "Filter -Add_Constraint f2 'LaneId = 2'"
+#static Command_Builder "Filter -Add_Filter f2 s2_proxy"
+#
+### --- Create Supplier s3 connected to sa2 ----
+static Command_Builder "PeriodicSupplier -Create s3 -Admin sa1 -Proxy s3_proxy -EventType Path3 -Priority 3 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 "
+static Command_Builder "Filter -CreateFilter f3 ff"
+static Command_Builder "Filter -Add_Constraint f3 'PoolId = 1'"
+static Command_Builder "Filter -Add_Constraint f3 'LaneId = 3'"
+#static Command_Builder "Filter -Add_Filter f3 s3_proxy"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc b/TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc
new file mode 100644
index 00000000000..d576fd2920e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/MT_Dispatching.mpc
@@ -0,0 +1,38 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ avoids += ace_for_tao
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Struct Supp): notifytest {
+ avoids += ace_for_tao
+ exename = Structured_Supplier
+
+ after += *idl
+ Source_Files {
+ Structured_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Struct Cons): notifytest {
+ avoids += ace_for_tao
+ exename = Structured_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Structured_Push_Consumer.cpp
+ Structured_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am
new file mode 100644
index 00000000000..c78ddc8f1fe
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Makefile.am
@@ -0,0 +1,162 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.MT_Dispatching_Idl.am
+
+if !BUILD_ACE_FOR_TAO
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.MT_Dispatching_Ntf_Struct_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Consumer
+
+Structured_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Consumer_SOURCES = \
+ Notify_Structured_Push_Consumer.cpp \
+ Structured_Consumer.cpp \
+ goC.cpp \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.MT_Dispatching_Ntf_Struct_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Supplier
+
+Structured_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Supplier_SOURCES = \
+ Structured_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp
new file mode 100644
index 00000000000..ce7921b2522
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.cpp
@@ -0,0 +1,39 @@
+// $Id$
+
+#include "Notify_Structured_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+
+Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer (
+ const char* name,
+ unsigned int expected,
+ Notify_Test_Client& client)
+ : name_ (name),
+ expected_ (expected),
+ count_ (0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+void
+Notify_Structured_Push_Consumer::push_structured_event (
+ const CosNotification::StructuredEvent& /*event*/
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "-"));
+
+ ++count_;
+
+ if (this->count_ > this->expected_)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: too many events received.\n")));
+ }
+
+ if (this->count_ >= this->expected_)
+ {
+ this->client_.consumer_done (this);
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h
new file mode 100644
index 00000000000..bc4f2933b90
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Notify_Structured_Push_Consumer.h
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Structured_Push_Consumer.h
+//
+// = DESCRIPTION
+// A structured push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+#define TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+
+#include "Notify_StructuredPushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Structured_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Notify_Structured_Push_Consumer (
+ const char* name,
+ unsigned int expected,
+ Notify_Test_Client& client);
+protected:
+ void push_structured_event (const CosNotification::StructuredEvent&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ unsigned int expected_;
+ unsigned int count_;
+ Notify_Test_Client& client_;
+};
+
+#endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/README b/TAO/orbsvcs/tests/Notify/MT_Dispatching/README
new file mode 100644
index 00000000000..5a2dce02e48
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/README
@@ -0,0 +1,38 @@
+Notification MT Dispatching Test
+================================
+
+Description
+-----------
+This test exercises multi-threaded aspects of the Notification service.
+Dispatching, consumer filter evaluation and supplier filter evaluation. It
+also runs the notifcation service in single-threaded mode.
+
+Usage
+-----
+
+The test consists of a Structured_Supplier and Structured_Consumer. The
+usage for each as is follows:
+
+$ Structured_Supplier -\?
+usage: Structured_Supplier -o <iorfile> -e <# of events> -f
+
+$ Structured_Consumer -\?
+usage: Structured_Consumer -k <ior> -c <# of consumers> -e <expected events>
+ -f
+
+To run this test, just run the run_test.pl perl script. It will run both
+structured and sequence tests with each of the implemented discard policies.
+
+
+Expected Results
+----------------
+********* Running multi-threaded dispatching test *******
+
+********* Running multi-threaded consumer filter evaluation *******
+
+********* Running multi-threaded supplier filter evaluation *******
+
+********* Running single-threaded notification service *******
+
+
+If an error is encountered, the perl script will exit with an error status.
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp
new file mode 100644
index 00000000000..851210f4877
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Consumer.cpp
@@ -0,0 +1,192 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_Structured_Push_Consumer.h"
+#include "goC.h"
+#include "ace/OS_NS_sys_time.h"
+
+#include "Notify_Test_Client.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static Notify_Structured_Push_Consumer* consumers[1024] = {0};
+static const char* ior = "file://supplier.ior";
+static unsigned int consumer_count = 1;
+static unsigned int expected = 1;
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:e:c:f");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'c':
+ consumer_count = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'e':
+ expected = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-c <# of consumers> "
+ "-e <expected events> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ for (unsigned int i = 0; i < consumer_count; i++)
+ {
+ // startup the consumers
+ char name[64] = "";
+ ACE_OS::sprintf (name, "consumer%u", i);
+ ACE_NEW_THROW_EX (consumers[ i ],
+ Notify_Structured_Push_Consumer (
+ name,
+ expected,
+ *client),
+ CORBA::NO_MEMORY ());
+
+ consumers[ i ]->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumers[ i ]->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+static void
+disconnect_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (unsigned int i = 0; i < consumer_count; i++)
+ {
+ consumers[ i ]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ client.orb ()->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (sig.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell the supplier to go
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ disconnect_consumers(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Consumer done.\n"));
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
new file mode 100644
index 00000000000..4612ff106bf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/Structured_Supplier.cpp
@@ -0,0 +1,271 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_StructuredPushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static const unsigned int supplier_max = 32;
+static TAO_Notify_Tests_StructuredPushSupplier* suppliers[supplier_max] = {0};
+static unsigned int supplier_count = 1;
+static int event_count = 1;
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:fc:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'c':
+ supplier_count = ACE_OS::atoi (get_opts.optarg);
+ if (supplier_count > supplier_max)
+ {
+ supplier_count = supplier_max;
+ }
+ break;
+
+ case 'e':
+ event_count = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvent (int id ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_UNUSED_ARG(id);
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup ("a");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup ("b");
+ event.header.fixed_header.event_name = CORBA::string_dup ("test");
+
+ ACE_TRY_NEW_ENV
+ {
+ for (unsigned int i = 0; i < supplier_count; i++)
+ {
+ suppliers[i]->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ for (unsigned int i = 0; i < supplier_count; i++)
+ {
+ ACE_NEW_THROW_EX (suppliers[i],
+ TAO_Notify_Tests_StructuredPushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ suppliers[i]->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ suppliers[i]->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+static void
+disconnect_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ for (unsigned int i = 0; i < supplier_count; ++i)
+ {
+ suppliers[i]->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+ create_suppliers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "%i supplier(s) sending %d events...\n", supplier_count, event_count));
+ for (int i = 0; i < event_count; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendEvent (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nEach Supplier sent %d events.\n", event_count));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ disconnect_suppliers(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl b/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf
new file mode 100644
index 00000000000..007cca48967
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf
@@ -0,0 +1,4 @@
+## $Id$
+#
+## Load the static Cos Notification Service
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 2"
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml
new file mode 100644
index 00000000000..725528eac0c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/MT_Dispatching/notify_mtdispatching.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 2"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf
new file mode 100644
index 00000000000..d8608059bad
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf
@@ -0,0 +1,2 @@
+## $Id$
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1 -SourceThreads 2"
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml
new file mode 100644
index 00000000000..fe5182ff88a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/MT_Dispatching/notify_mtsource.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1 -SourceThreads 2"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf
new file mode 100644
index 00000000000..111787f6e31
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf
@@ -0,0 +1,2 @@
+## $Id$
+static Notify_Default_Event_Manager_Objects_Factory ""
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml
new file mode 100644
index 00000000000..6e3f08e4341
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/MT_Dispatching/notify_nothreads.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl b/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl
new file mode 100755
index 00000000000..9df3b569d16
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl
@@ -0,0 +1,132 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$shutdown_timeout = 10;
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+$status = 0;
+
+@tests =
+ (
+ {
+ description => "no threads",
+ config => "notify_nothreads$PerlACE::svcconf_ext",
+ supplier => " -c 10 -e 10 ",
+ consumer => " -c 2 -e 100 ",
+ },
+ {
+ description => "multi-threaded dispatching",
+ config => "notify_mtdispatching$PerlACE::svcconf_ext",
+ supplier => " -c 10 -e 10 ",
+ consumer => " -c 2 -e 100 ",
+ },
+ {
+ description => "multi-threaded supplier-side",
+ config => "notify_mtsource$PerlACE::svcconf_ext",
+ supplier => " -c 10 -e 10 ",
+ consumer => " -c 2 -e 100 ",
+ },
+ );
+
+@tests2 =
+ (
+ {
+ description => "multi-threaded dispatching",
+ config => "notify_mtdispatching$PerlACE::svcconf_ext",
+ supplier => " ",
+ consumer => " ",
+ }
+ );
+
+$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service");
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior ";
+
+$Supplier = new PerlACE::Process ("Structured_Supplier",
+ "-ORBInitRef NameService=file://$naming_ior ");
+
+$Consumer = new PerlACE::Process ("Structured_Consumer",
+ "-ORBInitRef NameService=file://$naming_ior ");
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+for $test (@tests)
+ {
+ print STDERR "\nTesting $test->{description} ....\n\n";
+
+ unlink $notify_ior;
+ $Notification->Arguments ($Notify_Args . " -ORBSvcConf $test->{config}");
+ $args = $Notification->Arguments ();
+ print STDERR "Running Notification with arguments: $args\n";
+ $Notification->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+ unlink $supplier_ior;
+ $Supplier->Arguments ($Supplier->Arguments () . $test->{supplier});
+ $args = $Supplier->Arguments ();
+ print STDERR "Running Supplier with arguments: $args\n";
+ $Supplier->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+ $Consumer->Arguments ($Consumer->Arguments () . $test->{consumer});
+ $args = $Consumer->Arguments ();
+ print STDERR "Running Consumer with arguments: $args\n";
+ $status = $Consumer->SpawnWaitKill ($experiment_timeout);
+ if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+ $status = $Supplier->WaitKill ($shutdown_timeout);
+ if ($status != 0) {
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+ unlink $supplier_ior;
+
+ $Notification->Kill ();
+ unlink $notify_ior;
+ }
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Makefile.am b/TAO/orbsvcs/tests/Notify/Makefile.am
new file mode 100644
index 00000000000..f334fe7a9f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Makefile.am
@@ -0,0 +1,30 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ PluggableTopology \
+ Test_Filter \
+ XML_Persistence \
+ lib \
+ Structured_Multi_Filter \
+ Structured_Filter \
+ Sequence_Multi_Filter \
+ Sequence_Multi_ETCL_Filter \
+ Reconnecting \
+ RT_lib \
+ Ordering \
+ MT_Dispatching \
+ Driver \
+ Discarding \
+ Destroy \
+ Blocking \
+ Basic \
+ performance-tests
+
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Makefile.am b/TAO/orbsvcs/tests/Notify/Ordering/Makefile.am
new file mode 100644
index 00000000000..dfe5e1ea684
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Makefile.am
@@ -0,0 +1,254 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Ordering_Idl.am
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+## Makefile.Ordering_Ntf_Seq_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Consumer
+
+Sequence_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Consumer_SOURCES = \
+ Notify_Sequence_Push_Consumer.cpp \
+ Sequence_Consumer.cpp \
+ goC.cpp \
+ Notify_Sequence_Push_Consumer.h
+
+Sequence_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Ordering_Ntf_Seq_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Supplier
+
+Sequence_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Supplier_SOURCES = \
+ Sequence_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h \
+ Notify_Structured_Push_Consumer.h
+
+Sequence_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Ordering_Ntf_Struct_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Consumer
+
+Structured_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Consumer_SOURCES = \
+ Notify_Structured_Push_Consumer.cpp \
+ Structured_Consumer.cpp \
+ goC.cpp \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Ordering_Ntf_Struct_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Supplier
+
+Structured_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Supplier_SOURCES = \
+ Structured_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp
new file mode 100644
index 00000000000..d8cb3fe8a76
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.cpp
@@ -0,0 +1,158 @@
+// $Id$
+
+#include "Notify_Sequence_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "common.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_unistd.h"
+
+const int BATCH_SIZE = 5;
+
+Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer (
+ const char* name,
+ CORBA::Short policy,
+ bool use_ordering,
+ int expected,
+ Notify_Test_Client& client)
+ : name_ (name),
+ order_policy_ (policy),
+ use_ordering_ (use_ordering),
+ expected_ (expected),
+ count_ (0),
+ previous_first_ (0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+void
+Notify_Sequence_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::SequencePushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties properties (3);
+ properties.length (3);
+ properties[0].name = CORBA::string_dup (CosNotification::MaximumBatchSize);
+ properties[0].value <<= (CORBA::Long) BATCH_SIZE;
+ properties[1].name = CORBA::string_dup (CosNotification::PacingInterval);
+ properties[1].value <<= (TimeBase::TimeT) (1000 * 10000); // 1 secs
+ if (use_ordering_)
+ {
+ properties[2].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ properties[2].value <<= this->order_policy_;
+ }
+ else
+ {
+ properties.length(2);
+ }
+
+ this->proxy_->set_qos (properties);
+ this->proxy_->connect_sequence_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Sequence_Push_Consumer::push_structured_events (
+ const CosNotification::EventBatch& events
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (count_ == 0)
+ {
+ // Sleep long enough to force the channel to back up, otherwise
+ // there will be no ordering.
+ ACE_OS::sleep(2);
+ }
+
+ ACE_ASSERT(events.length() == static_cast<CORBA::ULong>(BATCH_SIZE));
+
+ count_ += events.length();
+
+ if (this->count_ > this->expected_)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: too many events received.\n")));
+ }
+
+ if (this->count_ >= this->expected_)
+ {
+ this->client_.consumer_done (this);
+ }
+
+ ACE_ASSERT(events[0].header.variable_header.length() == 3);
+ ACE_ASSERT(ACE_OS::strcmp(events[0].header.variable_header[0].name.in(), "id") == 0);
+ CORBA::Long first_id = 0;
+ events[0].header.variable_header[0].value >>= first_id;
+ CORBA::Long last_id = 0;
+ events[events.length() - 1].header.variable_header[0].value >>= last_id;
+
+ ACE_DEBUG((LM_DEBUG, "\n Received id %d-%d\n", first_id, last_id));
+
+ int events_length = static_cast<int>(events.length());
+
+ CORBA::Long previous_id = first_id;
+
+ if (count_ > events_length) // Ignore the very first batch
+ {
+ // First check that the sequences are ordered correctly
+ for (CORBA::ULong idx = 1; idx < events.length(); ++idx)
+ {
+ CORBA::Long id = 0;
+
+ events[idx].header.variable_header[0].value >>= id;
+ CORBA::Long expected_id = previous_id + 1;
+ if (order_policy_ == CosNotification::PriorityOrder
+ || order_policy_ == CosNotification::DeadlineOrder)
+ {
+ expected_id = previous_id - 1;
+ }
+ if (id != expected_id)
+ {
+ ACE_ERROR((LM_ERROR, "Error: Expected:%d Received:%d\n", expected_id, id));
+ return;
+ }
+ previous_id = id;
+ }
+
+ // Next check that the first id in the sequence is ordered
+ // relative to the previously retrieved sequence.
+ if (previous_first_ != 0)
+ {
+ CORBA::Long expected_id = previous_first_ + BATCH_SIZE;
+ if (order_policy_ == CosNotification::PriorityOrder
+ || order_policy_ == CosNotification::DeadlineOrder)
+ {
+ expected_id = previous_first_ - BATCH_SIZE;
+ }
+ if (first_id != expected_id)
+ {
+ ACE_ERROR((LM_ERROR, "Error: Expected:%d Received:%d\n", expected_id, first_id));
+ return;
+ }
+ }
+ previous_first_ = first_id;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h
new file mode 100644
index 00000000000..a7fe36f0288
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Sequence_Push_Consumer.h
@@ -0,0 +1,52 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Ordering
+//
+// = FILENAME
+// Notify_Sequence_Push_Consumer.h
+//
+// = DESCRIPTION
+// A sequence push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+#define TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+
+#include "Notify_SequencePushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Sequence_Push_Consumer: public TAO_Notify_Tests_SequencePushConsumer
+{
+public:
+ Notify_Sequence_Push_Consumer (const char* name,
+ CORBA::Short policy,
+ bool use_ordering,
+ int expected_count,
+ Notify_Test_Client& client);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ void push_structured_events (const CosNotification::EventBatch&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ CORBA::Short order_policy_;
+ bool use_ordering_;
+ int expected_;
+ int count_;
+ int previous_first_;
+ Notify_Test_Client& client_;
+};
+
+#endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp
new file mode 100644
index 00000000000..d8e9f5a6552
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.cpp
@@ -0,0 +1,131 @@
+// $Id$
+
+#include "Notify_Structured_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "common.h"
+
+#include "orbsvcs/TimeBaseC.h"
+
+#include "tao/debug.h"
+
+#include "ace/OS_NS_unistd.h"
+
+Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer (
+ const char* name,
+ CORBA::Short policy,
+ bool use_ordering,
+ int expected,
+ Notify_Test_Client& client)
+ : name_ (name),
+ order_policy_ (policy),
+ use_ordering_ (use_ordering),
+ expected_ (expected),
+ count_ (0),
+ first_(0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+void
+Notify_Structured_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (use_ordering_)
+ {
+ CosNotification::QoSProperties properties (1);
+ properties.length (1);
+ properties[0].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ properties[0].value <<= this->order_policy_;
+
+ this->proxy_->set_qos (properties);
+ }
+
+ this->proxy_->connect_structured_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Structured_Push_Consumer::push_structured_event (
+ const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "-"));
+ if (count_ == 0)
+ {
+ // Sleep long enough to force the channel to back up, otherwise
+ // there will be no ordering.
+ ACE_OS::sleep(2);
+ }
+
+ ++count_;
+
+ if (this->count_ > this->expected_)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: too many events received.\n")));
+ }
+
+ if (this->count_ >= this->expected_)
+ {
+ this->client_.consumer_done (this);
+ }
+
+ CORBA::Long id = 0;
+
+ ACE_ASSERT(event.header.variable_header.length() == 3);
+ ACE_ASSERT(ACE_OS::strcmp(event.header.variable_header[0].name.in(), "id") == 0);
+ event.header.variable_header[0].value >>= id;
+
+ // The first event won't necessarilly be in order, because we hadn't yet forced
+ // the channel to queue events.
+ if (count_ > 1)
+ {
+ if (order_policy_ == CosNotification::PriorityOrder
+ || order_policy_ == CosNotification::DeadlineOrder)
+ {
+ int eid = expected_ - count_ + 1;
+ if (eid <= first_)
+ --eid;
+
+ if (id != eid)
+ ACE_ERROR((LM_ERROR, "\nError: "));
+ ACE_DEBUG((LM_DEBUG, "Expected id:%d Received id:%d\n", eid, id));
+ }
+ else
+ {
+ if (id != count_ - 1)
+ ACE_ERROR((LM_ERROR, "\nError: Expected id:%d Received id:%d\n", count_ - 1, id));
+ }
+ }
+ else
+ {
+ ACE_DEBUG((LM_DEBUG, "Ignoring first event. id=%d\n", id));
+ first_ = id;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h
new file mode 100644
index 00000000000..01b5b69c922
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Notify_Structured_Push_Consumer.h
@@ -0,0 +1,53 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Ordering
+//
+// = FILENAME
+// Notify_Structured_Push_Consumer.h
+//
+// = DESCRIPTION
+// A structured push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+#define TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+
+#include "Notify_StructuredPushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Structured_Push_Consumer: public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Notify_Structured_Push_Consumer (
+ const char* name,
+ CORBA::Short policy,
+ bool use_ordering,
+ int expected,
+ Notify_Test_Client& client);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ void push_structured_event (const CosNotification::StructuredEvent&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ CORBA::Short order_policy_;
+ bool use_ordering_;
+ int expected_;
+ int count_;
+ int first_;
+ Notify_Test_Client& client_;
+};
+
+#endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Ordering.mpc b/TAO/orbsvcs/tests/Notify/Ordering/Ordering.mpc
new file mode 100644
index 00000000000..c57d14c1ddc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Ordering.mpc
@@ -0,0 +1,61 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Struct Supp): notifytest {
+ exename = Structured_Supplier
+
+ after += *idl
+ Source_Files {
+ Structured_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Struct Cons): notifytest {
+ exename = Structured_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Structured_Push_Consumer.cpp
+ Structured_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Seq Supp): notifytest {
+ exename = Sequence_Supplier
+
+ after += *idl
+ Source_Files {
+ Sequence_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Seq Cons): notifytest {
+ exename = Sequence_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Sequence_Push_Consumer.cpp
+ Sequence_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/README b/TAO/orbsvcs/tests/Notify/Ordering/README
new file mode 100644
index 00000000000..9df80a17192
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/README
@@ -0,0 +1,53 @@
+Notification Ordering Policy Test
+================================
+
+Description
+-----------
+
+This test exercises the event discarding policies of the Notification
+Service. Each of the implemented polices are tested (fifo, lifo and
+priority) for both structured push consumers and sequence push consumers.
+
+A number of events are sent by the supplier and the consumer should receive
+a lesser number of events due queue size overflow. Note that with the
+sequence push consumer, it will actually receive more "events" than are sent
+by the supplier. This is due to the fact that the supplier is sending a
+sequence of events that is much larger than the maximum batch size (set by
+the consumer) and therefore the notification service breaks the sequence
+into smaller sets to honor the maximum batch size setting.
+
+
+Usage
+-----
+
+The test consists of a Structured_Supplier and Structured_Consumer as well
+as a Sequence_Supplier and Sequence_Consumer. The usage for each as is
+follows:
+
+$ Structured_Supplier -\?
+usage: Structured_Supplier -o <iorfile> -e <# of events>
+
+$ Structured_Consumer -\?
+usage: Structured_Consumer -k <ior> -e <expected events>
+ -d <fifo|priority|lifo>
+
+$ Sequence_Supplier -\?
+usage: Sequence_Supplier -o <iorfile> -e <# of events>
+
+$ Sequence_Consumer -\?
+usage: Sequence_Consumer -k <ior> -l <low expected events>
+ -h <high expected events> -d <fifo|priority|lifo>
+
+
+To run this test, just run the run_test.pl perl script. It will run both
+structured and sequence tests with each of the implemented discard policies.
+
+
+Expected Results
+----------------
+The consumers of each type expect to only receive a certain number of
+events. If you see:
+
+ERROR: too many events received.
+
+then the test has failed. Otherwise, the test was ok.
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp
new file mode 100644
index 00000000000..79f44545167
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Consumer.cpp
@@ -0,0 +1,185 @@
+// $Id$
+#include "Notify_Sequence_Push_Consumer.h"
+#include "goC.h"
+
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_sys_stat.h"
+
+static const char* ior = "file://supplier.ior";
+static CORBA::Short order_policy = CosNotification::FifoOrder;
+static int expected = 30; // Must match the amount sent by supplier
+static Notify_Sequence_Push_Consumer* consumer_1;
+static bool use_ordering = false;
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "ok:e:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'e':
+ expected = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'o':
+ use_ordering = true;
+ break;
+
+ case 'd':
+ {
+ const char* order = get_opts.optarg;
+ if (ACE_OS::strcmp (order, "fifo") == 0)
+ {
+ order_policy = CosNotification::FifoOrder;
+ }
+ else if (ACE_OS::strcmp (order, "priority") == 0)
+ {
+ order_policy = CosNotification::PriorityOrder;
+ }
+ else if (ACE_OS::strcmp (order, "deadline") == 0)
+ {
+ order_policy = CosNotification::DeadlineOrder;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message "
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#endif
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unknown ordering policy: %s\n",
+ order_policy),
+ -1);
+ }
+ break;
+ }
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-e <expected events> "
+ "-d <fifo|priority|deadline> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (consumer_1,
+ Notify_Sequence_Push_Consumer ("consumer1",
+ order_policy,
+ use_ordering,
+ expected,
+ *client),
+ CORBA::NO_MEMORY ());
+
+ consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_1->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int main (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (sig.in ()));
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+ create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+ consumer_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp
new file mode 100644
index 00000000000..c1d572de8c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Sequence_Supplier.cpp
@@ -0,0 +1,284 @@
+// $Id$
+#include "Notify_SequencePushSupplier.h"
+#include "goS.h"
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/TimeBaseC.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Auto_Ptr.h"
+
+static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0;
+static CORBA::Short order_policy = CosNotification::FifoOrder;
+static int num_events = 30;
+static const char* ior_output_file = "supplier.ior";
+static const int BATCH_SIZE = 5;
+
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ {
+ const char* order = get_opts.optarg;
+ if (ACE_OS::strcasecmp (order, "fifo") == 0)
+ {
+ order_policy = CosNotification::FifoOrder;
+ }
+ else if (ACE_OS::strcasecmp (order, "priority") == 0)
+ {
+ order_policy = CosNotification::PriorityOrder;
+ }
+ else if (ACE_OS::strcasecmp (order, "deadline") == 0)
+ {
+ order_policy = CosNotification::DeadlineOrder;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message "
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#endif
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unknown order policy: %s\n",
+ order_policy),
+ -1);
+ }
+ break;
+ }
+
+ case 'e':
+ num_events = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events> -d"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendBatch (int batch_id ACE_ENV_ARG_DECL)
+{
+ CosNotification::EventBatch events;
+ events.length(BATCH_SIZE);
+ for (CORBA::Long i = 0; i < BATCH_SIZE; ++i)
+ {
+ int id = batch_id * BATCH_SIZE + i;
+
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup ("a");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup ("b");
+ event.header.fixed_header.event_name = CORBA::string_dup ("c");
+
+ event.header.variable_header.length (3);
+ event.header.variable_header[0].name =
+ CORBA::string_dup ("id");
+ event.header.variable_header[0].value <<= (CORBA::Long)id;
+ event.header.variable_header[1].name =
+ CORBA::string_dup (CosNotification::Priority);
+ event.header.variable_header[1].value <<= (CORBA::Short)(id);
+ event.header.variable_header[2].name =
+ CORBA::string_dup (CosNotification::Timeout);
+ event.header.variable_header[2].value <<= (TimeBase::TimeT) (num_events - id);
+
+ events[i] = event;
+ }
+ supplier_1->send_events (events ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_SequencePushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotification::QoSProperties qos (1);
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ qos[0].value <<= order_policy;
+ ec->set_qos (qos ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+ create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events));
+ for (int i = 0; i < num_events / BATCH_SIZE; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendBatch (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp
new file mode 100644
index 00000000000..d86df34f06b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Consumer.cpp
@@ -0,0 +1,181 @@
+// $Id$
+#include "Notify_Structured_Push_Consumer.h"
+#include "goC.h"
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+static const char* ior = "file://supplier.ior";
+static CORBA::Short order_policy = CosNotification::FifoOrder;
+static int expected = 30;
+static Notify_Structured_Push_Consumer* consumer_1;
+static bool use_ordering = false;
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "ok:e:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'o':
+ use_ordering = true;
+ break;
+
+ case 'e':
+ expected = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'd':
+ {
+ const char* order = get_opts.optarg;
+ if (ACE_OS::strcmp (order, "fifo") == 0)
+ {
+ order_policy = CosNotification::FifoOrder;
+ }
+ else if (ACE_OS::strcmp (order, "priority") == 0)
+ {
+ order_policy = CosNotification::PriorityOrder;
+ }
+ else if (ACE_OS::strcmp (order, "deadline") == 0)
+ {
+ order_policy = CosNotification::DeadlineOrder;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message"
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#endif
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unknown order policy: %s\n",
+ order_policy),
+ -1);
+ }
+ break;
+ }
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-e <expected events> "
+ "-d <fifo|priority|deadline> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::OR_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ // startup the first consumer
+ ACE_NEW_THROW_EX (consumer_1,
+ Notify_Structured_Push_Consumer ("consumer1",
+ order_policy,
+ use_ordering,
+ expected,
+ *client),
+ CORBA::NO_MEMORY ());
+ consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_1->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int main (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (sig.in ()));
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+
+ create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+ consumer_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp
new file mode 100644
index 00000000000..bda45d89f6c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/Structured_Supplier.cpp
@@ -0,0 +1,281 @@
+// $Id$
+#include "Notify_StructuredPushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/TimeBaseC.h"
+
+#include "tao/ORB_Core.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/Auto_Ptr.h"
+
+static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0;
+static CORBA::Short order_policy = CosNotification::FifoOrder;
+static int num_events = 30;
+static const char* ior_output_file = "supplier.ior";
+
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ {
+ const char* order = get_opts.optarg;
+ if (ACE_OS::strcmp (order, "fifo") == 0)
+ {
+ order_policy = CosNotification::FifoOrder;
+ }
+ else if (ACE_OS::strcmp (order, "priority") == 0)
+ {
+ order_policy = CosNotification::PriorityOrder;
+ }
+ else if (ACE_OS::strcmp (order, "deadline") == 0)
+ {
+ order_policy = CosNotification::DeadlineOrder;
+#if !defined (ACE_HAS_TIMED_MESSAGE_BLOCKS)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "This order policy requires timed message "
+ "blocks.\nPlease #define "
+ "ACE_HAS_TIMED_MESSAGE_BLOCKS in your "
+ "config.h\n"), -1);
+#endif
+ }
+ else
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unknown order policy: %s\n",
+ order_policy),
+ -1);
+ }
+ break;
+ }
+
+ case 'e':
+ num_events = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events> "
+ "-d <fifo|priority|deadline>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvent (int id ACE_ENV_ARG_DECL_NOT_USED)
+{
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup ("a");
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup ("b");
+ event.header.fixed_header.event_name = CORBA::string_dup ("test");
+
+ event.header.variable_header.length (3);
+ event.header.variable_header[0].name = CORBA::string_dup ("id");
+ event.header.variable_header[0].value <<= (CORBA::Long) id;
+ event.header.variable_header[1].name =
+ CORBA::string_dup (CosNotification::Priority);
+ event.header.variable_header[1].value <<= (CORBA::Short) id;
+ event.header.variable_header[2].name =
+ CORBA::string_dup (CosNotification::Timeout);
+ event.header.variable_header[2].value <<= (TimeBase::TimeT) (num_events - id);
+
+ ACE_TRY_NEW_ENV
+ {
+ supplier_1->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ // startup the supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_StructuredPushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int main (int argc, char* argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotification::QoSProperties qos (1);
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (CosNotification::OrderPolicy);
+ qos[0].value <<= order_policy;
+ ec->set_qos (qos ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_ASSERT(!CORBA::is_nil (admin.in ()));
+ create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", num_events));
+ for (int i = 0; i < num_events; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendEvent (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ supplier_1->disconnect(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/go.idl b/TAO/orbsvcs/tests/Notify/Ordering/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/notify.conf b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf
new file mode 100644
index 00000000000..1a52da7b7ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf
@@ -0,0 +1,6 @@
+## $Id$
+#
+## Load the static Cos Notification Service
+## DispatchThreads creates a queue for the consumer side
+## SourceThreads creates a queue for the supplier side
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1 -SourceThreads 1"
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml
new file mode 100644
index 00000000000..5c15de81fdc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/notify.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/Ordering/notify.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/Ordering/run_test.pl b/TAO/orbsvcs/tests/Notify/Ordering/run_test.pl
new file mode 100755
index 00000000000..c48b9a42e42
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Ordering/run_test.pl
@@ -0,0 +1,219 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$ior = PerlACE::LocalFile ("supplier.ior");
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+$status = 0;
+$deadline = 0;
+
+foreach my $arg (@ARGV) {
+ if ($arg eq "-d") {
+ $deadline = 1;
+ }
+ else {
+ print "Usage: $0 [-d]\n" .
+ " -d specifies that deadline discarding be tested.\n";
+ exit(0);
+ }
+}
+
+$port = PerlACE::uniqueid () + 10001;
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port -o $naming_ior");
+$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf");
+$STS = new PerlACE::Process ("Structured_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$STC = new PerlACE::Process ("Structured_Consumer");
+
+$SES = new PerlACE::Process ("Sequence_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$SEC = new PerlACE::Process ("Sequence_Consumer");
+
+$client_args = "-ORBInitRef NameService=iioploc://localhost:" .
+ "$port/NameService";
+
+unlink $notifyior;
+unlink $naming_ior;
+
+$NS->Spawn ();
+if (PerlACE::waitforfile_timed ($naming_ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Spawn ();
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+if ($deadline) {
+ ## @@todo : Add combinations of deadline ordering.
+}
+
+# Although the TAO notify service supports OrderPolicy on the supplier side
+# QoS, this setting typically serves no practical purpose, and is not testable.
+# This is because we have no way to force the supplier-side queue to back up, and
+# the OrderPolicy will have no affect.
+# Therefore we don't test setting this policy on the supplier side.
+
+print "**** Structured Supplier (fifo) -> Structured Consumer (none) *****\n";
+unlink $ior;
+$STS->Arguments($STS->Arguments() . " -d fifo");
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ exit 1;
+}
+$STC->Arguments($client_args . " -d fifo");
+$client = $STC->SpawnWaitKill (20);
+if ($client != 0) {
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "**** Structured Supplier (fifo) -> Structured Consumer (priority) *****\n";
+unlink $ior;
+$STS->Arguments($STS->Arguments() . " -d fifo");
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ exit 1;
+}
+$STC->Arguments($client_args . " -d priority -o");
+$client = $STC->SpawnWaitKill (20);
+if ($client != 0) {
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "**** Structured Supplier (fifo) -> Sequence Consumer (priority) *****\n";
+unlink $ior;
+$STS->Arguments($STS->Arguments() . " -d fifo");
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ exit 1;
+}
+$SEC->Arguments($client_args . " -d priority -o");
+$client = $SEC->SpawnWaitKill (20);
+if ($client != 0) {
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "**** Sequence Supplier (fifo) -> Structured Consumer (priority) *****\n";
+unlink $ior;
+$SES->Arguments($SES->Arguments() . " -d fifo");
+$SES->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ exit 1;
+}
+$STC->Arguments($client_args . " -d priority -o");
+$client = $STC->SpawnWaitKill (20);
+if ($client != 0) {
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $SES->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "**** Sequence Supplier (fifo) -> Sequence Consumer (priority) *****\n";
+unlink $ior;
+$SES->Arguments($SES->Arguments() . " -d fifo");
+$SES->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ exit 1;
+}
+$SEC->Arguments($client_args . " -d priority -o");
+$client = $SEC->SpawnWaitKill (20);
+if ($client != 0) {
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $SES->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $ior;
+unlink $notifyior;
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Makefile.am b/TAO/orbsvcs/tests/Notify/PluggableTopology/Makefile.am
new file mode 100644
index 00000000000..40b502a5abf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Makefile.am
@@ -0,0 +1,99 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.PlugTop_Lib.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_EXCEPTIONS
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libNotifyPlugTop.la
+
+libNotifyPlugTop_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL \
+ -DPLUGTOP_BUILD_DLL
+
+libNotifyPlugTop_la_SOURCES = \
+ Test_Saver.cpp \
+ Test_Topology_Factory.cpp
+
+noinst_HEADERS = \
+ Test_Saver.h \
+ Test_Topology_Factory.h
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_EXCEPTIONS
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.PlugTop.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_EXCEPTIONS
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = main
+
+main_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+main_SOURCES = \
+ main.cpp
+
+main_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_EXCEPTIONS
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/PlugTop.mpc b/TAO/orbsvcs/tests/Notify/PluggableTopology/PlugTop.mpc
new file mode 100644
index 00000000000..d77816dd0d4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/PlugTop.mpc
@@ -0,0 +1,19 @@
+// $Id$
+
+project(*lib): orbsvcslib, notify_serv, exceptions {
+ sharedname = NotifyPlugTop
+ dynamicflags = PLUGTOP_BUILD_DLL
+ source_files {
+ Test_Saver.cpp
+ Test_Topology_Factory.cpp
+ }
+}
+
+project : orbsvcsexe, notify_serv, exceptions {
+ after += *lib
+ source_files {
+ main.cpp
+ }
+ header_files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp
new file mode 100644
index 00000000000..db1cbb75260
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.cpp
@@ -0,0 +1,37 @@
+// $Id$
+
+#include "Test_Saver.h"
+
+#include <ace/streams.h>
+#include <ace/OS_NS_stdio.h>
+
+Test_Saver::Test_Saver()
+{
+}
+
+bool
+Test_Saver::begin_object(CORBA::Long id,
+ const ACE_CString &type,
+ const TAO_Notify::NVPList& attrs,
+ bool changed
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_OS::fprintf (stdout, "Test_Saver::begin_object type=\"%s\""
+ " id=%d changed=\"%d\"", type.c_str(), id, changed);
+ for (size_t idx = 0; idx < attrs.size(); idx++)
+ {
+ ACE_OS::fprintf (stdout, " %s=\"%s\"", attrs[idx].name.c_str(),
+ attrs[idx].value.c_str());
+ }
+ ACE_OS::fprintf (stdout, "\n");
+ return true;
+}
+
+void
+Test_Saver::end_object (CORBA::Long id,
+ const ACE_CString &type ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_OS::fprintf (stdout, "Test_Saver::end_object type=\"%s\" id=%d\n",
+ type.c_str(), id);
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h
new file mode 100644
index 00000000000..287832cf336
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Saver.h
@@ -0,0 +1,39 @@
+/* -*- C++ -*- */
+/**
+ * $Id$
+ */
+
+#ifndef TEST_SAVER_H
+#define TEST_SAVER_H
+#include /**/ "ace/pre.h"
+
+#include "plugtop_export.h"
+
+#include "orbsvcs/Notify/Topology_Saver.h"
+
+#include "tao/corba.h"
+#include "ace/streams.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class PLUGTOP_Export Test_Saver : public TAO_Notify::Topology_Saver
+{
+public:
+ Test_Saver();
+
+ virtual bool begin_object (CORBA::Long id,
+ const ACE_CString &type,
+ const TAO_Notify::NVPList& attrs,
+ bool changed
+ ACE_ENV_ARG_DECL);
+
+ virtual void end_object (CORBA::Long id,
+ const ACE_CString &type
+ ACE_ENV_ARG_DECL);
+};
+
+
+#include /**/ "ace/post.h"
+#endif /* TEST_SAVER_H */
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp
new file mode 100644
index 00000000000..4363e41b899
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.cpp
@@ -0,0 +1,26 @@
+// $Id$
+
+#include "Test_Topology_Factory.h"
+#include "Test_Saver.h"
+
+Test_Topology_Factory::Test_Topology_Factory()
+{
+}
+
+TAO_Notify::Topology_Saver*
+Test_Topology_Factory::create_saver ()
+{
+ TAO_Notify::Topology_Saver *saver = 0;
+ ACE_NEW_RETURN (saver, Test_Saver, 0);
+ return saver;
+}
+
+//virtual
+TAO_Notify::Topology_Loader*
+Test_Topology_Factory::create_loader ()
+{
+ return 0;
+}
+
+
+ACE_FACTORY_DEFINE (PLUGTOP, Test_Topology_Factory)
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h
new file mode 100644
index 00000000000..e8ac5a5b9dc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/Test_Topology_Factory.h
@@ -0,0 +1,31 @@
+/* -*- C++ -*- */
+//$Id$
+
+#ifndef TEST_TOPOLOGY_FACTORY_H
+#define TEST_TOPOLOGY_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "plugtop_export.h"
+
+#include "orbsvcs/Notify/Topology_Factory.h"
+
+#include "tao/corba.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class PLUGTOP_Export Test_Topology_Factory : public TAO_Notify::Topology_Factory
+{
+public:
+ Test_Topology_Factory ();
+ /////////////////////////////////////////////////
+ // override virtual methods from Topology_Factory
+ virtual TAO_Notify::Topology_Saver* create_saver ();
+ virtual TAO_Notify::Topology_Loader* create_loader ();
+};
+
+ACE_FACTORY_DECLARE (PLUGTOP, Test_Topology_Factory)
+
+#include /**/ "ace/post.h"
+#endif /* TEST_TOPOLOGY_FACTORY_H */
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp b/TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp
new file mode 100644
index 00000000000..ea040206afc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/main.cpp
@@ -0,0 +1,109 @@
+/**
+ * $Id$
+ */
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+//#include <orbsvcs/CosNotifyCommS.h>
+//#include <orbsvcs/CosNotificationS.h>
+#include "tao/TimeBaseC.h"
+
+#include "ace/ARGV.h"
+#include "ace/OS_NS_stdio.h"
+
+using namespace CORBA;
+namespace CNCA = CosNotifyChannelAdmin;
+namespace CN = CosNotification;
+namespace CNC = CosNotifyComm;
+
+const char* NOTIFY_IOR = "corbaloc::localhost:9050/NotifyEventChannelFactory";
+
+ORB_var orb;
+CNCA::EventChannelFactory_var ecf;
+
+namespace {
+ void init_qos_props(CN::QoSProperties& qos, bool topology_persist) {
+ qos.length(13);
+ ULong i = 0;
+ qos[i].name = "EventReliability";
+ qos[i++].value <<= CN::BestEffort;
+ if (topology_persist) {
+ qos[i].name = "ConnectionReliability";
+ qos[i++].value <<= CN::Persistent;
+ }
+ else
+ {
+ qos[i].name = "ConnectionReliability";
+ qos[i++].value <<= CN::BestEffort;
+ }
+ qos[i].name = "Priority";
+ qos[i++].value <<= (Short) 1234;
+ qos[i].name = "Timeout";
+ qos[i++].value <<= (TimeBase::TimeT) 55555; // 5.5555 ms
+ qos[i].name = "MaximumBatchSize";
+ qos[i++].value <<= (Long) 200;
+ qos[i].name = "PacingInterval";
+ qos[i++].value <<= (TimeBase::TimeT) 42000; // 4.2ms
+ qos[i].name = "StopTimeSupported";
+ qos[i++].value <<= Any::from_boolean(0);
+ qos.length(i);
+ }
+ void init_admin_props(CN::AdminProperties& admin) {
+ admin.length(13);
+ ULong i = 0;
+ admin[i].name = "MaxQueueLength";
+ admin[i++].value <<= (Long) 200;
+ admin[i].name = "MaxConsumers";
+ admin[i++].value <<= (Long) 2;
+ admin[i].name = "MaxSuppliers";
+ admin[i++].value <<= (Long) 1;
+ admin[i].name = "RejectNewEvents";
+ admin[i++].value <<= Any::from_boolean(1);
+ }
+ void setUp()
+ {
+ ACE_ARGV av;
+ int ac = 0;
+ orb = ORB_init(ac, av.argv());
+ ACE_ASSERT(! is_nil(orb.in()));
+ Object_var obj = orb->string_to_object(NOTIFY_IOR);
+ ACE_ASSERT(! is_nil(obj.in()));
+ ecf = CNCA::EventChannelFactory::_narrow(obj.in());
+ ACE_ASSERT(! is_nil(ecf.in()));
+ }
+
+ void tearDown()
+ {
+ ecf = CNCA::EventChannelFactory::_nil();
+ orb->destroy();
+ orb = ORB::_nil();
+ }
+}
+
+
+int main(int, char**)
+{
+ try
+ {
+ setUp();
+
+ CN::QoSProperties qos;
+ CN::AdminProperties admin;
+ init_qos_props(qos, true);
+ init_admin_props(admin);
+
+ CNCA::ChannelID ecid;
+ CNCA::EventChannel_var ec = ecf->create_channel(qos, admin, ecid);
+
+ ACE_OS::printf("Created channel id=\"%ld\"\n", static_cast<long>(ecid));
+
+ tearDown();
+
+ return 0;
+ }
+ catch (Exception& e)
+ {
+ ACE_OS::fputs(e._name (), stderr);
+ ACE_OS::fputs("\n", stderr);
+ }
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_export.h b/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_export.h
new file mode 100644
index 00000000000..fe7fbfbee28
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef PLUGTOP_EXPORT_H
+#define PLUGTOP_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (PLUGTOP_HAS_DLL)
+# define PLUGTOP_HAS_DLL 0
+# endif /* ! PLUGTOP_HAS_DLL */
+#else
+# if !defined (PLUGTOP_HAS_DLL)
+# define PLUGTOP_HAS_DLL 1
+# endif /* ! PLUGTOP_HAS_DLL */
+#endif
+
+#if defined (PLUGTOP_HAS_DLL) && (PLUGTOP_HAS_DLL == 1)
+# if defined (PLUGTOP_BUILD_DLL)
+# define PLUGTOP_Export ACE_Proper_Export_Flag
+# define PLUGTOP_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define PLUGTOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* PLUGTOP_BUILD_DLL */
+# define PLUGTOP_Export ACE_Proper_Import_Flag
+# define PLUGTOP_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define PLUGTOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* PLUGTOP_BUILD_DLL */
+#else /* PLUGTOP_HAS_DLL == 1 */
+# define PLUGTOP_Export
+# define PLUGTOP_SINGLETON_DECLARATION(T)
+# define PLUGTOP_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* PLUGTOP_HAS_DLL == 1 */
+
+#endif /* PLUGTOP_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf b/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf
new file mode 100644
index 00000000000..008cb4abe88
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/PluggableTopology/plugtop_ns.conf
@@ -0,0 +1,3 @@
+#
+dynamic TopologyFactory Service_Object * NotifyPlugTop:_make_Test_Topology_Factory() ""
+#dynamic TopologyFactory Service_Object * TAO_CosNotification:_make_XML_Topology_Factory() "" \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/Makefile.am b/TAO/orbsvcs/tests/Notify/RT_lib/Makefile.am
new file mode 100644
index 00000000000..e665d59cb88
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/Makefile.am
@@ -0,0 +1,57 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.RT_Notify_lib.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_RT_CORBA
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libTAO_RT_NotifyTests.la
+
+libTAO_RT_NotifyTests_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL \
+ -DTAO_RT_NOTIFY_TEST_BUILD_DLL
+
+libTAO_RT_NotifyTests_la_SOURCES = \
+ RT_Application_Command.cpp \
+ RT_Factories_Define.cpp \
+ RT_POA_Command.cpp \
+ RT_Priority_Mapping.cpp
+
+noinst_HEADERS = \
+ RT_Application_Command.h \
+ RT_POA_Command.h \
+ RT_Priority_Mapping.h
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_RT_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.cpp b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.cpp
new file mode 100644
index 00000000000..7bb9c0d3801
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.cpp
@@ -0,0 +1,35 @@
+// $Id$
+
+#include "RT_Application_Command.h"
+
+ACE_RCSID(lib, TAO_RT_Application_Command, "$Id$")
+
+#include "../lib/LookupManager.h"
+#include "RT_Priority_Mapping.h"
+
+TAO_Notify_Tests_RT_Application_Command::TAO_Notify_Tests_RT_Application_Command (void)
+{
+}
+
+TAO_Notify_Tests_RT_Application_Command::~TAO_Notify_Tests_RT_Application_Command ()
+{
+}
+
+void
+TAO_Notify_Tests_RT_Application_Command::handle_init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Call the Base class.
+ TAO_Notify_Tests_Application_Command::handle_init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ORB_var orb;
+
+ LOOKUP_MANAGER->resolve (orb);
+
+ TAO_Notify_Tests_RT_Priority_Mapping* mapping = new TAO_Notify_Tests_RT_Priority_Mapping ();
+
+ mapping->init (orb.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ LOOKUP_MANAGER->_register (mapping);
+}
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.h b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.h
new file mode 100644
index 00000000000..34376e99515
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Application_Command.h
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+/**
+ * @file RT_Application_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_RT_APPLICATION_COMMAND_H
+#define TAO_Notify_Tests_RT_APPLICATION_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "rt_notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "../lib/Application_Command.h"
+
+/**
+ * @class TAO_Notify_Tests_RT_Application_Command
+ *
+ * @brief
+ *
+ */
+class TAO_RT_NOTIFY_TEST_Export TAO_Notify_Tests_RT_Application_Command : public TAO_Notify_Tests_Application_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_RT_Application_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_RT_Application_Command ();
+
+ virtual void handle_init (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_RT_APPLICATION_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_Factories_Define.cpp b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Factories_Define.cpp
new file mode 100644
index 00000000000..35be49f7be6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Factories_Define.cpp
@@ -0,0 +1,13 @@
+// $Id$
+#include "../lib/Factories_Define.h"
+
+ACE_RCSID(lib, TAO_Notify_Tests_Factories_Define, "$Id$")
+
+#include "rt_notify_test_export.h"
+#include "../lib/Name.h"
+#include "../lib/Command_Factory_T.h"
+#include "RT_POA_Command.h"
+#include "RT_Application_Command.h"
+
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_RT_NOTIFY_TEST,TAO_Notify_Tests_RT_POA_Command,TAO_Notify_Tests_Name::poa_command_factory)
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_RT_NOTIFY_TEST,TAO_Notify_Tests_RT_Application_Command,TAO_Notify_Tests_Name::application_command_factory)
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_Notify_lib.mpc b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Notify_lib.mpc
new file mode 100644
index 00000000000..caaf2d4cb8f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Notify_lib.mpc
@@ -0,0 +1,16 @@
+// -*- MPC -*-
+// $Id$
+
+project: orbsvcslib, notification, rtcorba, rtportableserver, notifytest, minimum_corba {
+
+ sharedname = TAO_RT_NotifyTests
+
+ dynamicflags = TAO_RT_NOTIFY_TEST_BUILD_DLL
+
+ Source_Files{
+ RT_Application_Command.cpp
+ RT_POA_Command.cpp
+ RT_Priority_Mapping.cpp
+ RT_Factories_Define.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.cpp b/TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.cpp
new file mode 100644
index 00000000000..4d9aa177a6c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.cpp
@@ -0,0 +1,390 @@
+// $Id$
+
+#include "RT_POA_Command.h"
+
+ACE_RCSID(lib, TAO_RT_POA_Command, "$Id$")
+
+#include "tao/debug.h"
+#include "../lib/LookupManager.h"
+#include "../lib/Name.h"
+
+TAO_Notify_Tests_RT_POA_Command::TAO_Notify_Tests_RT_POA_Command (void)
+ :priority_model_ (RTCORBA::CLIENT_PROPAGATED)
+ , server_priority_ (0)
+ , thread_pool_static_threads_ (0)
+ , thread_pool_default_priority_ (0)
+{
+}
+
+TAO_Notify_Tests_RT_POA_Command::~TAO_Notify_Tests_RT_POA_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_RT_POA_Command::get_name (void)
+{
+ return TAO_Notify_Tests_RT_POA_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_RT_POA_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::poa_command;
+}
+
+void
+TAO_Notify_Tests_RT_POA_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ const ACE_TCHAR *current_arg = 0;
+
+ if (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-Create") == 0)
+ {
+ this->command_ = CREATE;
+
+ arg_shifter.consume_arg ();
+
+ this->POA_name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-PriorityModel")))
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("CLIENT") == 0)
+ priority_model_ = RTCORBA::CLIENT_PROPAGATED;
+ else
+ priority_model_ = RTCORBA::SERVER_DECLARED;
+ arg_shifter.consume_arg ();
+
+ server_priority_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+
+ continue;
+ }
+ // -Lanes lane-count -Lane prio statc_thr dyn_thr
+ if ((current_arg = arg_shifter.get_the_parameter ("-Lanes")))
+ {
+ int lanecount = ACE_OS::atoi (current_arg);
+ lanes_.length (lanecount);
+ arg_shifter.consume_arg ();
+
+ int l_index = 0;
+ //parse lane values ...
+ while (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-Lane") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ // read priority
+ lanes_[l_index].lane_priority = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ // static thread count
+ lanes_[l_index].static_threads = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ // dynamic thread count
+ lanes_[l_index].dynamic_threads = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "POA Create: lane parsed - %d, %d, %d\n",
+ lanes_[l_index].lane_priority, lanes_[l_index].static_threads, lanes_[l_index].dynamic_threads));
+ l_index++;
+ }
+ else
+ break;
+ } /* while -- lane values */
+
+ continue;
+ } /* if -Lanes */
+
+ if ((current_arg = arg_shifter.get_the_parameter ("-Bands")))
+ {
+ int bandcount = ACE_OS::atoi (current_arg);
+ bands_.length (bandcount);
+ arg_shifter.consume_arg ();
+
+ int b_index = 0;
+ //parse band values ...
+ while (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-Band") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ // read low
+ bands_[b_index].low = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ // read high
+ bands_[b_index].high = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "POA Create: band parsed - %d, %d \n",
+ bands_[b_index].low, bands_[b_index].high));
+ b_index++;
+ }
+ else
+ break;
+ } /* while -- Band values */
+
+ continue;
+ } /* if -Bands */
+
+ // -ThreadPool thread_pool_count thread_pool_default_priority
+ if (arg_shifter.cur_arg_strncasecmp ("-ThreadPool") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ current_arg = arg_shifter.get_current ();
+ this->thread_pool_static_threads_ = ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+
+ current_arg = arg_shifter.get_current ();
+ this->thread_pool_default_priority_ = ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "ThreadPool parsed - static threads = %d, prio = %d \n",
+ this->thread_pool_static_threads_, this->thread_pool_default_priority_));
+
+ continue;
+ } /* ThreadPool */
+
+ // none of the matched so break out...
+ break;
+ } /* while */
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Destroy") == 0)
+ {
+ this->command_ = DESTROY;
+
+ arg_shifter.consume_arg ();
+
+ this->POA_name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+ }
+ } /* if */
+}
+
+void
+TAO_Notify_Tests_RT_POA_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == CREATE)
+ {
+ // Resolve ORB
+ CORBA::ORB_var orb;
+
+ LOOKUP_MANAGER->resolve (orb);
+
+ // Resolve RTORB
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RTORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::RTORB_var rt_orb =
+ RTCORBA::RTORB::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve parent poa.
+ PortableServer::POA_var parent_poa;
+
+ LOOKUP_MANAGER->resolve (parent_poa);
+
+ // Create the POA.
+ this->create (rt_orb.in (), parent_poa.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Created RT POA %s\n", this->POA_name_.c_str ()));
+ }
+ else if (this->command_ == DESTROY)
+ {
+ PortableServer::POA_var poa;
+
+ LOOKUP_MANAGER->resolve (poa, this->POA_name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa->destroy (1,0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Destroyed RT POA %s\n", this->POA_name_.c_str ()));
+ }
+}
+
+void
+TAO_Notify_Tests_RT_POA_Command::create (RTCORBA::RTORB_ptr rt_orb, PortableServer::POA_ptr parent_poa ACE_ENV_ARG_DECL)
+{
+ /*
+ lanes bands priomodel
+
+ if lanes create lanespolicy
+ if bands create bands policy
+
+ if lanes and bands , policy_list_length = 3
+ else
+ if lanes policy_list_length = 2
+ else
+ if threadpool and bands , policy_list_length = 3
+ else
+ if threadpool policy_list_length = 2
+ else
+ if bands policy_list_length = 2
+ else
+ policy_list_length = 1
+
+ */
+
+ CORBA::Policy_var priority_model_policy;
+ CORBA::Policy_var lanes_policy;
+ CORBA::Policy_var thread_pool_policy;
+ CORBA::Policy_var bands_policy;
+
+ // Create a priority model policy.
+ priority_model_policy =
+ rt_orb->create_priority_model_policy (priority_model_,
+ server_priority_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (lanes_.length () != 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;
+ // CORBA::ULong static_threads = 1;
+ // CORBA::ULong dynamic_threads = 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
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+
+ // Create a thread-pool policy.
+ lanes_policy =
+ rt_orb->create_threadpool_policy (threadpool_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ }
+ else if (thread_pool_static_threads_ > 0)
+ {
+ CORBA::ULong stacksize = 0;
+ CORBA::ULong static_threads = this->thread_pool_static_threads_;
+ CORBA::ULong dynamic_threads = 0;
+ RTCORBA::Priority default_priority = this->thread_pool_default_priority_;
+ CORBA::Boolean allow_request_buffering = 0;
+ CORBA::ULong max_buffered_requests = 0;
+ CORBA::ULong max_request_buffer_size = 0;
+
+ // Create the thread-pool.
+ RTCORBA::ThreadpoolId threadpool_id =
+ rt_orb->create_threadpool (stacksize,
+ static_threads,
+ dynamic_threads,
+ default_priority,
+ allow_request_buffering,
+ max_buffered_requests,
+ max_request_buffer_size
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ thread_pool_policy =
+ rt_orb->create_threadpool_policy (threadpool_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (bands_.length () != 0)
+ {
+ // Create a bands policy.
+ bands_policy =
+ rt_orb->create_priority_banded_connection_policy (this->bands_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ CORBA::PolicyList poa_policy_list;
+
+ CORBA::Policy_var activation_policy =
+ parent_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (lanes_.length () == 0 && thread_pool_static_threads_ == 0 && bands_.length () == 0)
+ {
+ poa_policy_list.length (1);
+ poa_policy_list[0] = priority_model_policy;
+ }
+ else if (lanes_.length () == 0 && thread_pool_static_threads_ == 0 && bands_.length () > 0)
+ {
+ poa_policy_list.length (2);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = bands_policy;
+ }
+ else if (lanes_.length () == 0 && thread_pool_static_threads_ > 0 && bands_.length () == 0)
+ {
+ poa_policy_list.length (2);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = thread_pool_policy;
+ }
+ else if (lanes_.length () == 0 && thread_pool_static_threads_ > 0 && bands_.length () > 0)
+ {
+ poa_policy_list.length (3);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = bands_policy;
+ poa_policy_list[2] = thread_pool_policy;
+ }
+ else if (lanes_.length () > 0 && thread_pool_static_threads_ == 0 && bands_.length () == 0)
+ {
+ poa_policy_list.length (2);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = lanes_policy;
+ }
+ else if (lanes_.length () > 0 && thread_pool_static_threads_ == 0 && bands_.length () > 0)
+ {
+ poa_policy_list.length (3);
+ poa_policy_list[0] = priority_model_policy;
+ poa_policy_list[1] = bands_policy;
+ poa_policy_list[2] = lanes_policy;
+ }
+
+ // Add the activation policy
+ int act_index = poa_policy_list.length ();
+ poa_policy_list.length (act_index + 1);
+
+ poa_policy_list[act_index] = activation_policy;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "creating POA %s\n", POA_name_.c_str ()));
+
+ // Get the POA Manager.
+ PortableServer::POAManager_var poa_manager =
+ parent_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ parent_poa->create_POA (POA_name_.c_str (),
+ poa_manager.in (),
+ poa_policy_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.h b/TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.h
new file mode 100644
index 00000000000..b5bcb27a825
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_POA_Command.h
@@ -0,0 +1,81 @@
+/* -*- C++ -*- */
+/**
+ * @file RT_POA_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_RT_POA_COMMAND_H
+#define TAO_Notify_Tests_RT_POA_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "rt_notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+#include "tao/RTCORBA/RTCORBA.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "../lib/Command.h"
+#include "ace/SString.h"
+
+/**
+ * @class TAO_Notify_Tests_RT_POA_Command
+ *
+ * @brief Command for managing RTCORBA POAs.
+ *
+ */
+class TAO_RT_NOTIFY_TEST_Export TAO_Notify_Tests_RT_POA_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_RT_POA_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_RT_POA_Command ();
+
+ /// Parse args and populate options.
+ /// The arg_shifter options are read in the following manner: -Create <name> -PriorityModel <CLIENT|SERVER> <priority> -Lanes <count> (-Lane <priority> ,<static_threads> <dynamic_threads>)* -Bands <count> (-Band <low> <high>)*
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Get the command name.
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+ /// Create the POA with the params parsed.
+ void create (RTCORBA::RTORB_ptr rt_orb, PortableServer::POA_ptr parent_poa ACE_ENV_ARG_DECL);
+
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ CREATE,
+ DESTROY,
+ DUMP_STATE
+ };
+
+ ACE_CString POA_name_;
+
+ RTCORBA::PriorityModel priority_model_;
+ RTCORBA::Priority server_priority_;
+ RTCORBA::ThreadpoolLanes lanes_;
+ RTCORBA::PriorityBands bands_;
+
+ CORBA::ULong thread_pool_static_threads_;
+ RTCORBA::Priority thread_pool_default_priority_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_RT_POA_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.cpp b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.cpp
new file mode 100644
index 00000000000..ee30db74bd1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.cpp
@@ -0,0 +1,40 @@
+// $Id$
+
+#include "RT_Priority_Mapping.h"
+
+ACE_RCSID(lib, RT_Priority_Mapping, "$Id$")
+
+#include "../lib/LookupManager.h"
+
+TAO_Notify_Tests_RT_Priority_Mapping::~TAO_Notify_Tests_RT_Priority_Mapping (void)
+{
+}
+
+void
+TAO_Notify_Tests_RT_Priority_Mapping::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = orb->resolve_initial_references ("PriorityMappingManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ RTCORBA::PriorityMappingManager_var mapping_manager =
+ RTCORBA::PriorityMappingManager::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->priority_mapping_ = mapping_manager->mapping ();
+}
+
+CORBA::Boolean
+TAO_Notify_Tests_RT_Priority_Mapping::to_native (RTCORBA::Priority corba_priority,
+ RTCORBA::NativePriority &native_priority)
+{
+ return this->priority_mapping_->to_native (corba_priority, native_priority);
+}
+
+CORBA::Boolean
+TAO_Notify_Tests_RT_Priority_Mapping::to_CORBA (RTCORBA::NativePriority native_priority,
+ RTCORBA::Priority &corba_priority)
+{
+ return this->priority_mapping_->to_CORBA (native_priority, corba_priority);
+}
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.h b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.h
new file mode 100644
index 00000000000..0e8d308e656
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/RT_Priority_Mapping.h
@@ -0,0 +1,54 @@
+/* -*- C++ -*- */
+/**
+ * @file RT_Priority_Mapping.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_RT_PRIORITY_MAPPING_H
+#define TAO_Notify_Tests_RT_PRIORITY_MAPPING_H
+#include /**/ "ace/pre.h"
+
+#include "rt_notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "../lib/Priority_Mapping.h"
+#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+
+/**
+ * @class TAO_Notify_Tests_RT_Priority_Mapping
+ *
+ * @brief Delegates to a RTCORBA::PriorityMapping
+ *
+ */
+class TAO_RT_NOTIFY_TEST_Export TAO_Notify_Tests_RT_Priority_Mapping : public TAO_Notify_Tests_Priority_Mapping
+{
+public:
+ /// The destructor
+ virtual ~TAO_Notify_Tests_RT_Priority_Mapping (void);
+
+ /// Init the Mapping manager.
+ void init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ virtual CORBA::Boolean
+ to_native (CORBA::Short corba_priority,
+ CORBA::Short &native_priority);
+ virtual CORBA::Boolean
+ to_CORBA (CORBA::Short native_priority,
+ CORBA::Short &corba_priority);
+
+protected:
+
+ /// The Priority Mapping helper.
+ RTCORBA::PriorityMapping *priority_mapping_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_RT_PRIORITY_MAPPING_H */
diff --git a/TAO/orbsvcs/tests/Notify/RT_lib/rt_notify_test_export.h b/TAO/orbsvcs/tests/Notify/RT_lib/rt_notify_test_export.h
new file mode 100644
index 00000000000..356b8f92976
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/RT_lib/rt_notify_test_export.h
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_RT_NOTIFY_TEST_EXPORT_H
+#define TAO_RT_NOTIFY_TEST_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RT_NOTIFY_TEST_HAS_DLL)
+# define TAO_RT_NOTIFY_TEST_HAS_DLL 0
+# endif /* ! TAO_RT_NOTIFY_TEST_HAS_DLL */
+#else
+# if !defined (TAO_RT_NOTIFY_TEST_HAS_DLL)
+# define TAO_RT_NOTIFY_TEST_HAS_DLL 1
+# endif /* ! TAO_RT_NOTIFY_TEST_HAS_DLL */
+#endif
+
+#if defined (TAO_RT_NOTIFY_TEST_HAS_DLL) && (TAO_RT_NOTIFY_TEST_HAS_DLL == 1)
+# if defined (TAO_RT_NOTIFY_TEST_BUILD_DLL)
+# define TAO_RT_NOTIFY_TEST_Export ACE_Proper_Export_Flag
+# define TAO_RT_NOTIFY_TEST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RT_NOTIFY_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RT_NOTIFY_TEST_BUILD_DLL */
+# define TAO_RT_NOTIFY_TEST_Export ACE_Proper_Import_Flag
+# define TAO_RT_NOTIFY_TEST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RT_NOTIFY_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RT_NOTIFY_TEST_BUILD_DLL */
+#else /* TAO_RT_NOTIFY_TEST_HAS_DLL == 1 */
+# define TAO_RT_NOTIFY_TEST_Export
+# define TAO_RT_NOTIFY_TEST_SINGLETON_DECLARATION(T)
+# define TAO_RT_NOTIFY_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RT_NOTIFY_TEST_HAS_DLL == 1 */
+
+#endif /* TAO_RT_NOTIFY_TEST_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp
new file mode 100644
index 00000000000..43acfd70c38
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.cpp
@@ -0,0 +1,1908 @@
+//$Id$
+
+#include "Consumer.h"
+#include "tao/debug.h"
+#include "tao/PortableServer/PortableServerC.h"
+#include "tao/TimeBaseC.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/OS_NS_stdio.h"
+#include "tao/AnyTypeCode/Any.h"
+
+ACE_RCSID (Notify_Tests, Consumer_Main, "$Id$")
+
+static const char NOTIFY_FACTORY_NAME[] = "NotifyEventChannelFactory";
+static const char NAMING_SERVICE_NAME[] = "NameService";
+
+static const size_t minus_one = static_cast<size_t>(-1);
+
+///////////////////////////
+// StructuredPushConsumer_i
+
+StructuredPushConsumer_i::StructuredPushConsumer_i ()
+ : verbose_ (false)
+ , received_ (0)
+ , expect_ (10)
+ , fail_ (0)
+ , may_discard_ (0)
+ , serial_number_ (0)
+ , exceptions_thrown_ (0)
+ , problem_ (false)
+ , connected_ (false)
+{
+}
+
+size_t
+StructuredPushConsumer_i::received () const
+{
+ return this->received_;
+}
+
+bool
+StructuredPushConsumer_i::has_problem () const
+{
+ return this->problem_;
+}
+
+void
+StructuredPushConsumer_i::set_connected (bool flag)
+{
+ this->connected_ = flag;
+}
+
+bool
+StructuredPushConsumer_i::is_connected () const
+{
+ return this->connected_;
+}
+
+void
+StructuredPushConsumer_i::set_expectations (size_t expected, size_t fail, size_t serial_number, bool verbose)
+{
+ this->expect_ = expected;
+ this->fail_ = fail;
+ this->serial_number_ = serial_number;
+ this->verbose_ = verbose;
+}
+
+void
+StructuredPushConsumer_i::offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) StructuredPushConsumer offered change \n")
+ ));
+}
+
+void
+StructuredPushConsumer_i::check_serial_number (CORBA::ULong seq)
+{
+ if (this->serial_number_ == minus_one)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Structured Consumer received event %d.\n"),
+ static_cast<int>(seq)
+ ));
+ }
+ }
+ else
+ {
+ if (seq == this->serial_number_)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Structured Consumer received correct event %d.\n"),
+ static_cast<int>(seq)
+ ));
+ }
+ }
+ else if ((seq - this->serial_number_) <= this->may_discard_)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Structured Consumer: service received event %d; Notify discarded %d*.\n"),
+ static_cast<int>(seq),
+ static_cast<int>(this->serial_number_)
+ ));
+ }
+ this->received_ += seq - this->serial_number_;
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer received notifications out of sequence. Expecting %d received %d.\n"),
+ static_cast<int>(this->serial_number_),
+ static_cast<int>(seq)
+ ));
+ }
+ this->serial_number_ = seq + 1;
+ }
+ may_discard_ = 0;
+}
+
+
+void
+StructuredPushConsumer_i::push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ this->received_ += 1;
+ if (this->received_ == this->expect_ + 1)
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer received more than the %d events that were expected.\n"),
+ this->expect_
+ ));
+ }
+ if (this->fail_ != 0 && ((this->received_ + this->exceptions_thrown_) % this->fail_) == 0)
+ {
+ this->received_ -= 1;
+ this->exceptions_thrown_ += 1;
+ this->may_discard_ = 1;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer failing at event # %d.\n"),
+ static_cast<int>(this->received_)
+ ));
+ ACE_THROW (CORBA::UNKNOWN());
+ ACE_CHECK;
+ }
+ if (notification.filterable_data.length () > 0)
+ {
+ if (0 == ACE_OS::strcmp (notification.filterable_data[0].name, "serial_number"))
+ {
+ const CORBA::Any & data = notification.filterable_data[0].value;
+
+ CORBA::ULong seq = 0;
+ if (data >>= seq)
+ {
+ check_serial_number (seq);
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer received unexpected data type for serial_number.\n")
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer received wrong filterable data name.%s. Expecting serial_number\n"),
+ static_cast<const char *>(notification.filterable_data[0].name)
+ ));
+ }
+ }
+ else if (0 == ACE_OS::strcmp (notification.header.fixed_header.event_type.type_name, "%ANY")
+ && 0 == strcmp (notification.header.fixed_header.event_type.domain_name, ""))
+ {
+ const CORBA::Any * any;
+ if (notification.remainder_of_body >>= any)
+ {
+ // this is a wrapped "Any"
+ CORBA::ULong seq = 0;
+ if ((*any) >>= seq)
+ {
+ check_serial_number (seq);
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer received Any with unknown data type\n")
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer received remainder_of_body with unknown data type\n")
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Structured Consumer: no filterable data. \n")
+ ));
+ }
+ this->may_discard_ = 0;
+}
+
+void
+StructuredPushConsumer_i::disconnect_structured_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) StructuredPushConsumer received disconnect\n")
+ ));
+}
+
+///////////////////////////
+// SequencePushConsumer_i
+
+SequencePushConsumer_i::SequencePushConsumer_i ()
+ : verbose_ (false)
+ , received_ (0)
+ , expect_ (10)
+ , fail_ (0)
+ , may_discard_ (0)
+ , serial_number_ (0)
+ , exceptions_thrown_ (0)
+ , problem_ (false)
+ , connected_ (false)
+{
+}
+
+size_t
+SequencePushConsumer_i::received () const
+{
+ return this->received_;
+}
+
+bool
+SequencePushConsumer_i::has_problem () const
+{
+ return this->problem_;
+}
+
+void
+SequencePushConsumer_i::set_connected (bool flag)
+{
+ this->connected_ = flag;
+}
+
+bool
+SequencePushConsumer_i::is_connected () const
+{
+ return this->connected_;
+}
+
+void
+SequencePushConsumer_i::set_expectations (size_t expected, size_t fail,size_t serial_number, bool verbose)
+{
+ this->expect_ = expected;
+ this->fail_ = fail;
+ this->serial_number_ = serial_number;
+ this->verbose_ = verbose;
+}
+
+void
+SequencePushConsumer_i::offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) SequencePushConsumer offered subscription change\n")
+ ));
+}
+
+void
+SequencePushConsumer_i::check_serial_number (CORBA::ULong seq)
+{
+ if (this->serial_number_ == minus_one)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received event %d.\n"),
+ static_cast<int>(seq)
+ ));
+ }
+ }
+ else
+ {
+ if (seq == this->serial_number_)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received correct event %d.\n"),
+ static_cast<int>(seq)
+ ));
+ }
+ }
+ else if ((seq - this->serial_number_) <= this->may_discard_)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Sequence Consumer: service received event %d; Notify discarded %d*.\n"),
+ static_cast<int>(seq),
+ static_cast<int>(this->serial_number_)
+ ));
+ }
+ this->received_ += seq - this->serial_number_;
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received notifications out of sequence. Expecting %d received %d.\n"),
+ static_cast<int>(this->serial_number_),
+ static_cast<int>(seq)
+ ));
+ }
+ this->serial_number_ = seq + 1;
+ }
+ may_discard_ = 0;
+}
+
+void
+SequencePushConsumer_i::push_structured_events (
+ const CosNotification::EventBatch & notifications
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ size_t batch_size = notifications.length();
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received batch of %d events.\n"),
+ static_cast<int>(batch_size)
+ ));
+ }
+ for (size_t nevent = 0; nevent < batch_size; ++nevent)
+ {
+ this->received_ += 1;
+ if (this->received_ == this->expect_ + 1)
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received more than the %d events that were expected.\n"),
+ this->expect_
+ ));
+ }
+ if (this->fail_ != 0 && ((this->received_ + this->exceptions_thrown_) % this->fail_) == 0)
+ {
+ this->received_ -= 1;
+ this->exceptions_thrown_ += 1;
+ this->may_discard_ = batch_size;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Sequence Consumer failing at event # %d. Expecting %d duplicates.\n"),
+ static_cast<int>(this->received_),
+ static_cast<int>(nevent + 1)
+ ));
+ ACE_THROW (CORBA::UNKNOWN());
+ ACE_CHECK;
+ }
+ const CosNotification::StructuredEvent & notification = notifications[nevent];
+ if (notification.filterable_data.length () > 0)
+ {
+ if (0 == ACE_OS::strcmp (notification.filterable_data[0].name, "serial_number"))
+ {
+ const CORBA::Any & data = notification.filterable_data[0].value;
+
+ CORBA::ULong seq = 0;
+ if (data >>= seq)
+ {
+ check_serial_number (seq);
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received unexpected data type for serial_number.\n")
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received wrong filterable data name.%s. Expecting serial_number\n"),
+ static_cast<const char *>(notification.filterable_data[0].name)
+ ));
+ }
+ }
+ else if (0 == ACE_OS::strcmp (notification.header.fixed_header.event_type.type_name, "%ANY")
+ && 0 == strcmp (notification.header.fixed_header.event_type.domain_name, ""))
+ {
+ CORBA::ULong seq = 0;
+ if (notification.remainder_of_body >>= seq)
+ {
+ check_serial_number (seq);
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received Any with unknown data type\n")
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Sequence Consumer received no filterable data\n")
+ ));
+ }
+ }
+}
+
+void
+SequencePushConsumer_i::disconnect_sequence_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) SequencePushConsumer received disconnect\n")
+ ));
+}
+
+///////////////////////////
+// AnyPushConsumer_i
+
+AnyPushConsumer_i::AnyPushConsumer_i ()
+ : verbose_ (false)
+ , received_ (0)
+ , expect_ (10)
+ , fail_ (0)
+ , may_discard_ (0)
+ , serial_number_ (0)
+ , exceptions_thrown_ (0)
+ , problem_ (false)
+ , connected_ (false)
+{
+}
+
+size_t
+AnyPushConsumer_i::received () const
+{
+ return this->received_;
+}
+
+bool
+AnyPushConsumer_i::has_problem () const
+{
+ return this->problem_;
+}
+
+void
+AnyPushConsumer_i::set_connected (bool flag)
+{
+ this->connected_ = flag;
+}
+
+bool
+AnyPushConsumer_i::is_connected () const
+{
+ return this->connected_;
+}
+
+void
+AnyPushConsumer_i::set_expectations (size_t expected, size_t fail, size_t serial_number, bool verbose)
+{
+ this->expect_ = expected;
+ this->fail_ = fail;
+ this->serial_number_ = serial_number;
+ this->verbose_ = verbose;
+}
+
+void
+AnyPushConsumer_i::offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) SequencePushConsumer offered subscription change\n")
+ ));
+}
+
+void
+AnyPushConsumer_i::check_serial_number (CORBA::ULong seq)
+{
+ if (this->serial_number_ == minus_one)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Any Consumer received event %d.\n"),
+ static_cast<int>(seq)
+ ));
+ }
+ }
+ else
+ {
+ if (seq == this->serial_number_)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Any Consumer received correct event %d.\n"),
+ static_cast<int>(seq)
+ ));
+ }
+ }
+ else if ((seq - this->serial_number_) <= this->may_discard_)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Any Consumer: service received event %d; Notify discarded %d*.\n"),
+ static_cast<int>(seq),
+ static_cast<int>(this->serial_number_)
+ ));
+ }
+ this->received_ += seq - this->serial_number_;
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Any Consumer received notifications out of sequence. Expecting %d received %d.\n"),
+ static_cast<int>(this->serial_number_),
+ static_cast<int>(seq)
+ ));
+ }
+ this->serial_number_ = seq + 1;
+ }
+ may_discard_ = 0;
+}
+
+void
+AnyPushConsumer_i::push (
+ const CORBA::Any & data
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ this->received_ += 1;
+ if (this->received_ == this->expect_ + 1)
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Any Consumer received more than the %d events that were expected.\n"),
+ this->expect_
+ ));
+ }
+ if (this->fail_ != 0 && ((this->received_ + this->exceptions_thrown_) % this->fail_) == 0)
+ {
+ this->received_ -= 1;
+ this->exceptions_thrown_ += 1;
+ this->may_discard_ = 1;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Any Consumer failing at event # %d.\n"),
+ static_cast<int>(this->received_)
+ ));
+ ACE_THROW (CORBA::UNKNOWN());
+ ACE_CHECK;
+ }
+ CORBA::ULong seq = 0;
+ if (data >>= seq)
+ {
+ check_serial_number (seq);
+ }
+ else
+ {
+ const CosNotification::StructuredEvent * notification;
+ if (data >>= notification)
+ {
+ if (notification->filterable_data.length () > 0)
+ {
+ if (0 == ACE_OS::strcmp (notification->filterable_data[0].name, "serial_number"))
+ {
+ const CORBA::Any & data = notification->filterable_data[0].value;
+
+ CORBA::ULong seq = 0;
+ if (data >>= seq)
+ {
+ check_serial_number (seq);
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Any Consumer received structured notification with unexpected data type for serial_number in structured event.\n")
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Any Consumer received wrong filterable data name in structured event: %s. Expecting serial_number\n"),
+ static_cast<const char *>(notification->filterable_data[0].name)
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Any Consumer: no filterable data in structured event. \n")
+ ));
+ }
+ }
+ else
+ {
+ this->problem_ = true;
+
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Any Consumer received unexpected data type.\n")
+ ));
+ }
+ }
+}
+
+void
+AnyPushConsumer_i::disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) AnyPushConsumer received disconnect\n")
+ ));
+}
+
+/////////////////////////
+// ReconnectionCallback_i
+
+ReconnectionCallback_i::ReconnectionCallback_i (Consumer_Main & consumer_main)
+ : consumer_main_ (consumer_main)
+ , id_is_valid_ (false)
+ , reconnect_count_ (0)
+{
+}
+
+size_t
+ReconnectionCallback_i::reconnect_count () const
+{
+ return this->reconnect_count_;
+}
+
+void
+ReconnectionCallback_i::reconnect (
+ CORBA::Object_ptr reconnection
+ ACE_ENV_ARG_DECL
+ ) ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer received reconnection request\n")
+ ));
+ this->ecf_ = CosNotifyChannelAdmin::EventChannelFactory::_narrow (reconnection ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (!CORBA::is_nil (this->ecf_.in ()))
+ {
+ this->consumer_main_.reconnect (this->ecf_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->reconnect_count_ += 1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer reconnection request failed: wrong object type\n")
+ ));
+ }
+}
+
+CORBA::Boolean
+ReconnectionCallback_i::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::Boolean (1);
+}
+
+
+ReconnectionCallback_i::~ReconnectionCallback_i ()
+{
+ // normally you would disconnect from registry here, but
+ // to simulate a failure, we exit without cleaning up
+ // if the fini method is not called.
+}
+
+
+void
+ReconnectionCallback_i::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->id_is_valid_)
+ {
+ NotifyExt::ReconnectionRegistry_var registry =
+ NotifyExt::ReconnectionRegistry::_narrow (this->ecf_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ registry->unregister_callback (this->callback_id_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->id_is_valid_ = false;
+ }
+}
+
+void
+ReconnectionCallback_i::init (
+ PortableServer::POA_ptr poa,
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf
+ ACE_ENV_ARG_DECL)
+{
+ this->ecf_ = CosNotifyChannelAdmin::EventChannelFactory::_duplicate (ecf);
+ PortableServer::ObjectId_var reconnection_callback_id =
+ poa->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ poa->id_to_reference (reconnection_callback_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ NotifyExt::ReconnectionCallback_var callback =
+ NotifyExt::ReconnectionCallback::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ NotifyExt::ReconnectionRegistry_var registry =
+ NotifyExt::ReconnectionRegistry::_narrow (ecf ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->callback_id_ = registry->register_callback (callback.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->id_is_valid_ = true;
+}
+
+/////////////////
+// Consumer_Main
+
+Consumer_Main::Consumer_Main ()
+ : verbose_ (false)
+ , mode_ (MODE_ANY)
+ , expect_ (10)
+ , fail_ (0)
+ , use_naming_service_ (true)
+ , serial_number_ (0)
+ , disconnect_on_exit_ (false)
+ , structured_count_(0)
+ , sequence_count_(0)
+ , any_count_(0)
+ , id_file_ ("consumer.ids")
+ , ec_id_ (0)
+ , sa_id_ (0)
+ , structured_proxy_id_ (0)
+ , sequence_proxy_id_ (0)
+ , any_proxy_id_ (0)
+ , reconnection_callback_ (*this)
+ , reconnecting_ (false)
+{
+}
+
+Consumer_Main::~Consumer_Main ()
+{
+}
+
+int
+Consumer_Main::parse_args (int argc, char *argv[])
+{
+ int result = 0;
+ int narg = 1;
+ bool corba_arg = false;
+ while (narg < argc && result == 0)
+ {
+ int consumed = parse_single_arg (argc - narg, &argv[narg]);
+ if ( consumed > 0)
+ {
+ narg += consumed;
+ corba_arg = false;
+ }
+ else if (ACE_OS::strncmp (argv[narg], "-ORB", 4) == 0)
+ {
+ corba_arg = true;
+ }
+ else if (corba_arg)
+ {
+ // previous argument was a ORB arg.
+ // current argument is unrecognized
+ // assume the ORB eats this arg
+ narg += 1;
+ corba_arg = false;
+ }
+ else
+ {
+ ACE_OS::fprintf (stderr, ACE_TEXT ("Unrecognized argument: %s\n"),
+ argv[narg]);
+ usage (stderr);
+ result = -1;
+ }
+ }
+ return result;
+}
+
+int
+Consumer_Main::parse_single_arg (int argc, char *argv[])
+{
+ int consumed = 0;
+ if (ACE_OS::strcasecmp (argv[0], "-any") == 0)
+ {
+ this->mode_ = MODE_ANY;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-structured") == 0)
+ {
+ this->mode_ = MODE_STRUCTURED;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-sequence") == 0)
+ {
+ this->mode_ = MODE_SEQUENCE;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-v") == 0)
+ {
+ this->verbose_ = true;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-channel") == 0)
+ {
+ this->channel_file_= argv[1];
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-expect") == 0 && argc > 1)
+ {
+ this->expect_ = ACE_OS::atoi (argv[1]);
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-fail") == 0 && argc > 1)
+ {
+ this->fail_ = ACE_OS::atoi (argv[1]);
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-serial_number") == 0)
+ {
+ this->serial_number_= ACE_OS::atoi (argv[1]);
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-nonamesvc") == 0)
+ {
+ this->use_naming_service_ = false;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-disconnect") == 0)
+ {
+ this->disconnect_on_exit_ = true;
+ consumed = 1;
+ }
+ return consumed;
+}
+
+void Consumer_Main::usage(FILE * out)const
+{
+ ACE_OS::fputs (
+ ACE_TEXT ("usage\n")
+ ACE_TEXT (" -channel filename Where to find a channel number.\n")
+ ACE_TEXT (" -any or -structured or -sequence\n")
+ ACE_TEXT (" What type of event to send (pick one, default is -any)\n")
+ ACE_TEXT (" -expect n How many events of each type are expected.\n")
+ ACE_TEXT (" -fail n Throw an exception every n events.\n")
+ ACE_TEXT (" -serial_number n What serial number to start with \n")
+ ACE_TEXT (" or -1 to disable serial number checking.\n")
+ ACE_TEXT (" -v Verbose output.\n")
+ ACE_TEXT (" -disconnect Disconnect from channel on exit (prevents reconnect.) \n")
+ ACE_TEXT (" -nonamesvc Don't use the name service to find EventChannelFactory\n")
+ , out);
+}
+
+int Consumer_Main::init (int argc, char *argv[] ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init(argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (0 != this->parse_args(argc, argv))
+ {
+ return -1;
+ }
+
+ CORBA::Object_ptr poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"));
+ return -1;
+ }
+
+ this->root_poa_ =
+ PortableServer::POA::_narrow (poa_object ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->use_naming_service_ )
+ {
+ this->find_notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ int ok = resolve_notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (!ok)
+ {
+ return -1;
+ }
+ }
+
+ this->reconnecting_ = load_ids ();
+
+ init_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ init_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ switch (this->mode_)
+ {
+ case MODE_STRUCTURED:
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Consumer: Listening for %d structured events. Failing every %d events.\n"),
+ static_cast<int>(this->expect_),
+ static_cast<int>(this->fail_)
+ ));
+ }
+ this->structured_push_consumer_.set_expectations (this->expect_, this->fail_, this->serial_number_, this->verbose_);
+ init_structured_proxy_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ case MODE_SEQUENCE:
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Consumer: Listening for %d sequence events. Failing every %d events.\n"),
+ static_cast<int>(this->expect_),
+ static_cast<int>(this->fail_)
+ ));
+ }
+ this->sequence_push_consumer_.set_expectations (this->expect_, this->fail_, this->serial_number_, this->verbose_);
+ init_sequence_proxy_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ case MODE_ANY:
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Consumer: Listening for %d CORBA::Any events. Failing every %d events.\n"),
+ static_cast<int>(this->expect_),
+ static_cast<int>(this->fail_)
+ ));
+ }
+ this->any_push_consumer_.set_expectations (this->expect_, this->fail_, this->serial_number_, this->verbose_);
+ init_any_proxy_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ default:
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Consumer: Unknown listening mode.\n")
+ ));
+ break;
+ }
+ }
+
+ this->reconnection_callback_.init (
+ this->root_poa_.in (),
+ this->ecf_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ save_ids ();
+ return 0;
+}
+void
+Consumer_Main::save_ids()
+{
+ FILE *idf =
+ ACE_OS::fopen (this->id_file_.c_str (), "w");
+
+ if (idf != 0)
+ {
+ int endflag = 12345;
+ int imode = static_cast<int>(this->mode_);
+ ACE_OS::fprintf (idf,
+ "%d,%d,%d,%d,%d,%d,%d,\n",
+ static_cast<int> (imode),
+ static_cast<int> (ec_id_),
+ static_cast<int> (sa_id_),
+ static_cast<int> (structured_proxy_id_),
+ static_cast<int> (sequence_proxy_id_),
+ static_cast<int> (any_proxy_id_),
+ static_cast<int> (endflag) );
+ ACE_OS::fclose (idf);
+ }
+}
+
+bool
+Consumer_Main::load_ids()
+{
+ bool ok = false;
+ FILE *idf =
+ ACE_OS::fopen (this->id_file_.c_str (), "r");
+
+ if (idf != 0)
+ {
+ int field = 0;
+
+ char buffer[100] = ""; // because ACE fgets doesn't put a null if the file is empty
+ ACE_OS::fgets (buffer, sizeof(buffer), idf);
+ ACE_OS::fclose (idf);
+ char * pb = buffer;
+ while (!ok && *pb != 0)
+ {
+ char * eb = ACE_OS::strchr (pb, ',');
+ char * nb = eb + 1;
+ if (eb == 0)
+ {
+ eb = pb + ACE_OS::strlen (pb);
+ nb = eb;
+ }
+ *eb = 0;
+ if (pb < eb)
+ {
+ int value = ACE_OS::atoi(pb);
+ switch (++field)
+ {
+ case 1:
+ this->mode_ = static_cast<Mode_T> (value);
+ break;
+ case 2:
+ this->ec_id_ = value;
+ break;
+ case 3:
+ this->sa_id_ = value;
+ break;
+ case 4:
+ this->structured_proxy_id_ = value;
+ break;
+ case 5:
+ this->sequence_proxy_id_ = value;
+ break;
+ case 6:
+ this->any_proxy_id_ = value;
+ break;
+ case 7:
+ ok = value == 12345;
+ break;
+ default:
+ ACE_OS::fprintf (stderr, ACE_TEXT ("Consumer: Warning: too many fields in saved id file.\n"));
+ ok = false;
+ break;
+ }
+ }
+ pb = nb;
+ }
+ }
+ return ok;
+}
+
+void
+Consumer_Main::reconnect (
+ CosNotifyChannelAdmin::EventChannelFactory_ptr dest_factory
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer begin ReconnectRegistry based reconnection\n")
+ ));
+ }
+ this->ecf_ = CosNotifyChannelAdmin::EventChannelFactory::_duplicate (dest_factory);
+ this->reconnecting_ = true;
+ init_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ init_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ switch (this->mode_)
+ {
+ case MODE_STRUCTURED:
+ {
+ init_structured_proxy_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+
+ case MODE_SEQUENCE:
+ {
+ init_sequence_proxy_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+
+ case MODE_ANY :
+ {
+ init_any_proxy_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+ }
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer ReconnectRegistry based reconnection complete\n")
+ ));
+ }
+}
+
+
+int
+Consumer_Main::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // ignore redundant calls
+ if (CORBA::is_nil (this->naming_context_.in ()))
+ {
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+
+ return !CORBA::is_nil (this->naming_context_.in ());
+}
+
+int
+Consumer_Main::find_notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int status = this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (status)
+ {
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (NOTIFY_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ this->ecf_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN(0);
+ }
+ return ! CORBA::is_nil (this->ecf_.in ());
+}
+
+int
+Consumer_Main::resolve_notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var factory_obj =
+ this->orb_->resolve_initial_references (NOTIFY_FACTORY_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ this->ecf_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ factory_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ return ! CORBA::is_nil (this->ecf_.in ());
+}
+
+void
+Consumer_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ this->ec_ = this->ecf_->get_event_channel (
+ this->ec_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (this->ec_.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Reconnect to event channel %d\n"),
+ static_cast<int>(this->ec_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ // if we don't have a channel yet, and a channel id file was specified
+ // try to read from it
+ if (!ok && this->channel_file_.length () > 0)
+ {
+ FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "r");
+ if (chf != 0)
+ {
+ char buffer[100];
+ ACE_OS::fgets (buffer, sizeof(buffer), chf);
+ ACE_OS::fclose (chf);
+ this->ec_id_ = ACE_OS::atoi (buffer);
+
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY_EX (unique_label_1)
+ {
+ this->ec_ = this->ecf_->get_event_channel (
+ this->ec_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (unique_label_1)
+ ok = ! CORBA::is_nil (this->ec_.in ());
+ if (ok)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Connect to Existing event channel %d\n"),
+ static_cast<int>(this->ec_id_)
+ ));
+ }
+ // kill the channel filename so we don't overwrite the file
+ this->channel_file_ = "";
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+ }
+
+ if (!ok)
+ {
+ CosNotification::QoSProperties qosprops (7);
+ qosprops.length (7);
+ CORBA::ULong i = 0;
+#ifdef DISABLE_PROPERTIES_TODO
+ qosprops[i].name = CORBA::string_dup(CosNotification::EventReliability);
+ qosprops[i++].value <<= CosNotification::Persistent;
+ qosprops[i].name = CORBA::string_dup(CosNotification::ConnectionReliability);
+ qosprops[i++].value <<= CosNotification::Persistent; // Required, or we won't persist much
+ qosprops[i].name = CORBA::string_dup(CosNotification::Priority);
+ qosprops[i++].value <<= CosNotification::HighestPriority;
+ qosprops[i].name = CORBA::string_dup(CosNotification::Timeout);
+ qosprops[i++].value <<= (TimeBase::TimeT) 42 * 10000; // 42ms
+ qosprops[i].name = CORBA::string_dup(CosNotification::StopTimeSupported);
+ qosprops[i++].value <<= CORBA::Any::from_boolean(1);
+ qosprops[i].name = CORBA::string_dup(CosNotification::MaximumBatchSize);
+ qosprops[i++].value <<= (CORBA::Long)2;
+ qosprops[i].name = CORBA::string_dup(CosNotification::PacingInterval);
+ qosprops[i++].value <<= (TimeBase::TimeT) 50 * 10000; // 50ms
+#endif
+ qosprops.length (i);
+ CosNotification::AdminProperties adminprops(4);
+ adminprops.length (4);
+ i = 0;
+#ifdef DISABLE_PROPERTIES_TODO
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxQueueLength);
+ adminprops[i++].value <<= (CORBA::Long) 1234;
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxSuppliers);
+ adminprops[i++].value <<= (CORBA::Long) 1000;
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxConsumers);
+ adminprops[i++].value <<= (CORBA::Long) 1000;
+ adminprops[i].name = CORBA::string_dup(CosNotification::RejectNewEvents);
+ adminprops[i++].value <<= CORBA::Any::from_boolean(1);
+#endif
+ adminprops.length(i);
+
+ ec_ = this->ecf_->create_channel (
+ qosprops,
+ adminprops,
+ this->ec_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (ec_.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Create event channel %d\n"),
+ static_cast<int> (this->ec_id_)
+ ));
+ }
+ }
+
+ // save channel id
+ if (ok && this->channel_file_.length() > 0)
+ {
+ FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "w");
+ if (chf != 0)
+ {
+ ACE_OS::fprintf (chf, "%d\n", static_cast<int> (this->ec_id_));
+ fclose (chf);
+ }
+ }
+}
+
+CosNotifyChannelAdmin::AdminID default_admin_id = static_cast<CosNotifyChannelAdmin::AdminID>(-1);
+
+void
+Consumer_Main::init_consumer_admin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ if (this->reconnecting_)
+ {
+ if (this->sa_id_ == default_admin_id)
+ {
+ ACE_TRY_EX(TWO)
+ {
+ this->sa_ = this->ec_->default_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(TWO);
+ ok = ! CORBA::is_nil (this->sa_.in ());
+ this->sa_id_ = default_admin_id;
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Using default consumer admin\n")
+ ));
+ }
+ else if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: No default consumer admin\n")
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+ else // not default admin
+ {
+ ACE_TRY_EX(ONE)
+ {
+ this->sa_ = this->ec_->get_consumeradmin(
+ this->sa_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(ONE);
+ ok = ! CORBA::is_nil (this->sa_.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Reconnect to consumer admin %d\n"),
+ static_cast<int>(this->sa_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+ }
+ else // !reconnecting
+ {
+ ACE_TRY_EX(THREE)
+ {
+ this->sa_ = this->ec_->default_consumer_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(THREE);
+ ok = ! CORBA::is_nil (this->sa_.in ());
+ this->sa_id_ = default_admin_id;
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Using default consumer admin\n")
+ ));
+ }
+ else if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: No default consumer admin\n")
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+
+ if (!ok)
+ {
+ this->sa_ = this->ec_->new_for_consumers(
+ CosNotifyChannelAdmin::OR_OP,
+ this->sa_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (this->sa_.in ());
+
+#ifdef TEST_SET_QOS
+ // temporary: be sure we can set qos properties here
+ if (ok)
+ {
+ CosNotification::QoSProperties qosprops(2);
+ CORBA::ULong i = 0;
+ qosprops.length(2);
+
+ qosprops[i].name = CORBA::string_dup(CosNotification::EventReliability);
+ qosprops[i++].value <<= CosNotification::Persistent;
+ qosprops[i].name = CORBA::string_dup(CosNotification::ConnectionReliability);
+ qosprops[i++].value <<= CosNotification::Persistent; // Required, or we won't persist much
+ qosprops.length(i);
+ this->sa_->set_qos (qosprops ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+#endif
+
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Create new consumer admin %d\n"),
+ static_cast<int>(this->sa_id_)
+ ));
+ }
+ }
+ }
+ if (!ok)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: connect to consumer admin failed %d\n"),
+ static_cast<int>(this->sa_id_)
+ ));
+ }
+}
+void
+Consumer_Main::init_structured_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ CosNotifyChannelAdmin::ProxySupplier_var proxy;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ proxy = this->sa_->get_proxy_supplier (
+ this->structured_proxy_id_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Reconnect to proxy supplier %d\n"),
+ static_cast<int>(this->structured_proxy_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ proxy = this->sa_->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ this->structured_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Create new structured proxy %d\n"),
+ static_cast<int>(this->structured_proxy_id_)
+ ));
+ }
+ }
+ this->structured_proxy_push_supplier_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow(proxy.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->structured_proxy_push_supplier_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) init_structured_proxy_supplier received nil ProxySupplier\n")
+ ));
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+ }
+
+ if (CORBA::is_nil (this->structured_push_consumer_ref_.in ()))
+ {
+ PortableServer::ObjectId_var push_consumer_id =
+ this->root_poa_->activate_object (
+ &(this->structured_push_consumer_) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ this->root_poa_->id_to_reference (push_consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->structured_push_consumer_ref_ =
+ CosNotifyComm::StructuredPushConsumer::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (CORBA::is_nil (this->structured_push_consumer_ref_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Consumer: Error activating structured push consumer\n")
+ ));
+
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+
+ this->structured_proxy_push_supplier_->connect_structured_push_consumer (
+ this->structured_push_consumer_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->structured_push_consumer_.set_connected(true);
+}
+
+void
+Consumer_Main::init_sequence_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ CosNotifyChannelAdmin::ProxySupplier_var proxy;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ proxy = this->sa_->get_proxy_supplier(
+ this->sequence_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Reconnect to proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ proxy = this->sa_->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ this->sequence_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+#ifdef TEST_SET_QOS
+ // temporary
+ if (ok)
+ {
+ set_proxy_qos (proxy.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+#endif // TEST_SET_QOS
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Create new sequence proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+ }
+ }
+ this->sequence_proxy_push_supplier_ =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow(proxy.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->sequence_proxy_push_supplier_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Consumer: Received wrong type of push supplier proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+
+ if (CORBA::is_nil (this->sequence_push_consumer_ref_.in ()))
+ {
+ PortableServer::ObjectId_var push_consumer_id =
+ this->root_poa_->activate_object (
+ &(this->sequence_push_consumer_) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ this->root_poa_->id_to_reference (push_consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->sequence_push_consumer_ref_ =
+ CosNotifyComm::SequencePushConsumer::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (CORBA::is_nil (this->sequence_push_consumer_ref_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Consumer: Error activating sequence push consumer\n")
+ ));
+
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+
+ this->sequence_proxy_push_supplier_->connect_sequence_push_consumer (
+ this->sequence_push_consumer_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->sequence_push_consumer_.set_connected(true);
+
+}
+
+
+void
+Consumer_Main::set_proxy_qos (CosNotifyChannelAdmin::ProxySupplier_ptr proxy
+ ACE_ENV_ARG_DECL)
+{
+ // temporary: be sure we can set qos properties for proxyw
+ CosNotification::QoSProperties qosprops(2);
+ CORBA::ULong i = 0;
+ qosprops.length(2);
+
+ qosprops[i].name = CORBA::string_dup(CosNotification::EventReliability);
+ qosprops[i++].value <<= CosNotification::Persistent;
+ qosprops[i].name = CORBA::string_dup(CosNotification::ConnectionReliability);
+ qosprops[i++].value <<= CosNotification::Persistent; // Required, or we won't persist much
+ qosprops.length(i);
+ proxy->set_qos (qosprops ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Consumer_Main::init_any_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ CosNotifyChannelAdmin::ProxySupplier_var proxy;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ proxy = this->sa_->get_proxy_supplier(
+ this->any_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Reconnect to proxy %d\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Get proxy supplier %d returned nil\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Consumer: Get proxy supplier %d threw exception\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, ACE_TEXT ("Error:"));
+ }
+ ACE_CATCHALL
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Error: (%P|%t) Consumer: Get proxy supplier %d threw exception\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ proxy = this->sa_->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::ANY_EVENT,
+ this->any_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Consumer: Create new Any proxy %d\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ }
+ }
+ this->any_proxy_push_supplier_ =
+ CosNotifyChannelAdmin::ProxyPushSupplier::_narrow(proxy.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->any_proxy_push_supplier_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Consumer: Received wrong type of push supplier proxy %d\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+ if (CORBA::is_nil (this->any_push_consumer_ref_.in ()))
+ {
+ PortableServer::ObjectId_var push_consumer_id =
+ this->root_poa_->activate_object (
+ &(this->any_push_consumer_) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ this->root_poa_->id_to_reference (push_consumer_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->any_push_consumer_ref_ =
+ CosNotifyComm::PushConsumer::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ if (CORBA::is_nil (this->any_push_consumer_ref_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Consumer:Error activating push consumer\n")
+ ));
+
+ ACE_THROW (CORBA::BAD_PARAM());
+ }
+ this->any_proxy_push_supplier_->connect_any_push_consumer (
+ this->any_push_consumer_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->any_push_consumer_.set_connected(true);
+}
+
+int Consumer_Main::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ this->reconnection_callback_.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+
+ if (this->disconnect_on_exit_)
+ {
+ if (!CORBA::is_nil (this->structured_proxy_push_supplier_.in ()))
+ {
+ this->structured_proxy_push_supplier_->disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+ }
+ if (!CORBA::is_nil (this->sequence_proxy_push_supplier_.in ()))
+ {
+ this->sequence_proxy_push_supplier_->disconnect_sequence_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+ }
+ if (!CORBA::is_nil (this->any_proxy_push_supplier_.in ()))
+ {
+ this->any_proxy_push_supplier_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+ }
+ if (!CORBA::is_nil (this->sa_.in ()) && this->sa_id_ != default_admin_id)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) destroy admin %d\n"),
+ static_cast<int>(this->sa_id_)
+ ));
+ }
+ this->sa_->destroy();
+ }
+ }
+ this->orb_->shutdown ();
+ return 0;
+}
+
+
+int Consumer_Main::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = 0;
+
+ while (this->structured_push_consumer_.received () < this->expect_
+ && this->sequence_push_consumer_.received () < this->expect_
+ && this->any_push_consumer_.received () < this->expect_
+ )
+ {
+ ACE_Time_Value tv(0, 100 * 1000);
+ this->orb_->run(tv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ }
+
+ // see if consumers detected errors
+ if (this->structured_push_consumer_.has_problem ()
+ || this->sequence_push_consumer_.has_problem ()
+ || this->any_push_consumer_.has_problem ())
+ {
+ result = -3;
+ }
+ return result;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = -1;
+ Consumer_Main app;
+ ACE_TRY_NEW_ENV
+ {
+ result = app.init(argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ if (result == 0)
+ {
+ result = app.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ if (result == 0)
+ {
+ app.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: Consumer::main\t\n");
+ result = -1;
+ }
+ ACE_ENDTRY;
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Consumer exits: code %d\n"),
+ result
+ ));
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h
new file mode 100644
index 00000000000..b6326ac31d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Consumer.h
@@ -0,0 +1,295 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Consumer.h
+//
+// = DESCRIPTION
+// Test Consumer reconnect to existing channel/admin/proxy Notification Service
+//
+// = AUTHOR
+// Dale Wilson <wilson_d@ociweb.com>
+//
+// ==========================================================================
+
+#ifndef RECONNECTNG_CONSUMER_H
+#define RECONNECTNG_CONSUMER_H
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/NotifyExtS.h"
+#include "ace/SString.h"
+
+class Consumer_Main;
+
+class StructuredPushConsumer_i : public virtual POA_CosNotifyComm::StructuredPushConsumer
+{
+public:
+ StructuredPushConsumer_i ();
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+
+ virtual void disconnect_structured_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ size_t received () const;
+ void set_expectations (size_t expecte, size_t fail, size_t serial_number, bool verbose);
+ bool has_problem () const;
+ void set_connected (bool flag);
+ bool is_connected () const;
+
+private:
+ void check_serial_number (CORBA::ULong seq);
+
+private:
+ bool verbose_;
+ size_t received_;
+ size_t expect_;
+ size_t fail_;
+ size_t may_discard_;
+ size_t serial_number_;
+ size_t exceptions_thrown_;
+ bool problem_;
+ bool connected_;
+};
+
+class SequencePushConsumer_i : public virtual POA_CosNotifyComm::SequencePushConsumer
+{
+public:
+ SequencePushConsumer_i ();
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ virtual void push_structured_events (
+ const CosNotification::EventBatch & notifications
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+
+ virtual void disconnect_sequence_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ size_t received () const;
+ void set_expectations (size_t expecte, size_t fail, size_t serial_number, bool verbose);
+ bool has_problem () const;
+ void set_connected (bool flag);
+ bool is_connected () const;
+
+private:
+ void check_serial_number (CORBA::ULong seq);
+
+private:
+ bool verbose_;
+ size_t received_;
+ size_t expect_;
+ size_t fail_;
+ size_t may_discard_;
+ size_t serial_number_;
+ size_t exceptions_thrown_;
+ bool problem_;
+ bool connected_;
+};
+
+class AnyPushConsumer_i : public virtual POA_CosNotifyComm::PushConsumer
+{
+public:
+ AnyPushConsumer_i ();
+
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ virtual void push (
+ const CORBA::Any & data
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+
+ virtual void disconnect_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ size_t received () const;
+ void set_expectations (size_t expecte, size_t fail, size_t serial_number, bool verbose);
+ bool has_problem () const;
+ void set_connected (bool flag);
+ bool is_connected () const;
+
+private:
+ void check_serial_number (CORBA::ULong seq);
+
+private:
+ bool verbose_;
+ size_t received_;
+ size_t expect_;
+ size_t fail_;
+ size_t may_discard_;
+ size_t serial_number_;
+ size_t exceptions_thrown_;
+ bool problem_;
+ bool connected_;
+};
+
+class ReconnectionCallback_i : public virtual POA_NotifyExt::ReconnectionCallback
+{
+public:
+ ReconnectionCallback_i (Consumer_Main & consumer_main);
+
+ virtual ~ReconnectionCallback_i ();
+
+ void init (
+ PortableServer::POA_ptr poa,
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf_
+ ACE_ENV_ARG_DECL);
+
+ void fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ size_t reconnect_count () const;
+
+ virtual void reconnect (
+ CORBA::Object_ptr reconnection
+ ACE_ENV_ARG_DECL
+ ) ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ Consumer_Main & consumer_main_;
+ bool id_is_valid_;
+ NotifyExt::ReconnectionRegistry::ReconnectionID callback_id_;
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf_;
+ size_t reconnect_count_;
+};
+
+class Consumer_Main
+{
+ public:
+ Consumer_Main ();
+ ~Consumer_Main ();
+
+ int parse_args (int argc, char *argv[]);
+ int parse_single_arg (int argc, char *argv[]);
+
+ int init (int argc, char *argv[] ACE_ENV_ARG_DECL);
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+ void usage (FILE * log) const;
+
+ void reconnect (
+ CosNotifyChannelAdmin::EventChannelFactory_ptr dest_factory
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ /// Find naming service.
+ int resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Resolve the Notify factory from the Naming service.
+ int find_notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Resolve the Notify factory using resolve_initial_reference ("NotifyEventChannelFactory")
+ int resolve_notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ void init_event_channel (ACE_ENV_SINGLE_ARG_DECL);
+ void init_consumer_admin (ACE_ENV_SINGLE_ARG_DECL);
+ void init_structured_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL);
+ void init_sequence_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL);
+ void init_any_proxy_supplier (ACE_ENV_SINGLE_ARG_DECL);
+
+ void set_proxy_qos (CosNotifyChannelAdmin::ProxySupplier_ptr proxy ACE_ENV_ARG_DECL);
+
+ void save_ids();
+ bool load_ids();
+
+ ////////////////////
+ // forbidden methods
+ private:
+ Consumer_Main (const Consumer_Main & rhs);
+ Consumer_Main & operator = (const Consumer_Main & rhs);
+
+ ////////////////
+ // Data members
+ private:
+
+ // set by command line parameters
+ bool verbose_; // -v make a glorious noise
+ enum Mode_T{
+ MODE_ANY,
+ MODE_STRUCTURED,
+ MODE_SEQUENCE} mode_; // -any, -structured, or -sequence
+ ACE_CString channel_file_; // -channel fileneame
+ size_t expect_; // -expect n
+ size_t fail_; // -fail n
+ bool use_naming_service_; // -nonamesvc
+ size_t serial_number_; // -serial_number
+ bool disconnect_on_exit_; // -disconnect
+ size_t structured_count_;
+ size_t sequence_count_;
+ size_t any_count_;
+
+ ACE_CString id_file_; // -ids
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+ CosNaming::NamingContext_var naming_context_;
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf_;
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ CosNotifyChannelAdmin::ChannelID ec_id_;
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var sa_;
+ CosNotifyChannelAdmin::AdminID sa_id_;
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var structured_proxy_push_supplier_;
+ CosNotifyChannelAdmin::ProxyID structured_proxy_id_;
+ StructuredPushConsumer_i structured_push_consumer_;
+ CosNotifyComm::StructuredPushConsumer_var structured_push_consumer_ref_;
+
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier_var sequence_proxy_push_supplier_;
+ CosNotifyChannelAdmin::ProxyID sequence_proxy_id_;
+ SequencePushConsumer_i sequence_push_consumer_;
+ CosNotifyComm::SequencePushConsumer_var sequence_push_consumer_ref_;
+
+ CosNotifyChannelAdmin::ProxyPushSupplier_var any_proxy_push_supplier_;
+ CosNotifyChannelAdmin::ProxyID any_proxy_id_;
+ AnyPushConsumer_i any_push_consumer_;
+ CosNotifyComm::PushConsumer_var any_push_consumer_ref_;
+
+ ReconnectionCallback_i reconnection_callback_;
+
+ bool reconnecting_;
+};
+
+#endif /* RECONNECTNG_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Makefile.am b/TAO/orbsvcs/tests/Notify/Reconnecting/Makefile.am
new file mode 100644
index 00000000000..40c52148050
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Makefile.am
@@ -0,0 +1,118 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Reconnecting_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Consumer
+
+Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Consumer_SOURCES = \
+ Consumer.cpp \
+ Consumer.h
+
+Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Reconnecting_Supplier.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Supplier
+
+Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Supplier_SOURCES = \
+ Supplier.cpp \
+ Supplier.h
+
+Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/README b/TAO/orbsvcs/tests/Notify/Reconnecting/README
new file mode 100644
index 00000000000..723c0a4f730
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/README
@@ -0,0 +1,351 @@
+$Id$
+
+README for the Notification Service Reconnection Test
+-----------------------------------------------------
+
+Implementation notes
+--------------------
+
+Notification Service Supplier/Consumer reconnection test.
+
+This directory contains:
+
+ Supplier.cpp -- source for a configurable event supplier
+ Supplier.h
+ Consumer.cpp -- source for a configurable consumer for events produced
+ Consumer.h by a Supplier
+ run_ns.pl -- a script to start the Notification Service manually
+ run_supplier.pl -- a script to start Supplier manually
+ run_consumer.pl -- a script to start Consumer manually
+ run_test.pl -- a script to run several tests of the Reliable
+ Notification Service
+ ns_st.conf -- configures the Notification Service for single
+ thread operation with no persistence support.
+ ns_mt.conf -- configures the Notification Service for multi-
+ threaded operation with no persistence support.
+ ns_st_topo.conf -- configures the Notification Service for single
+ thread operation with support for topological,
+ but not event persistence.
+ ns_mt_topo.conf -- configures the Notification Service for multi-
+ threaded operation with support for topological,
+ but not event persistence.
+ ns_st_both.conf -- configures the Notification Service for single
+ thread operation with support for both topological,
+ and event persistence.
+ ns_mt_both.conf -- configures the Notification Service for multi-
+ threaded operation with support for both topological,
+ and event persistence.
+ event.conf -- configures the Notification Service for event
+ persistence without topology persistence. This is
+ an invalid configuration and should cause the
+ Notification Service to refuse to start.
+ Reconnecting.mpc -- a configuration/build file for MPC
+ README -- this file
+
+Supplier
+--------
+This program connects to the Notification Service and generates events based
+on command line parameters.
+
+ -nonamesvc Don't use the Naming Service to find
+ EventChannelFactory
+ -channel filename Where to find a channel number
+ -any or -str or -seq What type of event to send (pick one, default is -any)
+ -send n How many events to send
+ -pause n Pause after sending n events
+ Signal the pause by writing to file "Supplier.paused"
+ -serial_number n What serial number to start with
+ -v Verbose output
+
+Because the Supplier and Consumer share many command line options, the
+descriptions of these options will be combined below.
+
+Consumer
+--------
+This program connects to the Notification Service and consumes events from
+the Supplier.
+
+ -nonamesvc Don't use the Naming Service to find
+ EventChannelFactory
+ -channel filename Where to store a channel number so the Supplier can
+ find it
+ -any or -str or -seq What type of event supplier will send (pick one,
+ default: -any)
+ -expect n How many events are expected.
+ -fail n Simulate a recoverable failure every n events.
+ -serial_number n What serial number to expect first. If -1 is
+ used, then serial number checking is disabled.
+ This allows testing the consumer with multiple
+ Suppliers.
+ -disconnect Disconnect from notfication service cleanly
+ (no reconnect will be possible)
+ -v Verbose output.
+
+Command line option: -nonamesvc
+-------------------------------
+There are several techniques that Notification Service clients (Suppliers
+and Consumers) may use to find and connect to the Notification Service.
+One common technique is for the Notification Service to register an Event
+Channel Factory with the Naming Service using a well-known name (specified in
+the CORBA standard.)
+
+Although this technique is a good one for use in a system that already depends
+on the Naming Service, the test scripts in this directory do not depend on the
+Naming Service. When this option is specified, the Supplier and Consumer use
+"resolve_initial_references ()" to find the Notification Service.
+
+When this option is used, the ORB option -ORBInitRef must also be used to
+define an initial reference to the Notification Service.
+
+Command line option: -channel filename
+--------------------------------------
+The Notification Service has the ability to support several channels
+simultaneously. For these tests to work, the Supplier and Consumer must
+use the same channel. There are several techniques the Consumer(s) and
+Supplier(s) can use to select which channel to use. These programs use a
+shared file to communicate the channel number from the Consumer that creates
+the channel to the Supplier that uses it.
+
+When the Consumer starts up but is not reconnecting to an existing service,
+it creates a new channel and writes the channel ID to the file specified by
+this command (if no -channel option is given, the channel ID is not written.)
+
+When the Supplier starts up, but is not reconnecting to an existing service,
+it attempts to read the channel ID from the file specified by this option.
+If it is successful it uses that channel ID to send events.
+
+Command line options: -any or -str or -seq
+------------------------------------------
+The Notification Service supports three types of Events. Any events are
+like those used by the Event Service (an ancestor to the Notification
+Service). Structured events and Sequence events are events supported only
+by the Notification Service. See the TAO Developer's Guide or the CORBA
+specification for more details.
+
+Only one of these three options should be specified. If none of these
+is specified, the default is "-any".
+
+Command line option: -send n
+----------------------------
+This Supplier-only option tells the Supplier how many events to send.
+After it has sent that many events, the Supplier will shut down.
+
+Command line option: -expect n
+------------------------------
+This Consumer-only option tells the Consumer how many events to expect.
+After it has received that many events, the Consumer will shut down.
+
+Command line option: -fail n
+------------------------------
+This Consumer-only option tells the Consumer to throw an exception
+(CORBA::UNKNOWN) every n events. This simulates a recoverable error in
+the consumer. After throwing the exception, the consumer continues
+to listen for incoming events. It expects the event it was processing
+to be retransmitted.
+
+Because of the retransmission, the use of the -fail option may be
+counterintuitive. If the consumer options are "-expect 10 -fail 4" then
+it will receive events 0, 1, 2, and fail on event 3. It will then
+receive 3, 4, 5, and fail on event 6. Then it will receive 6, 7, 8,
+and fail on event 9. Finally it will receive the retransmission of event
+9 and exit.
+
+Command line option: -pause n
+-----------------------------
+This Supplier-only option is used during testing. The Supplier will send
+the specified number of events then wait for the Notification Service to
+stop and restart before sending the remaining events.
+
+To signal test scripts that a pause has happened, the Supplier will create
+a file named "Supplier.pause" This file can be used to synchronize a
+script with a running Supplier. It has no other purpose.
+
+Obviously the -pause option should specify a smaller number than the -send
+option. If this option is not used, no pause will occur.
+
+Command line option: -serial_number n
+-------------------------------------
+Each event sent by the the Supplier has a sequential serial number. As the
+Consumer receives events, it checks to see that the events arrived in serial
+number order. Missing or duplicated events will be detected by the Consumer.
+
+This option tells the Supplier what serial number to use for the first event
+it sends, and the Consumer what serial number to expect in the first event
+it receives.
+
+For the Consumer only, a value of -1 disables checking of incoming serial
+numbers. This should be used when the Consumer is receiving events from
+multiple suppliers.
+
+Command line option: -v
+-----------------------
+This option enables verbose messages. The Supplier and Consumer are
+relatively silent during normal operation -- displaying messages only when
+something goes wrong. If this verbose option is specified, more detailed
+progress messages will be displayed.
+
+Reconnection
+------------
+Reconnection to the Notification Service is based on ID numbers assigned to
+the objects within the Notification Service (objects like Channels, Admins,
+and Proxies). After initially starting up, the supplier writes the IDs it
+needs to preserve to a file named Supplier.ids. The Consumer writes its
+IDs to Consumer.ids.
+
+When a client (Supplier or Consumer) starts up, it looks for its corresponding
+".ids" file. If the file is found, the client attempts to reconnect to an
+existing Notification Service using these IDs. If the file is not found, or
+the reconnection fails, the client falls back on its normal startup procedure.
+
+In addition, a running client can receive a request for reconnection from
+the Notification Service. When it does so, it uses the saved ID numbers to
+complete the reconnection process.
+
+Programming Style
+-----------------
+The Supplier and Consumer source files were designed to be complete,
+stand-alone applications. Other than their basic dependency on ACE, TAO,
+and CORBA, they avoid using outside facilities. For example, there is a
+Notification Tests library used by many Notification Service tests that
+encapsulates connections to the Notification Service and typical CORBA
+application issues. Because these programs were intended to illustrate
+everything necessary for a client application to work with a reliable
+Notification Service, this library is not used.
+
+Obviously a real-world application should take advantage of such helper
+classes to allow the developer to concentrate on the domain problem for
+which the application is written.
+
+Also these programs use ACE-style platform independence techniques.
+Applications that do not need to support the wide variety of platforms
+supported by ACE and TAO can relax some of these coding techniques.
+
+run_test.pl
+-----------
+The run_test.pl script runs tests of different cases in which
+reliable topology is needed. The following command line options can
+be given to the test script:
+
+run_test.pl: command line options -any, -str, or -seq
+-----------------------------------------------------
+Specify one of these options to determine what type of event will be used
+during the test. The default if none of these options is present is "-any".
+
+run_test.pl: command line option -v
+--------------------------------------------
+This option controls the verbosity of the test script and the Supplier and
+Consumer applications. When it is present, a detailed step-by-step
+report is produced by the test.
+
+run_test.pl: Test #1: Supplier reconnection.
+--------------------------------------------
+All persistent information is discarded before the test starts. The test
+script starts the Notification Service, a Consumer and a Supplier.
+
+The Consumer is configured to receive 20 events. The Supplier is configured
+to send ten events.
+
+After sending ten events, the Supplier exits -- simulating a Supplier failure.
+The test script starts a new copy of the Supplier. The new Supplier is
+configured to send ten events starting with event number 10.
+It uses information saved by the previous supplier to reconnect to the same
+channel, admin, and proxy in the Notification Services.
+The Suppler sends the remaining ten events then exists. The Consumer having
+received the 20 events it expects, exits as well and the test is complete.
+
+This demonstrates that a Supplier can stop then restart and its events will e
+delivered to the correct Consumer.
+
+run_test.pl: Test #2: Consumer reconnection.
+--------------------------------------------
+The Notification Service from the previous test is still running and the
+saved reconnection information for both the Supplier and Consumer is still
+available.
+
+The test script starts a Consumer configured to receive 20 events and a
+Supplier configured to send twenty events. Both clients use the reconnection
+information from the previous test to reconnect to the Notification Service.
+
+Twenty events are sent successfully, then both clients exit and the test
+is complete.
+
+This demonstrates that a Consumer can stop then restart and reconnect. It
+will continue to receive the events on the channel to which it was originally
+connected.
+
+run_test.pl: Test #3: Saving and Restoring Topology
+---------------------------------------------------
+The test script stops the Notification Server from the previous two tests and
+starts a new Notification Server. It reloads the topology from the XML topology
+persistence files saved during the first two tests.
+
+The test script starts a Consumer and a Supplier. They are configured to
+receive and send respectively twenty events. The clients use the reconnection
+information from the previous tests to connect to the event channel, admins,
+and proxies that were reloaded from persistent topology information.
+The Supplier sends and the Consumer receives 20 events. Both clients exit.
+
+This demonstrates that the Notification Server can save its topology, then
+reload it, and the resulting topology behaves correctly when clients reconnect.
+
+run_test.pl: Test #4: The Reconnection Registry
+-----------------------------------------------
+This test starts with the Notification Service from the previous test.
+
+The script starts a new Consumer that expects to receive 20 events. The
+Consumer reconnects to the Notification Server.
+The script starts a Supplier. It is configured to send 10 events then
+pause waiting for a Notification Service initiated reconnection before
+sending the remaining 10 events.
+
+Both clients register with the Reconnection Registry to receive reconnection
+callbacks.
+
+The test script waits for the Supplier to pause. It then kills the
+Notification Service and starts a new copy. The new Notification Service
+is not configured to listen at the same endpoint as the previous one did,
+so the clients have no way to find the new copy directly. They must rely
+on the callback received from the Reconnection Registry.
+
+The new Notification Service reloads its topology, including the Reconnection
+Registry entries from the XML file. It sends reconnection callbacks to the
+registered clients.
+
+Using their saved reconnection information, the clients complete the
+reconnection to the new Notification Service.
+
+The Supplier sends the remaining 10 events then terminates. The Consumer,
+having received its expected 10 events also terminates.
+
+This demonstrates the reconnection registry and reconnection to live clients.
+
+run_test.pl: Test #5: Consumer Recoverable Exception
+----------------------------------------------------
+Using the Notification Service still running from the previous test,
+but discarding reconnection information, a new Consumer is started.
+It is configured to expect 10 events, but to throw an exception after
+receiving the sixth event. After throwing the exception it expects to see
+the sixth event retransmitted, then to receive the remaining four events.
+A Supplier is started that sends 10 events, and then exits.
+When the Consumer has received the events it expects, including the
+retransmission of the sixth event, it shuts down.
+
+This demonstrates the Notification Service can recover from transient
+communication or Consumer failures.
+
+Known Problems as of Feb 2004.
+------------------------------
+Sequence events are not working. It is unclear whether this is a problem in
+the test or in the Notification Service itself.
+
+Known Problems as of Mar 2004.
+------------------------------
+The problem with sequence events reported previously turned out to be problems
+in both the test and in the Notification Service itself. These problems
+have been resolved. It is now possible to mix and match consumers and
+suppliers.
+
+There are no new known problems.
+
+[----------------------------------------------------------------------------]
+
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Reconnecting.mpc b/TAO/orbsvcs/tests/Notify/Reconnecting/Reconnecting.mpc
new file mode 100644
index 00000000000..f04e76917c9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Reconnecting.mpc
@@ -0,0 +1,14 @@
+// $Id$
+
+project(*Supplier): notifytest {
+ Source_Files {
+ Supplier.cpp
+ }
+}
+
+project(*Consumer): notifytest {
+ Source_Files {
+ Consumer.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp
new file mode 100644
index 00000000000..1bd46703440
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.cpp
@@ -0,0 +1,1376 @@
+//$Id$
+
+#include "Supplier.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "tao/debug.h"
+#include "tao/PortableServer/PortableServerC.h"
+#include "tao/TimeBaseC.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_strings.h"
+
+ACE_RCSID (Notify_Tests, Supplier_Main, "$Id$")
+
+static const char NOTIFY_FACTORY_NAME[] = "NotifyEventChannelFactory";
+static const char NAMING_SERVICE_NAME[] = "NameService";
+
+///////////////////////////
+// StructuredPushSupplier_i
+
+void
+StructuredPushSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier StructuredPushSupplier received subscription change\n")
+ ));
+}
+
+
+void
+StructuredPushSupplier_i::disconnect_structured_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier StructuredPushSupplier received disconnect\n")
+ ));
+}
+
+///////////////////////////
+// SequencePushSupplier_i
+
+void
+SequencePushSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier SequencePushSupplier received subscription change\n")
+ ));
+}
+
+
+void
+SequencePushSupplier_i::disconnect_sequence_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier SequencePushSupplier received disconnect\n")
+ ));
+}
+
+///////////////////////////
+// AnyPushSupplier_i
+
+void
+AnyPushSupplier_i::subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ ACE_UNUSED_ARG (added);
+ ACE_UNUSED_ARG (removed);
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier AnyPushSupplier received subscription change\n")
+ ));
+}
+
+
+void
+AnyPushSupplier_i::disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Suppleir AnyPushSupplier received disconnect\n")
+ ));
+}
+
+/////////////////////////
+// ReconnectionCallback_i
+
+ReconnectionCallback_i::ReconnectionCallback_i (Supplier_Main & supplier_main)
+ : supplier_main_ (supplier_main)
+ , id_is_valid_ (false)
+ , reconnect_count_ (0)
+{
+}
+
+size_t
+ReconnectionCallback_i::reconnect_count () const
+{
+ return this->reconnect_count_;
+}
+
+void
+ReconnectionCallback_i::reconnect (
+ CORBA::Object_ptr reconnection
+ ACE_ENV_ARG_DECL
+ ) ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier received reconnection request\n")
+ ));
+ this->ecf_ = CosNotifyChannelAdmin::EventChannelFactory::_narrow (reconnection ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ if (!CORBA::is_nil (this->ecf_.in ()))
+ {
+ this->supplier_main_.reconnect (this->ecf_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->reconnect_count_ += 1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier reconnection request failed: wrong object type\n")
+ ));
+ }
+}
+
+CORBA::Boolean
+ReconnectionCallback_i::is_alive (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::Boolean (1);
+}
+
+ReconnectionCallback_i::~ReconnectionCallback_i ()
+{
+ // normally you would disconnect from registry here, but
+ // to simulate a failure, we exit without cleaning up
+ // if the fini method is not called.
+}
+
+
+void
+ReconnectionCallback_i::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->id_is_valid_)
+ {
+ NotifyExt::ReconnectionRegistry_var registry =
+ NotifyExt::ReconnectionRegistry::_narrow (this->ecf_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ registry->unregister_callback (this->callback_id_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->id_is_valid_ = false;
+ }
+}
+
+void
+ReconnectionCallback_i::init (
+ PortableServer::POA_ptr poa,
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf
+ ACE_ENV_ARG_DECL)
+{
+ this->ecf_ = CosNotifyChannelAdmin::EventChannelFactory::_duplicate (ecf);
+ PortableServer::ObjectId_var reconnection_callback_id =
+ poa->activate_object (this ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ poa->id_to_reference (reconnection_callback_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ NotifyExt::ReconnectionCallback_var callback =
+ NotifyExt::ReconnectionCallback::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ NotifyExt::ReconnectionRegistry_var registry =
+ NotifyExt::ReconnectionRegistry::_narrow (ecf ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->callback_id_ = registry->register_callback (callback.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->id_is_valid_ = true;
+}
+
+
+
+/////////////////
+// Supplier_Main
+
+Supplier_Main::Supplier_Main ()
+ : verbose_ (false)
+ , mode_ (MODE_ANY)
+ , send_ (10)
+ , use_naming_service_ (true)
+ , serial_number_ (0)
+ , disconnect_on_exit_ (false)
+ , id_file_ (ACE_TEXT ("supplier.ids"))
+ , pause_ (0)
+ , ec_id_ (0)
+ , sa_id_(0)
+ , structured_proxy_id_(0)
+ , sequence_proxy_id_(0)
+ , any_proxy_id_(0)
+ , reconnection_callback_ (*this)
+ , reconnecting_ (false)
+{
+}
+
+Supplier_Main::~Supplier_Main ()
+{
+}
+
+int
+Supplier_Main::parse_args (int argc, char *argv[])
+{
+ int result = 0;
+ int narg = 1;
+ bool corba_arg = false;
+ while (narg < argc && result == 0)
+ {
+ int consumed = parse_single_arg (argc - narg, &argv[narg]);
+ if ( consumed > 0)
+ {
+ narg += consumed;
+ corba_arg = false;
+ }
+ else if (ACE_OS::strncmp (argv[narg], "-ORB", 4) == 0)
+ {
+ corba_arg = true;
+ }
+ else if (corba_arg)
+ {
+ // previous argument was a ORB arg.
+ // current argument is unrecognized
+ // assume the ORB eats this arg
+ narg += 1;
+ corba_arg = false;
+ }
+ else
+ {
+ ACE_OS::fprintf(stderr, "Unrecognized argument: %s\n", argv[narg]);
+ usage (stderr);
+ result = -1;
+ }
+ }
+ return result;
+}
+
+int
+Supplier_Main::parse_single_arg (int argc, char *argv[])
+{
+ int consumed = 0;
+ if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-v")) == 0)
+ {
+ this->verbose_ = true;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-any")) == 0)
+ {
+ this->mode_ = MODE_ANY;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-structured")) == 0)
+ {
+ this->mode_ = MODE_STRUCTURED;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-sequence")) == 0)
+ {
+ this->mode_ = MODE_SEQUENCE;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-channel")) == 0)
+ {
+ this->channel_file_= argv[1];
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-send")) == 0 && argc > 1)
+ {
+ this->send_ = ACE_OS::atoi (argv[1]);
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-pause")) == 0 && argc > 1)
+ {
+ this->pause_ = ACE_OS::atoi (argv[1]);
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-serial_number")) == 0)
+ {
+ this->serial_number_= ACE_OS::atoi (argv[1]);
+ consumed = 2;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], ACE_TEXT ("-nonamesvc")) == 0)
+ {
+ this->use_naming_service_ = false;
+ consumed = 1;
+ }
+ else if (ACE_OS::strcasecmp (argv[0], "-disconnect") == 0)
+ {
+ this->disconnect_on_exit_ = true;
+ consumed = 1;
+ }
+
+ return consumed;
+}
+
+void Supplier_Main::usage(FILE * log)const
+{
+ ACE_OS::fputs (
+ ACE_TEXT ("usage\n")
+ ACE_TEXT (" -channel filename Where to find a channel number.\n")
+ ACE_TEXT (" -any or -structured or -sequence\n")
+ ACE_TEXT (" What type of event to send (pick one, default is -any)\n")
+ ACE_TEXT (" -send n How many events of each type to send.\n")
+ ACE_TEXT (" -pause n Pause after sending n events. Write to file \"Supplier.paused\"\n")
+ ACE_TEXT (" -serial_number n What serial number to start with.\n")
+ ACE_TEXT (" -v Verbose output.\n")
+ ACE_TEXT (" -disconnect Disconnect from channel on exit (prevents reconnect.) \n")
+ ACE_TEXT (" -nonamesvc Don't use the name service to find EventChannelFactory\n")
+ , log);
+}
+
+int Supplier_Main::init (int argc, char *argv[] ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init(argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (0 != this->parse_args(argc, argv))
+ {
+ return -1;
+ }
+
+ CORBA::Object_ptr poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT (" (%P|%t) Unable to initialize the POA.\n")));
+ return -1;
+ }
+
+ this->root_poa_ =
+ PortableServer::POA::_narrow (poa_object ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->use_naming_service_ )
+ {
+ this->find_notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ else
+ {
+ int ok = resolve_notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (!ok)
+ {
+ return -1;
+ }
+ }
+
+ this->reconnecting_ = load_ids ();
+
+ init_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ init_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ switch (this->mode_)
+ {
+ case MODE_STRUCTURED:
+ {
+ init_structured_proxy_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ case MODE_SEQUENCE:
+ {
+ init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ case MODE_ANY:
+ {
+
+ init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ default:
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Supplier: Unknown event push mode.\n")
+ ));
+ break;
+ }
+ }
+ this->reconnection_callback_.init (
+ this->root_poa_.in (),
+ this->ecf_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ save_ids ();
+ return 0;
+}
+void
+Supplier_Main::save_ids()
+{
+ FILE *idf =
+ ACE_OS::fopen (this->id_file_.c_str (), "w");
+
+ if (idf != 0)
+ {
+ int endflag = 12345;
+ int imode = static_cast<int>(this->mode_);
+ ACE_OS::fprintf (idf,
+ "%d,%d,%d,%d,%d,%d,%d,\n",
+ static_cast<int> (imode),
+ static_cast<int> (ec_id_),
+ static_cast<int> (sa_id_),
+ static_cast<int> (structured_proxy_id_),
+ static_cast<int> (sequence_proxy_id_),
+ static_cast<int> (any_proxy_id_),
+ static_cast<int> (endflag) );
+ ACE_OS::fclose (idf);
+ }
+}
+
+bool
+Supplier_Main::load_ids()
+{
+ bool ok = false;
+ FILE *idf =
+ ACE_OS::fopen (this->id_file_.c_str (), "r");
+
+ if (idf != 0)
+ {
+ int field = 0;
+
+ char buffer[100] = ""; // because ACE fgets doesn't put a null if the file is empty
+ ACE_OS::fgets (buffer, sizeof(buffer), idf);
+ ACE_OS::fclose (idf);
+ char * pb = buffer;
+ while (!ok && *pb != 0)
+ {
+ char * eb = ACE_OS::strchr (pb, ',');
+ char * nb = eb + 1;
+ if (eb == 0)
+ {
+ eb = pb + ACE_OS::strlen (pb);
+ nb = eb;
+ }
+ *eb = 0;
+ if (pb < eb)
+ {
+ int value = ACE_OS::atoi(pb);
+ switch (++field)
+ {
+ case 1:
+ this->mode_ = static_cast<Mode_T> (value);
+ break;
+ case 2:
+ this->ec_id_ = value;
+ break;
+ case 3:
+ this->sa_id_ = value;
+ break;
+ case 4:
+ this->structured_proxy_id_ = value;
+ break;
+ case 5:
+ this->sequence_proxy_id_ = value;
+ break;
+ case 6:
+ this->any_proxy_id_ = value;
+ break;
+ case 7:
+ ok = value == 12345;
+ break;
+ default:
+ ACE_OS::fprintf (stderr, ACE_TEXT ("Supplier: Warning: too many fields in saved id file.\n"));
+ ok = false;
+ break;
+ }
+ }
+ pb = nb;
+ }
+ }
+ return ok;
+}
+
+void
+Supplier_Main::reconnect (
+ CosNotifyChannelAdmin::EventChannelFactory_ptr dest_factory
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->ecf_ = CosNotifyChannelAdmin::EventChannelFactory::_duplicate (dest_factory);
+ this->reconnecting_ = true;
+ init_event_channel (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ init_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ switch (this->mode_)
+ {
+ case MODE_STRUCTURED:
+ {
+ init_structured_proxy_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+ case MODE_SEQUENCE:
+ {
+ init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+ case MODE_ANY:
+ {
+ init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ break;
+ }
+ }
+}
+
+
+int
+Supplier_Main::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // ignore redundant calls
+ if (CORBA::is_nil (this->naming_context_.in ()))
+ {
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ }
+
+ return !CORBA::is_nil (this->naming_context_.in ());
+}
+
+int
+Supplier_Main::find_notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int status = this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ if (status)
+ {
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (NOTIFY_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ this->ecf_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN(0);
+ }
+ return ! CORBA::is_nil (this->ecf_.in ());
+}
+
+int
+Supplier_Main::resolve_notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var factory_obj =
+ this->orb_->resolve_initial_references (NOTIFY_FACTORY_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+
+ this->ecf_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ factory_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(0);
+ return ! CORBA::is_nil (this->ecf_.in ());
+}
+
+void
+Supplier_Main::init_event_channel (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ this->ec_ = this->ecf_->get_event_channel (
+ this->ec_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (this->ec_.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Reconnect to event channel %d\n"),
+ static_cast<int>(this->ec_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ // if we don't have a channel yet, and a channel id file was specified
+ // try to read from it
+ if (!ok && this->channel_file_.length () > 0)
+ {
+ FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "r");
+ if (chf != 0)
+ {
+ char buffer[100];
+ ACE_OS::fgets (buffer, sizeof(buffer), chf);
+ ACE_OS::fclose (chf);
+ this->ec_id_ = ACE_OS::atoi (buffer);
+
+ ACE_DECLARE_NEW_ENV;
+ ACE_TRY_EX (unique_label_1)
+ {
+ this->ec_ = this->ecf_->get_event_channel (
+ this->ec_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (unique_label_1)
+ ok = ! CORBA::is_nil (this->ec_.in ());
+ if (ok)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Connect to Existing event channel %d\n"),
+ static_cast<int>(this->ec_id_)
+ ));
+ }
+ // kill the channel filename so we don't overwrite the file
+ this->channel_file_ = "";
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+ }
+
+ if (!ok)
+ {
+ CosNotification::QoSProperties qosprops (7);
+ qosprops.length (7);
+ CORBA::ULong i = 0;
+#ifdef DISABLE_PROPERTIES_TODO
+ qosprops[i].name = CORBA::string_dup(CosNotification::EventReliability);
+ qosprops[i++].value <<= CosNotification::Persistent;
+ qosprops[i].name = CORBA::string_dup(CosNotification::ConnectionReliability);
+ qosprops[i++].value <<= CosNotification::Persistent; // Required, or we won't persist much
+ qosprops[i].name = CORBA::string_dup(CosNotification::Priority);
+ qosprops[i++].value <<= CosNotification::HighestPriority;
+ qosprops[i].name = CORBA::string_dup(CosNotification::Timeout);
+ qosprops[i++].value <<= (TimeBase::TimeT) 42 * 1000000; // 4.2s
+ qosprops[i].name = CORBA::string_dup(CosNotification::StopTimeSupported);
+ qosprops[i++].value <<= CORBA::Any::from_boolean(1);
+ qosprops[i].name = CORBA::string_dup(CosNotification::MaximumBatchSize);
+ qosprops[i++].value <<= (CORBA::Long) 2;
+ qosprops[i].name = CORBA::string_dup(CosNotification::PacingInterval);
+ qosprops[i++].value <<= (TimeBase::TimeT) 50 * 10000; // 50ms
+#endif
+ qosprops.length (i);
+ CosNotification::AdminProperties adminprops(4);
+ adminprops.length (4);
+ i = 0;
+#ifdef DISABLE_PROPERTIES_TODO
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxQueueLength);
+ adminprops[i++].value <<= (CORBA::Long) 1234;
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxConsumers);
+ adminprops[i++].value <<= (CORBA::Long) 1000;
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxSuppliers);
+ adminprops[i++].value <<= (CORBA::Long) 1000;
+ adminprops[i].name = CORBA::string_dup(CosNotification::RejectNewEvents);
+ adminprops[i++].value <<= CORBA::Any::from_boolean(1);
+#endif
+ adminprops.length(i);
+
+ ec_ = this->ecf_->create_channel (
+ qosprops,
+ adminprops,
+ this->ec_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (ec_.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Create event channel %d\n"),
+ static_cast<int> (this->ec_id_)
+ ));
+ }
+ }
+
+ // save channel id
+ if (ok && this->channel_file_.length() > 0)
+ {
+ FILE * chf = ACE_OS::fopen (this->channel_file_.c_str (), "w");
+ if (chf != 0)
+ {
+ ACE_OS::fprintf (chf, "%d\n", static_cast<int> (this->ec_id_));
+ fclose (chf);
+ }
+ }
+}
+
+CosNotifyChannelAdmin::AdminID default_admin_id = static_cast<CosNotifyChannelAdmin::AdminID>(-1);
+
+void
+Supplier_Main::init_supplier_admin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ if (this->reconnecting_ && this->sa_id_ != default_admin_id)
+ {
+ ACE_TRY_EX(ONE)
+ {
+ this->sa_ = this->ec_->get_supplieradmin(
+ this->sa_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(ONE);
+ ok = ! CORBA::is_nil (this->sa_.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Reconnect to supplier admin %d\n"),
+ static_cast<int>(this->sa_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ ACE_TRY_EX(TWO)
+ {
+ this->sa_ = this->ec_->default_supplier_admin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(TWO);
+ ok = ! CORBA::is_nil (this->sa_.in ());
+ this->sa_id_ = default_admin_id;
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Using default supplier admin\n")
+ ));
+ }
+ else if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: No default supplier admin\n")
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ this->sa_ = this->ec_->new_for_suppliers(
+ CosNotifyChannelAdmin::OR_OP,
+ this->sa_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (this->sa_.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Create new supplier admin %d\n"),
+ static_cast<int>(this->sa_id_)
+ ));
+ }
+ }
+}
+
+void
+Supplier_Main::init_structured_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ proxy = this->sa_->get_proxy_consumer (
+ this->structured_proxy_id_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Reconnect to proxy supplier %d\n"),
+ static_cast<int>(this->structured_proxy_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ proxy = this->sa_->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ this->structured_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Create new proxy %d\n"),
+ static_cast<int>(this->structured_proxy_id_)
+ ));
+ }
+ }
+ this->structured_proxy_push_consumer_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow(proxy.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->structured_proxy_push_consumer_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) init_structured_proxy_consumer received nil ProxyConsumer\n")
+ ));
+ ACE_THROW (CORBA::OBJECT_NOT_EXIST ());
+ }
+ if (CORBA::is_nil (this->structured_push_supplier_ref_.in ()))
+ {
+ PortableServer::ObjectId_var push_supplier_id =
+ this->root_poa_->activate_object (
+ &(this->structured_push_supplier_) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ this->root_poa_->id_to_reference (push_supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->structured_push_supplier_ref_ =
+ CosNotifyComm::StructuredPushSupplier::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (CORBA::is_nil (structured_push_supplier_ref_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"),
+ static_cast<int>(this->structured_proxy_id_)
+ ));
+
+ ACE_THROW (CORBA::UNKNOWN());
+ }
+
+ this->structured_proxy_push_consumer_->connect_structured_push_supplier (
+ structured_push_supplier_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier_Main::init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ proxy = this->sa_->get_proxy_consumer(
+ this->sequence_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Reconnect to proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ proxy = this->sa_->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ this->sequence_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Create new proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+ }
+ }
+ this->sequence_proxy_push_consumer_ =
+ CosNotifyChannelAdmin::SequenceProxyPushConsumer::_narrow(proxy.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->sequence_proxy_push_consumer_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+ ACE_THROW (CORBA::UNKNOWN());
+ }
+
+ if (CORBA::is_nil (this->sequence_push_supplier_ref_.in ()))
+ {
+ PortableServer::ObjectId_var push_supplier_id =
+ this->root_poa_->activate_object (
+ &(this->sequence_push_supplier_) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ this->root_poa_->id_to_reference (push_supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->sequence_push_supplier_ref_ =
+ CosNotifyComm::SequencePushSupplier::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (CORBA::is_nil (sequence_push_supplier_ref_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+ ACE_THROW (CORBA::UNKNOWN());
+ }
+
+ this->sequence_proxy_push_consumer_->connect_sequence_push_supplier (
+ sequence_push_supplier_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Supplier_Main::init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL)
+{
+ bool ok = false;
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy;
+ if (this->reconnecting_)
+ {
+ ACE_TRY_NEW_ENV
+ {
+ proxy = this->sa_->get_proxy_consumer(
+ this->any_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Reconnect to proxy %d\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ }
+ }
+ ACE_CATCHALL
+ {
+ }
+ ACE_ENDTRY;
+ }
+
+ if (!ok)
+ {
+ proxy = this->sa_->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::ANY_EVENT,
+ this->any_proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ ok = ! CORBA::is_nil (proxy.in ());
+ if (ok && this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier: Create new proxy %d\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ }
+ }
+ this->any_proxy_push_consumer_ =
+ CosNotifyChannelAdmin::ProxyPushConsumer::_narrow(proxy.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (this->any_proxy_push_consumer_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"),
+ static_cast<int>(this->any_proxy_id_)
+ ));
+ ACE_THROW (CORBA::UNKNOWN());
+ }
+
+ if (CORBA::is_nil (this->any_push_supplier_ref_.in ()))
+ {
+ PortableServer::ObjectId_var push_supplier_id =
+ this->root_poa_->activate_object (
+ &(this->any_push_supplier_) ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_var obj =
+ this->root_poa_->id_to_reference (push_supplier_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->any_push_supplier_ref_ =
+ CosNotifyComm::PushSupplier::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ if (CORBA::is_nil (any_push_supplier_ref_.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Supplier: Received wrong type of push consumer proxy %d\n"),
+ static_cast<int>(this->sequence_proxy_id_)
+ ));
+ ACE_THROW (CORBA::UNKNOWN());
+ }
+
+ this->any_proxy_push_consumer_->connect_any_push_supplier (
+ any_push_supplier_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int Supplier_Main::fini (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->disconnect_on_exit_)
+ {
+ this->reconnection_callback_.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+ if (!CORBA::is_nil (this->structured_proxy_push_consumer_.in ()))
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Disconnecting structured\n")
+ ));
+ }
+ this->structured_proxy_push_consumer_->disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+ }
+ if (!CORBA::is_nil (this->sequence_proxy_push_consumer_.in ()))
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Disconnecting sequence\n")
+ ));
+ }
+ this->sequence_proxy_push_consumer_->disconnect_sequence_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+ }
+ if (!CORBA::is_nil (this->any_proxy_push_consumer_.in ()))
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Disconnecting any\n")
+ ));
+ }
+ this->any_proxy_push_consumer_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-4);
+ }
+ if (!CORBA::is_nil (this->sa_.in ()) && this->sa_id_ != default_admin_id)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) destroy admin %d\n"),
+ static_cast<int>(this->sa_id_)
+ ));
+ }
+ this->sa_->destroy();
+ }
+ }
+ this->orb_->shutdown ();
+ return 0;
+}
+
+void Supplier_Main::send_structured_event (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotification::StructuredEvent event;
+
+ // EventHeader.
+
+ // FixedEventHeader.
+ // EventType.
+ // string.
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_name = CORBA::string_dup("reconnect_test");
+
+ // OptionalHeaderFields.
+ // PropertySeq.
+ // sequence<Property>: string name, any value
+ CosNotification::PropertySeq& qos = event.header.variable_header;
+ qos.length (2);
+ qos[0].name = CORBA::string_dup (CosNotification::Priority);
+ qos[0].value <<= CosNotification::LowestPriority;
+ qos[1].name = CORBA::string_dup (CosNotification::EventReliability);
+ qos[1].value <<= CosNotification::Persistent;
+
+ // FilterableEventBody
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("serial_number");
+ event.filterable_data[0].value <<= CORBA::ULong ( this->serial_number_);
+
+ // any
+ event.remainder_of_body <<= CORBA::ULong ( this->serial_number_);
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier push structured event %d\n"),
+ static_cast<int>(serial_number_)
+ ));
+ }
+
+ this->structured_proxy_push_consumer_->push_structured_event (event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void Supplier_Main::send_sequence_event (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotification::EventBatch event_batch(1);
+ event_batch.length (1);
+ CosNotification::StructuredEvent & event = event_batch[0];
+
+ // EventHeader.
+
+ // FixedEventHeader.
+ // EventType.
+ // string.
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_name = CORBA::string_dup("reconnect_test");
+
+ // OptionalHeaderFields.
+ // PropertySeq.
+ // sequence<Property>: string name, any value
+ CosNotification::PropertySeq& qos = event.header.variable_header;
+ qos.length (2);
+ qos[0].name = CORBA::string_dup (CosNotification::Priority);
+ qos[0].value <<= CosNotification::LowestPriority;
+ qos[1].name = CORBA::string_dup (CosNotification::EventReliability);
+ qos[1].value <<= CosNotification::Persistent;
+
+ // FilterableEventBody
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("serial_number");
+ event.filterable_data[0].value <<= CORBA::ULong ( this->serial_number_);
+
+ // any
+ event.remainder_of_body <<= CORBA::ULong ( this->serial_number_);
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier push sequence events %d\n"),
+ static_cast<int>(this->serial_number_)
+ ));
+ }
+
+ this->sequence_proxy_push_consumer_->push_structured_events (event_batch
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void Supplier_Main::send_any_event (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any event;
+ event <<= CORBA::ULong (this->serial_number_);
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier push any event %d\n"),
+ static_cast<int>(this->serial_number_)
+ ));
+ }
+
+ this->any_proxy_push_consumer_->push (event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int Supplier_Main::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int result = 0;
+ bool paused = false;
+ size_t reconnections = 0;
+
+ size_t send = 0;
+ while ( send < this->send_)
+ {
+ ACE_Time_Value tv(0, 100 * 1000);
+ orb_->run(tv);
+
+ if (this->pause_ != 0 && send == this->pause_)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier paused after %d events\n"),
+ static_cast<int>(this->pause_)
+ ));
+ }
+ reconnections = this->reconnection_callback_.reconnect_count ();
+ FILE * pause_file = ACE_OS::fopen ("Supplier.paused", "w");
+ if (pause_file != 0)
+ {
+ ACE_OS::fputs (ACE_TEXT ("paused\n"), pause_file);
+ ACE_OS::fclose (pause_file);
+ }
+ paused = true;
+ this->pause_ = 0;
+ }
+ if (paused)
+ {
+ if (this->reconnection_callback_.reconnect_count () != reconnections)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P|%t) Supplier no longer paused. Next s# %d\n"),
+ static_cast<int>(this->serial_number_)
+ ));
+ }
+ paused = false;
+ }
+ }
+
+ if (!paused)
+ {
+ switch (this->mode_)
+ {
+ case MODE_STRUCTURED:
+ {
+ send_structured_event (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ case MODE_SEQUENCE:
+ {
+ send_sequence_event (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ case MODE_ANY:
+ {
+ send_any_event (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ break;
+ }
+ }
+ this->serial_number_ += 1;
+ send += 1;
+ }
+ }
+ return result;
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ int result = -1;
+ Supplier_Main app;
+ ACE_TRY_NEW_ENV
+ {
+ result = app.init(argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ if (result == 0)
+ {
+ result = app.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ if (result == 0)
+ {
+ app.fini (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: Supplier::main\t\n");
+ result = -1;
+ }
+ ACE_ENDTRY;
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("(%P,%t) Supplier exits: code %d\n"),
+ result
+ ));
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.h b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.h
new file mode 100644
index 00000000000..f429cf7892c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/Supplier.h
@@ -0,0 +1,209 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Supplier.h
+//
+// = DESCRIPTION
+// Test Supplier reconnect to existing channel/admin/proxy Notification Service
+//
+// = AUTHOR
+// Dale Wilson <wilson_d@ociweb.com>
+//
+// ==========================================================================
+
+#ifndef RECONNECTNG_SUPPLIER_H
+#define RECONNECTNG_SUPPLIER_H
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/NotifyExtS.h"
+#include <ace/SString.h>
+
+class Supplier_Main;
+
+class StructuredPushSupplier_i : public virtual POA_CosNotifyComm::StructuredPushSupplier
+{
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ virtual void disconnect_structured_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+class SequencePushSupplier_i : public virtual POA_CosNotifyComm::SequencePushSupplier
+{
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ virtual void disconnect_sequence_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+class AnyPushSupplier_i : public virtual POA_CosNotifyComm::PushSupplier
+{
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ virtual void disconnect_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+class ReconnectionCallback_i : public virtual POA_NotifyExt::ReconnectionCallback
+{
+public:
+ ReconnectionCallback_i (Supplier_Main & supplier_main);
+
+ virtual ~ReconnectionCallback_i ();
+
+ void init (
+ PortableServer::POA_ptr poa,
+ CosNotifyChannelAdmin::EventChannelFactory_ptr ecf_
+ ACE_ENV_ARG_DECL);
+
+ void fini (ACE_ENV_SINGLE_ARG_DECL);
+
+ size_t reconnect_count () const;
+
+ virtual void reconnect (
+ CORBA::Object_ptr reconnection
+ ACE_ENV_ARG_DECL
+ ) ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean is_alive (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ Supplier_Main & supplier_main_;
+ bool id_is_valid_;
+ NotifyExt::ReconnectionRegistry::ReconnectionID callback_id_;
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf_;
+ size_t reconnect_count_;
+};
+
+class Supplier_Main
+{
+ public:
+ Supplier_Main ();
+ ~Supplier_Main ();
+
+ int parse_args (int argc, char *argv[]);
+ int parse_single_arg (int argc, char *argv[]);
+
+ int init (int argc, char *argv[] ACE_ENV_ARG_DECL);
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ int fini (ACE_ENV_SINGLE_ARG_DECL);
+ void usage (FILE * log) const;
+
+ void reconnect (
+ CosNotifyChannelAdmin::EventChannelFactory_ptr dest_factory
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ private:
+ /// Find naming service.
+ int resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Resolve the Notify factory from the Naming service.
+ int find_notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Resolve the Notify factory using resolve_initial_reference ("NotifyEventChannelFactory")
+ int resolve_notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+
+ void init_event_channel (ACE_ENV_SINGLE_ARG_DECL);
+ void init_supplier_admin (ACE_ENV_SINGLE_ARG_DECL);
+ void init_structured_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL);
+ void init_sequence_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL);
+ void init_any_proxy_consumer (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// send events.
+ void send_structured_event (ACE_ENV_SINGLE_ARG_DECL);
+ void send_sequence_event (ACE_ENV_SINGLE_ARG_DECL);
+ void send_any_event (ACE_ENV_SINGLE_ARG_DECL);
+
+ void save_ids();
+ bool load_ids();
+
+ ////////////////////
+ // forbidden methods
+ private:
+ Supplier_Main (const Supplier_Main & rhs);
+ Supplier_Main & operator = (const Supplier_Main & rhs);
+
+ ////////////////
+ // Data members
+ private:
+
+ // set by command line parameters
+ bool verbose_; // -v make a glorious noise
+ enum Mode_T {
+ MODE_ANY,
+ MODE_STRUCTURED,
+ MODE_SEQUENCE} mode_; // -any, -structured, or -sequence
+ ACE_CString channel_file_; // -channel filename
+ size_t send_; // -send n
+ bool use_naming_service_; // -nonamesvc
+ size_t serial_number_; // -serial_number
+ bool disconnect_on_exit_; // -disconnect
+ ACE_CString id_file_; // -ids
+ size_t pause_; // -pause n (pause after sending n messages)
+ CORBA::ORB_var orb_;
+ PortableServer::POA_var root_poa_;
+ CosNaming::NamingContext_var naming_context_;
+ CosNotifyChannelAdmin::EventChannelFactory_var ecf_;
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ CosNotifyChannelAdmin::ChannelID ec_id_;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var sa_;
+ CosNotifyChannelAdmin::AdminID sa_id_;
+
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var structured_proxy_push_consumer_;
+ CosNotifyChannelAdmin::ProxyID structured_proxy_id_;
+ StructuredPushSupplier_i structured_push_supplier_;
+ CosNotifyComm::StructuredPushSupplier_var structured_push_supplier_ref_;
+
+
+ CosNotifyChannelAdmin::SequenceProxyPushConsumer_var sequence_proxy_push_consumer_;
+ CosNotifyChannelAdmin::ProxyID sequence_proxy_id_;
+ SequencePushSupplier_i sequence_push_supplier_;
+ CosNotifyComm::SequencePushSupplier_var sequence_push_supplier_ref_;
+
+ CosNotifyChannelAdmin::ProxyPushConsumer_var any_proxy_push_consumer_;
+ CosNotifyChannelAdmin::ProxyID any_proxy_id_;
+ AnyPushSupplier_i any_push_supplier_;
+ CosNotifyComm::PushSupplier_var any_push_supplier_ref_;
+
+ ReconnectionCallback_i reconnection_callback_;
+
+ bool reconnecting_;
+};
+
+
+
+#endif /* RECONNECTNG_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf
new file mode 100644
index 00000000000..1365667e20a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/event.conf
@@ -0,0 +1,6 @@
+#
+static TAO_CosNotify_Service "-AllowReconnect"
+#
+# This should fail because event perstence requires topology persistence
+#
+dynamic Event_Persistence Service_Object* TAO_CosNotification:_make_TAO_Notify_Standard_Event_Persistence() "-v -file_path ./event_persist.db"
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf
new file mode 100644
index 00000000000..47da73eb47f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt.conf
@@ -0,0 +1,7 @@
+#
+## -DispatchingThreads N - creates a thread pool for dispatching and consumer side filter eval
+## -SourceThreads M - creates a thread pool for lookup and supplier side filter eval
+#
+static TAO_CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect"
+
+
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf
new file mode 100644
index 00000000000..9022e30fee6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_both.conf
@@ -0,0 +1,5 @@
+static TAO_CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect"
+#
+dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_TAO_Notify_XML_Topology_Factory() "-base_path ./reconnect_test"
+dynamic Event_Persistence Service_Object* TAO_CosNotification_Persist:_make_TAO_Notify_Standard_Event_Persistence() "-file_path ./event_persist.db"
+
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_topo.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_topo.conf
new file mode 100644
index 00000000000..ede1e8d298c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_mt_topo.conf
@@ -0,0 +1,3 @@
+static TAO_CosNotify_Service "-DispatchingThreads 2 -SourceThreads 2 -AllowReconnect"
+dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_TAO_Notify_XML_Topology_Factory() "-base_path ./reconnect_test"
+
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf
new file mode 100644
index 00000000000..3ff9ed61cbb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st.conf
@@ -0,0 +1,4 @@
+#
+static TAO_CosNotify_Service "-AllowReconnect"
+
+
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf
new file mode 100644
index 00000000000..c2da6f07cee
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_both.conf
@@ -0,0 +1,4 @@
+static TAO_CosNotify_Service "-AllowReconnect"
+#
+dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_TAO_Notify_XML_Topology_Factory() "-v -base_path ./reconnect_test"
+dynamic Event_Persistence Service_Object* TAO_CosNotification_Persist:_make_TAO_Notify_Standard_Event_Persistence() "-v -file_path ./event_persist.db"
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_topo.conf b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_topo.conf
new file mode 100644
index 00000000000..daf2927299f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/ns_st_topo.conf
@@ -0,0 +1,2 @@
+static TAO_CosNotify_Service "-AllowReconnect"
+dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_TAO_Notify_XML_Topology_Factory() "-v -base_path ./reconnect_test"
diff --git a/TAO/orbsvcs/tests/Notify/Reconnecting/run_test.pl b/TAO/orbsvcs/tests/Notify/Reconnecting/run_test.pl
new file mode 100755
index 00000000000..0747fc51143
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Reconnecting/run_test.pl
@@ -0,0 +1,392 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+my($eventType) = "-any"; # your choice of -any -structured or -sequence
+
+my($ACE_ROOT) = $ENV{ACE_ROOT};
+my($TAO_ROOT) = "$ACE_ROOT/TAO";
+
+my($notify_port) = "9889";
+
+#file used to detect notification service startup
+my($notify_ior) = PerlACE::LocalFile("notify.ior");
+#hard coded file name in Consumer.cpp (for now)
+my($consumer_ids) = PerlACE::LocalFile("consumer.ids");
+#hard coded file name in Supplier.cpp (for now)
+my($supplier_ids) = PerlACE::LocalFile("supplier.ids");
+#file used to communicate channel # from consumer to supplier
+my($channel_id) = PerlACE::LocalFile("channel_id");
+#file names comes from svc.conf (+.xml & .000)
+my($save_xml) = PerlACE::LocalFile("./reconnect_test.xml");
+my($save_000) = PerlACE::LocalFile("./reconnect_test.000");
+my($eventpersist) = PerlACE::LocalFile("./event_persist.db");
+# hardcode filename written by the Supplier when it pauses.
+my($supplier_pause) = PerlACE::LocalFile("Supplier.paused");
+
+my($verbose) = "";
+
+my $svcconf = "ns_st_topo.conf";
+
+# Process command line arguments
+foreach $i (@ARGV) {
+ if ($i eq "-any") {
+ $eventType = "-any";
+ }
+ elsif ($i eq "-str" or $i eq "-structured") {
+ $eventType = "-structured";
+ }
+ elsif ($i eq "-seq" or $i eq "-sequence") {
+ $eventType = "-sequence";
+ }
+ elsif ($i eq "-mt") {
+ $svcconf = "ns_mt_topo.conf";
+ }
+ elsif ($i eq "-v" or $i eq "-verbose") {
+ $verbose = "-v";
+ }
+ else {
+ print "TEST SCRIPT: unknown: $i\n";
+ print "TEST SCRIPT: usage: [-any|-str|-seq] -mt -v\n";
+ exit -4;
+ }
+}
+
+my($client_args) = " $eventType $verbose -NoNameSvc -ORBInitRef NotifyEventChannelFactory=corbaloc::localhost:$notify_port/NotifyEventChannelFactory ";
+my($ns_args) = " -ORBObjRefStyle url -NoNameSvc -Boot -ORBSvcConf $svcconf -IORoutput $notify_ior -ORBEndpoint iiop://:$notify_port ";
+#my($ns_args_hidden) = " -NoNameSvc -Boot -ORBSvcConf $svcconf -IORoutput $notify_ior";
+# nuke the topology save files so we start clean
+unlink $save_xml;
+unlink $save_000;
+unlink $eventpersist;
+unlink $notify_ior;
+
+
+##define the processes first
+my($NS) = new PerlACE::Process("$TAO_ROOT/orbsvcs/Notify_Service/Notify_Service");
+my($CON) = new PerlACE::Process("./Consumer");
+my($SUP) = new PerlACE::Process("./Supplier");
+
+if ($verbose eq "-v") {print "TEST SCRIPT: Starting Notify Service on port $notify_port\n";}
+$NS->Arguments($ns_args);
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $NS->CommandLine . "\n";}
+print $NS->CommandLine ();
+if ($NS->Spawn() == -1) {
+ exit 1;
+}
+
+# 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 ();
+ exit 1;
+}
+# be sure consumer doesn't try to reconnect the first time
+unlink $consumer_ids;
+# don't use previous channel id
+unlink $channel_id;
+
+# start the consumer,
+# write the channel number to channel.id for use by Supplier
+# expect to receive 20 events of type any
+#
+$CON->Arguments("-channel $channel_id -expect 20 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $CON->CommandLine . "\n";}
+print $CON->CommandLine ();
+$CON->Spawn();
+
+# wait for the channel number file
+if (PerlACE::waitforfile_timed ($channel_id, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for Consumer to write $channel_id\n";
+ $NS->Kill ();
+ $CON->Kill ();
+ exit 1;
+}
+
+# discard old reconnect information
+unlink $supplier_ids;
+
+# send 10 Any's, picking up the channel# from channel.id
+$SUP->Arguments("-channel $channel_id -send 10 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $SUP->CommandLine . "\n";}
+print $SUP->CommandLine ();
+$SUP->SpawnWaitKill(60);
+
+# forget the channel id, depend on the reconnect information
+unlink $channel_id;
+
+$SUP->Arguments("-send 10 -serial_number 10 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $SUP->CommandLine . "\n";}
+print $SUP->CommandLine ();
+$SUP->SpawnWaitKill(60);
+
+$status = $CON->WaitKill (60);
+
+if ($status) {
+ print STDERR "ERROR: Consumer reported error\n";
+ $NS->Kill();
+ exit $status;
+ }
+
+print "TEST SCRIPT: ****Passed: Supplier reconnect test.\n";
+
+################
+#end of test 1
+################
+
+# Now start the consumer again. Depending on reconnect this time
+# Let it write the channel.id file so we know when it's up.
+
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $CON->CommandLine . "\n";}
+$CON->Spawn();
+# wait for the channel number file
+if (PerlACE::waitforfile_timed ($channel_id, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for Consumer to write $channel_id\n";
+ $NS->Kill ();
+ $CON->Kill ();
+ exit 1;
+}
+
+# forget the channel id, depend on the supplier reconnect information
+unlink $channel_id;
+
+$SUP->Arguments("-send 20 -serial_number 0 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $SUP->CommandLine . "\n";}
+$status= $SUP->SpawnWaitKill(60);
+if ($status) {
+ print STDERR "ERROR: Supplier reported error\n";
+ $CON->Kill();
+ $NS->Kill();
+ exit $status;
+ }
+
+$status = $CON->WaitKill (60);
+if ($status) {
+ print STDERR "ERROR: Consumer reported error\n";
+ $NS->Kill();
+ exit $status;
+ }
+
+print "TEST SCRIPT: ****Passed: Consumer reconnect test.\n";
+
+################
+#end of test 2
+################
+
+if ($verbose eq "-v") {print "TEST SCRIPT: Stop the Notification Service\n";}
+$NS->Kill();
+unlink $notify_ior;
+
+if ($verbose eq "-v") {print "TEST SCRIPT: Restarting Notify Service on port $notify_port\n";}
+if ($verbose eq "-v") {print "TEST SCRIPT: It should load topology from $save_xml\n";}
+
+# sleep to avoid socket-related problems
+sleep (10 * $PerlACE::Process::WAIT_DELAY_FACTOR);
+$NS->Arguments($ns_args);
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $NS->CommandLine . "\n";}
+$NS->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 ();
+ exit 1;
+}
+
+# Now start the consumer again. It will use the reconnect info.
+# Let it write the channel.id file so we know when it's up.
+unlink $channel_id;
+
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $CON->CommandLine . "\n";}
+$CON->Spawn();
+# wait for the channel number file
+if (PerlACE::waitforfile_timed ($channel_id, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for Consumer to write $channel_id\n";
+ $NS->Kill ();
+ $CON->Kill ();
+ exit 1;
+}
+
+# forget the channel id, depend on the supplier reconnect information
+unlink $channel_id;
+
+$SUP->Arguments("-send 20 -serial_number 0 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $SUP->CommandLine . "\n";}
+$status = $SUP->SpawnWaitKill(60);
+if ($status) {
+ print STDERR "ERROR: Supplier reported error\n";
+ $NS->Kill();
+ $CON->Kill();
+ exit $status;
+ }
+
+$status = $CON->WaitKill (60);
+if ($status) {
+ print STDERR "ERROR: Consumer reported error\n";
+ $NS->Kill();
+ exit $status;
+ }
+
+print "TEST SCRIPT: ****Passed: Topology Persistence Test.\n";
+
+################
+#end of test 3
+################
+
+# Now start the consumer one more time
+# Let it write the channel.id file so we know when it's up.
+unlink $channel_id;
+
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $CON->CommandLine . "\n";}
+$CON->Spawn();
+# wait for the channel number file
+if (PerlACE::waitforfile_timed ($channel_id, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for Consumer to write $channel_id\n";
+ $NS->Kill ();
+ $CON->Kill ();
+ exit 1;
+}
+
+# forget the channel id, depend on the supplier reconnect information
+unlink $channel_id;
+
+# Start the Supplier, tell it to send 10 messages, pause until it is reconnected
+# then send another 10.
+
+unlink ($supplier_pause);
+
+$SUP->Arguments("-send 20 -pause 10 -serial_number 0 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $SUP->CommandLine . "\n";}
+$SUP->Spawn();
+
+# wait for the supplier's "paused" file
+if (PerlACE::waitforfile_timed ($supplier_pause, 30) == -1) {
+ print STDERR "ERROR: Timed out waiting for Supplier to write $supplier_pause\n";
+ $NS->Kill ();
+ $SUP->Kill ();
+ $CON->Kill ();
+ exit 1;
+}
+unlink ($supplier_pause);
+
+if ($verbose eq "-v") {print "TEST SCRIPT: Stop the Notification Service\n";}
+$NS->Kill();
+unlink $notify_ior;
+
+if ($verbose eq "-v") {print "TEST SCRIPT: Restarting Notify Service\n";}
+if ($verbose eq "-v") {print "TEST SCRIPT: Use unspecified port to make it \"invisible\" to clients\n";}
+if ($verbose eq "-v") {print "TEST SCRIPT: It should load topology from $save_xml\n";}
+if ($verbose eq "-v") {print "TEST SCRIPT: and reconnect to registered clients.\n";}
+
+#$NS->Arguments($ns_args_hidden);
+# sleep to avoid socket-related problems
+sleep (10 * $PerlACE::Process::WAIT_DELAY_FACTOR);
+
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $NS->CommandLine . "\n";}
+$NS->Spawn();
+
+# at this point, both the consumer and the supplier should reconnect
+# and the remaining events should be delivered
+# eventually the consumer will finish
+
+$status = $CON->WaitKill (20);
+if ($status) {
+ print STDERR "ERROR: Consumer reported error\n";
+ $SUP->Kill();
+ $NS->Kill();
+ exit $status;
+ }
+
+$status = $SUP->Kill ();
+if ($status) {
+ print STDERR "ERROR: Supplier reported error\n";
+ $NS->Kill();
+ exit $status;
+ }
+
+print "TEST SCRIPT: ****Passed: Reconnection Factory test.\n";
+
+################
+#end of test 4
+################
+
+if ($verbose eq "-v") {print "TEST SCRIPT: Stop the Notification Service\n";}
+$NS->Kill();
+
+unlink $notify_ior;
+unlink $save_xml;
+unlink $save_000;
+unlink $eventpersist;
+unlink $consumer_ids;
+unlink $channel_id;
+unlink $supplier_ids;
+
+sleep (10 * $PerlACE::Process::WAIT_DELAY_FACTOR); ## avoid lingering sockets
+# go back to normal ns args
+$NS->Arguments($ns_args);
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $NS->CommandLine . "\n";}
+$NS->Spawn();
+
+# the ior file is only used to wait for the service to start
+if (PerlACE::waitforfile_timed ($notify_ior, 20) == -1) {
+ print STDERR "ERROR: Timed out waiting for $notify_ior\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+#configure the consumer to expect 20 events, fail (throw an exception
+# after 8 events) then continue to listen for remaining events.
+#The Notification service should automatically retry (but may discard)
+# the failed events.
+$CON->Arguments("-channel $channel_id -expect 20 -fail 8 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $CON->CommandLine . "\n";}
+$CON->Spawn();
+
+# wait for the channel number file
+if (PerlACE::waitforfile_timed ($channel_id, 10) == -1) {
+ print STDERR "ERROR: Timed out waiting for Consumer to write $channel_id\n";
+ $NS->Kill ();
+ $CON->Kill ();
+ exit 1;
+}
+
+$SUP->Arguments("-channel $channel_id -send 20 $client_args");
+if ($verbose eq "-v") {print "TEST SCRIPT: " . $SUP->CommandLine . "\n";}
+$status = $SUP->SpawnWaitKill(20);
+if ($status) {
+ print STDERR "ERROR: Supplier reported error\n";
+ $NS->Kill();
+ $CON->Kill ();
+ exit $status;
+ }
+
+## this is a slow test due to the reconnection
+## time, so give it enough time...
+$status = $CON->WaitKill (240);
+
+if ($status) {
+ print STDERR "ERROR: Consumer reported error\n";
+ $NS->Kill();
+ exit $status;
+ }
+
+print "TEST SCRIPT: ****Passed: Consumer recoverable exception test.\n";
+
+################
+#end of test 5
+################
+
+if ($verbose eq "-v") {print "TEST SCRIPT: Stop the Notification Service\n";}
+$NS->Kill();
+unlink $notify_ior;
+unlink $save_xml;
+unlink $save_000;
+unlink $eventpersist;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Makefile.am b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Makefile.am
new file mode 100644
index 00000000000..9cac82d4d1e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Makefile.am
@@ -0,0 +1,162 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Seq_Multi_ETCL_Filter_Idl.am
+
+if !BUILD_ACE_FOR_TAO
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+endif !BUILD_ACE_FOR_TAO
+
+## Makefile.Seq_Multi_ETCL_Filter_Ntf_Seq_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Consumer
+
+Sequence_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Consumer_SOURCES = \
+ Notify_Sequence_Push_Consumer.cpp \
+ Sequence_Consumer.cpp \
+ goC.cpp \
+ Notify_Sequence_Push_Consumer.h
+
+Sequence_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Seq_Multi_ETCL_Filter_Ntf_Seq_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Supplier
+
+Sequence_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Supplier_SOURCES = \
+ Sequence_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h
+
+Sequence_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp
new file mode 100644
index 00000000000..9a7df06e215
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.cpp
@@ -0,0 +1,86 @@
+// $Id$
+
+#include "ace/OS_NS_unistd.h"
+#include "Notify_Sequence_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "common.h"
+#include "tao/debug.h"
+
+Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer (
+ const char* name,
+ unsigned int low,
+ unsigned int high,
+ Notify_Test_Client& client)
+ : name_ (name),
+ low_ (low),
+ high_ (high),
+ count_ (0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+void
+Notify_Sequence_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::SequencePushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties properties (3);
+ properties.length (3);
+ properties[0].name = CORBA::string_dup (CosNotification::MaximumBatchSize);
+ properties[0].value <<= (CORBA::Long) 3;
+ properties[1].name = CORBA::string_dup (CosNotification::PacingInterval);
+ properties[1].value <<= (TimeBase::TimeT) 1 * 1000 * 10000;
+
+ this->proxy_->set_qos (properties);
+ this->proxy_->connect_sequence_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Sequence_Push_Consumer::push_structured_events (
+ const CosNotification::EventBatch& events
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "{%u}", events.length()));
+
+ this->count_ += events.length();
+
+ if (this->count_ > this->high_)
+ {
+ this->client_.consumer_done (this);
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too "
+ "many events received.\n")));
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ else if (this->count_ >= this->low_)
+ {
+ this->client_.consumer_done (this);
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h
new file mode 100644
index 00000000000..7a11dd60c37
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Notify_Sequence_Push_Consumer.h
@@ -0,0 +1,49 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Sequence_Push_Consumer.h
+//
+// = DESCRIPTION
+// A sequence push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+#define TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+
+#include "Notify_SequencePushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Sequence_Push_Consumer: public TAO_Notify_Tests_SequencePushConsumer
+{
+public:
+ Notify_Sequence_Push_Consumer (const char* name,
+ unsigned int low,
+ unsigned int high,
+ Notify_Test_Client& client);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+ void push_structured_events (const CosNotification::EventBatch&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ unsigned int low_;
+ unsigned int high_;
+ unsigned int count_;
+ Notify_Test_Client& client_;
+};
+
+#endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/README b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/README
new file mode 100644
index 00000000000..0aac6bd0c6c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/README
@@ -0,0 +1,36 @@
+Sequence Event ETCL Filter Test
+===============================
+
+
+Description
+-----------
+
+This test checks push supplier and push consumer ETCL event filter mechanisms.
+The supplier sends a number of events specified by the consumer. The consumer
+can filter or not filter the events and can use multiple consumers.
+The consumer may specify 'and' and/or 'or' relations on the filterable data
+contained within an event.
+
+
+Usage
+-----
+
+The test consists of a Supplier and Consumer. The usage for each as is
+follows:
+
+$ ./Sequence_Supplier
+usage: ./Sequence_Supplier -o <iorfile> -e <# of events>
+
+$ ./Sequence_Consumer -\?
+usage: ./Sequence_Consumer -k <ior> -l <low expected events>
+ -h <high expected events>
+
+To run this test, run the run_test.pl perl script.
+This script is designed to test various aspects of the filtering
+mechanism.
+
+
+Expected Results
+----------------
+The test script will display an error if for any test that fails.
+Otherwise, the test passed.
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Seq_Multi_ETCL_Filter.mpc b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Seq_Multi_ETCL_Filter.mpc
new file mode 100644
index 00000000000..5b4145b586f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Seq_Multi_ETCL_Filter.mpc
@@ -0,0 +1,38 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ avoids += ace_for_tao
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Seq Supp): notifytest {
+ avoids += ace_for_tao
+ exename = Sequence_Supplier
+
+ after += *idl
+ Source_Files {
+ Sequence_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Seq Cons): notifytest {
+ avoids += ace_for_tao
+ exename = Sequence_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Sequence_Push_Consumer.cpp
+ Sequence_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp
new file mode 100644
index 00000000000..c59a53095fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Consumer.cpp
@@ -0,0 +1,203 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_Sequence_Push_Consumer.h"
+#include "goC.h"
+
+#include "Notify_Test_Client.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static const char* ior = "file://supplier.ior";
+static unsigned int low = 32;
+static unsigned int high = 32;
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:l:h:d:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'l':
+ low = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'h':
+ high = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-l <low expected events> "
+ "-h <high expected events> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter ("EXTENDED_TCL" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if(CORBA::is_nil(filter.in()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Consumer unable to initialize filter.\n"));
+ return CosNotifyChannelAdmin::ConsumerAdmin::_nil ();
+ }
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length(1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup (
+ "$.enum < 0");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // apply filter
+ admin->add_filter (filter.in ());
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ // startup the consumer
+ Notify_Sequence_Push_Consumer* consumer_1;
+ ACE_NEW_THROW_EX (consumer_1,
+ Notify_Sequence_Push_Consumer ("consumer1",
+ low,
+ high,
+ *client),
+ CORBA::NO_MEMORY ());
+
+ consumer_1->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_1->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (sig.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_consumers (admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell the supplier to go
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp
new file mode 100644
index 00000000000..483a7446f92
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/Sequence_Supplier.cpp
@@ -0,0 +1,284 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "Notify_SequencePushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+const int PER_BATCH = 16;
+static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0;
+static int num_batches = 6; // 6 sets of 16
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:d");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'e':
+ num_batches = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvents (int id ACE_ENV_ARG_DECL)
+{
+ static const char* types[] = { "good", "bad", "ugly" };
+ CosNotification::EventBatch events;
+
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup ("Orbix 2000 Demos");
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup ("Sequence Notification Push Demo Event");
+
+ event.header.fixed_header.event_name = CORBA::string_dup ("test event");
+
+ event.header.variable_header.length (2);
+ event.header.variable_header[0].name =
+ CORBA::string_dup (CosNotification::Priority);
+ event.header.variable_header[1].name =
+ CORBA::string_dup (CosNotification::Timeout);
+
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup ("objectId");
+ event.filterable_data[1].name = CORBA::string_dup ("type");
+ event.filterable_data[2].name = CORBA::string_dup ("enum");
+
+ events.length (PER_BATCH);
+
+ for (int z = 0; z < PER_BATCH; ++z)
+ {
+ event.header.variable_header[0].value <<= (CORBA::Short)
+ (id > num_batches / 2 ?
+ -id : id);
+
+ event.filterable_data[0].value <<= (CORBA::Long)z;
+ event.filterable_data[1].value <<= types[2 - (id % 3)];
+ event.filterable_data[2].value <<= (CORBA::Long)
+ (id > num_batches / 2 ?
+ -id : id);
+
+ events[z] = event;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ supplier_1->send_events (events ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ }
+ ACE_ENDTRY;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ // start up the supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_SequencePushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_suppliers (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, " 1 supplier sending %d batches of %d events...\n", num_batches, PER_BATCH));
+ for (int i = 0; i < num_batches; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendEvents (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier waiting for consumer...\n"));
+
+ sig_impl->wait_for_completion();
+
+ ACE_DEBUG((LM_DEBUG, "\nSupplier done.\n"));
+
+ ACE_OS::unlink (ior_output_file);
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf
new file mode 100644
index 00000000000..751ea3700a2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf
@@ -0,0 +1,4 @@
+## $Id$
+#
+## Load the static Cos Notification Service
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml
new file mode 100644
index 00000000000..d03fcf8be90
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/notify.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl
new file mode 100755
index 00000000000..4cd49864e2f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl
@@ -0,0 +1,76 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$ior = PerlACE::LocalFile ("supplier.ior");
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+$status = 0;
+
+unlink $notifyior;
+
+$port = PerlACE::uniqueid () + 10001;
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port");
+$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf");
+$SES = new PerlACE::Process ("Sequence_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$SEC = new PerlACE::Process ("Sequence_Consumer");
+
+$client_args = "-ORBInitRef NameService=iioploc://localhost:" .
+ "$port/NameService";
+$NS->Spawn ();
+$TS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "************** Running Sequence Consumer ************\n";
+
+unlink $ior;
+$SES->Spawn ();
+
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+}
+
+$SEC->Arguments($client_args);
+$client = $SEC->SpawnWaitKill (60);
+if ($client != 0) {
+ print STDERR "ERROR: Sequence_Consumer did not run properly\n";
+ $status = 1;
+}
+$server = $SES->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $ior;
+unlink $notifyior;
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Makefile.am b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Makefile.am
new file mode 100644
index 00000000000..e631380281c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Makefile.am
@@ -0,0 +1,154 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Seq_Multi_Filter_Idl.am
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+## Makefile.Seq_Multi_Filter_Ntf_Seq_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Consumer
+
+Sequence_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Consumer_SOURCES = \
+ Notify_Sequence_Push_Consumer.cpp \
+ Sequence_Consumer.cpp \
+ goC.cpp \
+ Notify_Sequence_Push_Consumer.h
+
+Sequence_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Seq_Multi_Filter_Ntf_Seq_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Supplier
+
+Sequence_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Supplier_SOURCES = \
+ Sequence_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h
+
+Sequence_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp
new file mode 100644
index 00000000000..b39323d5890
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.cpp
@@ -0,0 +1,90 @@
+// $Id$
+
+#include "ace/OS_NS_unistd.h"
+#include "Notify_Sequence_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "orbsvcs/TimeBaseC.h"
+#include "common.h"
+#include "tao/debug.h"
+
+Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer (
+ const char* name,
+ unsigned int low,
+ unsigned int high,
+ Notify_Test_Client& client)
+ : name_ (name),
+ low_ (low),
+ high_ (high),
+ count_ (0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+Notify_Sequence_Push_Consumer::~Notify_Sequence_Push_Consumer ()
+{
+}
+
+
+void
+Notify_Sequence_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::SequencePushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties properties(3);
+ properties.length(3);
+ properties[0].name = CORBA::string_dup(CosNotification::MaximumBatchSize);
+ properties[0].value <<= (CORBA::Long)5;
+ properties[1].name = CORBA::string_dup(CosNotification::PacingInterval);
+ properties[1].value <<= (TimeBase::TimeT) 2 * 1000 * 10000;
+
+ proxy_->set_qos(properties);
+ proxy_->connect_sequence_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Sequence_Push_Consumer::push_structured_events(
+ const CosNotification::EventBatch& events
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "{%u}", events.length()));
+
+ this->count_ += events.length();
+ if (this->count_ > this->high_)
+ {
+ this->client_.consumer_done (this);
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT ("Sequence Consumer (%P|%t): ERROR: too "
+ "many events received.\n")));
+ }
+ else if (this->count_ >= this->low_)
+ {
+ this->client_.consumer_done (this);
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h
new file mode 100644
index 00000000000..1318d05545c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Notify_Sequence_Push_Consumer.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Sequence_Push_Consumer.h
+//
+// = DESCRIPTION
+// A sequence push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+#define TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+
+#include "Notify_SequencePushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Sequence_Push_Consumer : public TAO_Notify_Tests_SequencePushConsumer
+{
+public:
+ Notify_Sequence_Push_Consumer (const char* name,
+ unsigned int low,
+ unsigned int high,
+ Notify_Test_Client& client);
+
+ ~Notify_Sequence_Push_Consumer ();
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void push_structured_events(const CosNotification::EventBatch&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ unsigned int low_;
+ unsigned int high_;
+ unsigned int count_;
+ Notify_Test_Client& client_;
+};
+
+#endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/README b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/README
new file mode 100644
index 00000000000..13486ab0797
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/README
@@ -0,0 +1,39 @@
+Sequence Event Filter Test
+============================
+
+
+Description
+-----------
+
+This test checks push supplier and push consumer event filter mechanisms.
+The supplier sends a number of events specified by the consumer. The consumer
+can filter or not filter the events and can use multiple consumers.
+The consumer may specify 'and' and/or 'or' relations on the filterable data
+contained within an event.
+
+
+Usage
+-----
+
+The test consists of a Supplier and Consumer. The usage for each as is
+follows:
+
+$ ./Sequence_Supplier -\?
+usage: ./Sequence_Supplier -ORBInitRef <Naming Service Location>
+
+$ ./Sequence_Consumer -\?
+usage: ./Sequence_Consumer -l <low> -h high -d <discard policy> -c <constraint string>
+
+The "low" value specified the number of whole batches of events expected. The "high" value specifies the total number of batches of events expected, including any partial batches.
+
+The "constraint string" allows the TCL filter string to be specified on the command line.
+
+To run this test, run the run_test.pl perl script.
+This script is designed to test various aspects of the filtering
+mechanism.
+
+
+Expected Results
+----------------
+The test script will display an error if for any test that fails.
+Otherwise, the test passed.
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Seq_Multi_Filter.mpc b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Seq_Multi_Filter.mpc
new file mode 100644
index 00000000000..47c8459df2a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Seq_Multi_Filter.mpc
@@ -0,0 +1,36 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl) : taoidldefaults {
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Seq Supp): notifytest {
+ exename = Sequence_Supplier
+
+ after += *idl
+ Source_Files {
+ Sequence_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Seq Cons): notifytest {
+ exename = Sequence_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Sequence_Push_Consumer.cpp
+ Sequence_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp
new file mode 100644
index 00000000000..5ac22e79b8b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Consumer.cpp
@@ -0,0 +1,196 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_Sequence_Push_Consumer.h"
+#include "goC.h"
+
+#include "Notify_Test_Client.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static const char* ior = "file://supplier.ior";
+static unsigned int low = 10;
+static unsigned int high = 20;
+static CORBA::Boolean filter = 1;
+static const char* constraintString = "Number == 10";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:l:h:d:c:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'l':
+ low = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'h':
+ high = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'c':
+ constraintString = get_opts.optarg;
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-l <low expected events> "
+ "-h <high expected events> "
+ "-c <constraint string> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ // startup the first consumer
+ Notify_Sequence_Push_Consumer* consumer_1;
+ ACE_NEW_THROW_EX (consumer_1,
+ Notify_Sequence_Push_Consumer ("consumer1",
+ low,
+ high,
+ *client),
+ CORBA::NO_MEMORY ());
+ consumer_1->init(client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer_1->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(status == 0);
+ ACE_UNUSED_ARG(status);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (sig.in ()));
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (filter)
+ {
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter ("TCL" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil(filter.in()));
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length(1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup(constraintString);
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ admin->add_filter(filter.in());
+ }
+
+ ACE_ASSERT (!CORBA::is_nil (admin.in ()));
+ create_consumers(admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell the supplier to go
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp
new file mode 100644
index 00000000000..30c0a2e2b0d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/Sequence_Supplier.cpp
@@ -0,0 +1,287 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_SequencePushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+const int PER_BATCH = 4;
+static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0;
+static int num_batches = 10;
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'e':
+ num_batches = ACE_OS::atoi(get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvents (int id ACE_ENV_ARG_DECL)
+{
+ static const char* types[] = { "good", "bad", "ugly" };
+ CosNotification::EventBatch events;
+
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("Orbix 2000 Demos");
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("Sequence Notification Push Demo Event");
+
+ event.header.fixed_header.event_name = CORBA::string_dup("test event");
+
+ event.header.variable_header.length (1);
+ event.header.variable_header[0].name =
+ CORBA::string_dup(CosNotification::Priority);
+
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup("Number");
+ event.filterable_data[1].name = CORBA::string_dup("Index");
+ event.filterable_data[2].name = CORBA::string_dup("enum");
+
+ events.length(PER_BATCH);
+
+ for(int z = 0; z < PER_BATCH; ++z) {
+ event.header.variable_header[0].value <<= (CORBA::Short)
+ (id > num_batches / 2 ?
+ -id : id);
+
+ if (z % 2 == 0) {
+ event.filterable_data[0].value <<= (CORBA::Long)20;
+ } else {
+ event.filterable_data[0].value <<= (CORBA::Long)10;
+ }
+
+ event.filterable_data[1].value <<= z;
+
+ event.filterable_data[2].value <<= types[id % 3];
+ events[z] = event;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ supplier_1->send_events(events ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ }
+ ACE_ENDTRY;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ // startup the first supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_SequencePushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, " 1 supplier sending %d batches of %d events...\n", num_batches, PER_BATCH));
+ for (int i = 0; i < num_batches; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ SendEvents (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier waiting for consumer completion...\n"));
+
+ sig_impl->wait_for_completion();
+
+ ACE_DEBUG((LM_DEBUG, "\nSupplier finished.\n"));
+
+ ACE_OS::unlink (ior_output_file);
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf
new file mode 100644
index 00000000000..0e4ab7e2a46
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf
@@ -0,0 +1,5 @@
+## $Id$
+#
+## Load the static Cos Notification Service
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
+
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml
new file mode 100644
index 00000000000..829d9ba2935
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/Sequence_Multi_Filter/notify.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl
new file mode 100755
index 00000000000..490a0aa818c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl
@@ -0,0 +1,93 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$ior = PerlACE::LocalFile ("supplier.ior");
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+$status = 0;
+
+
+$port = PerlACE::uniqueid () + 10001;
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port");
+$TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf");
+$SES = new PerlACE::Process ("Sequence_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$SEC = new PerlACE::Process ("Sequence_Consumer");
+
+$client_args = "-ORBInitRef NameService=iioploc://localhost:" .
+ "$port/NameService";
+$NS->Spawn ();
+
+unlink $notifyior;
+$TS->Spawn ();
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+@low = (40, 20, 20, 20);
+@high = (40, 21, 21, 21);
+@constraintList = (
+ "\"Number == 20 or Number == 10\"",
+ "\"Number == 20 or Index == 7\"",
+ "\"Number == 20 or Index == 4\"",
+ "\"Number == 10 or (Number == 20 and Index == 1)\"",
+);
+
+$i = 0;
+
+foreach $constraintString (@constraintList) {
+ print "<*><*><*> Constraint String: $constraintString <*><*><*>\n";
+
+ unlink $ior;
+ $SES->Spawn ();
+ if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ $status = 1;
+ last;
+ }
+
+ $SEC->Arguments($client_args . " -l $low[$i] -h $high[$i] -c $constraintString");
+
+ $i = $i + 1;
+
+ $client = $SEC->SpawnWaitKill (60);
+ if ($client != 0) {
+ print STDERR "ERROR: Sequence_Consumer did not run properly\n";
+ $status = 1;
+ last;
+ }
+ $server = $SES->WaitKill(5);
+ if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+ }
+}
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $ior;
+unlink $notifyior;
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Makefile.am b/TAO/orbsvcs/tests/Notify/Structured_Filter/Makefile.am
new file mode 100644
index 00000000000..86a4ee0f29e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Makefile.am
@@ -0,0 +1,154 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Struct_Filter_Idl.am
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+## Makefile.Struct_Filter_Ntf_Struct_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Consumer
+
+Structured_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Consumer_SOURCES = \
+ Notify_Push_Consumer.cpp \
+ Structured_Consumer.cpp \
+ goC.cpp \
+ Notify_Push_Consumer.h
+
+Structured_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Struct_Filter_Ntf_Struct_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Supplier
+
+Structured_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Supplier_SOURCES = \
+ Structured_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Push_Consumer.h
+
+Structured_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp
new file mode 100644
index 00000000000..18a1c92a0d2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.cpp
@@ -0,0 +1,107 @@
+// $Id$
+#include "Notify_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "tao/debug.h"
+
+Notify_Push_Consumer::Notify_Push_Consumer (const char* name,
+ int sent,
+ bool useFilter,
+ Notify_Test_Client& client)
+: name_ (name)
+, sent_(sent)
+, received_(0)
+, expected_(sent)
+, useFilter_(useFilter)
+, client_(client)
+{
+ // By sending multiples of 9, we ensure that all combinations of group and type
+ // are possible, and that our calculations come out evenly.
+ ACE_ASSERT(sent % 9 == 0);
+
+ // This test currently only supports one expression
+ if (useFilter)
+ {
+ // group != 0 && type != 1
+ expected_ = sent_ * 4 / 9;
+ }
+
+ this->client_.consumer_start (this);
+}
+
+void
+Notify_Push_Consumer::_connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ CosNotifyChannelAdmin::EventChannel_ptr notify_channel ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_UNUSED_ARG(notify_channel);
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_->connect_structured_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+static void validate_expression(bool expr, const char* msg)
+{
+ if (! expr)
+ {
+ ACE_ERROR((LM_ERROR, "Error: %s\n", msg));
+ }
+}
+
+#define validate(expr) validate_expression(expr, #expr)
+
+void
+Notify_Push_Consumer::push_structured_event (
+ const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "-"));
+ received_++;
+
+ CORBA::ULong id = 0;
+ CORBA::ULong group = 0;
+ CORBA::ULong type = 0;
+
+ ACE_ASSERT(event.filterable_data.length() == 3);
+ ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[0].name.in(), "id") == 0);
+ ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[1].name.in(), "group") == 0);
+ ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[2].name.in(), "type") == 0);
+ event.filterable_data[0].value >>= id;
+ event.filterable_data[1].value >>= group;
+ event.filterable_data[2].value >>= type;
+
+ if (useFilter_)
+ validate(type != 1 && group != 0);
+
+ if (received_ > expected_)
+ {
+ ACE_ERROR((LM_ERROR, "\nError: Expected %d, Received %d\n", expected_, received_));
+ this->client_.consumer_done (this);
+ return;
+ }
+ if (received_ >= expected_)
+ {
+ ACE_DEBUG((LM_DEBUG, "\nConsumer received %d events.\n", received_));
+ this->client_.consumer_done (this);
+ return;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h
new file mode 100644
index 00000000000..833b1be664b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Notify_Push_Consumer.h
@@ -0,0 +1,46 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Structured_Filter
+//
+// = FILENAME
+// Notify_Push_Consumer.h
+//
+// = DESCRIPTION
+// A structured push consumer implementation.
+//
+// = AUTHOR
+// Chip Jones <jones_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef NOTIFY_PUSH_CONSUMER_H
+#define NOTIFY_PUSH_CONSUMER_H
+
+#include "Notify_StructuredPushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Notify_Push_Consumer (const char* name, int sent, bool useFilter, Notify_Test_Client& client);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ CosNotifyChannelAdmin::EventChannel_ptr ec ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void push_structured_event (const CosNotification::StructuredEvent& ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+private:
+ ACE_CString name_;
+ CORBA::Long sent_;
+ CORBA::Long received_;
+ CORBA::Long expected_;
+ bool useFilter_;
+ Notify_Test_Client& client_;
+};
+
+#endif /* NOTIFY_PUSH_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/README b/TAO/orbsvcs/tests/Notify/Structured_Filter/README
new file mode 100644
index 00000000000..879ed382a1c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/README
@@ -0,0 +1,36 @@
+Structured Event Filter Test
+============================
+
+
+Description
+-----------
+
+This test checks push supplier and push consumer event filter mechanisms.
+The supplier sends a number of events specified by the consumer. The consumer
+can filter or not filter the events and can use multiple consumers.
+If filtered, the consumer will receive 1/3 of the total events.
+
+
+Usage
+-----
+
+The test consists of a Supplier and Consumer. The usage for each as is
+follows:
+
+$ Structured_Supplier
+usage: ./Structured_Supplier -ORBInitRef <Naming Service Location>
+
+$ Structured_Consumer -\?
+usage: ./Structured_Consumer [-f] -n <num events> -c <num consumers> \
+ -ORBInitRef <Naming Service Location>
+
+The -f option applies an event filter to the consumer. The -c option lets
+the user specify the number of consumers to use.
+
+To run this test, run the run_test.pl perl script.
+
+
+Expected Results
+----------------
+The test script will display an error if for any test that fails.
+Otherwise, the test passed. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc b/TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc
new file mode 100644
index 00000000000..76ff20df96e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Struct_Filter.mpc
@@ -0,0 +1,35 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl) : taoidldefaults {
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Struct Supp): notifytest {
+ exename = Structured_Supplier
+
+ after += *idl
+ Source_Files {
+ Structured_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Struct Cons): notifytest {
+ exename = Structured_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Push_Consumer.cpp
+ Structured_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp
new file mode 100644
index 00000000000..7f41538007e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Consumer.cpp
@@ -0,0 +1,158 @@
+// $Id$
+
+#include "goC.h"
+#include "Notify_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_strings.h"
+
+static const char* ior = "file://supplier.ior";
+static int numEvents = 90;
+static Notify_Push_Consumer* consumer = 0;
+static bool useFilter = false;
+
+static const char* GRAMMAR = "TCL";
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "fe:");
+ int x;
+
+ while ((x = get_opts ()) != -1)
+ switch (x)
+ {
+ case 'e':
+ numEvents = atoi (get_opts.optarg);
+ break;
+
+ case 'f':
+ useFilter = true;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s -n <num events> [-f]\n", argv [0]), -1);
+ }
+
+ return 0; // successful parse
+}
+
+static void
+create_consumer (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ CosNotifyChannelAdmin::EventChannel_ptr ec,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (consumer,
+ Notify_Push_Consumer ("Consumer", numEvents, useFilter, *client),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer->_connect (admin, ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int main (int argc, char * argv[])
+{
+ ACE_TRY_NEW_ENV;
+ {
+ Consumer_Client client;
+
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1 ACE_ENV_ARG_PARAMETER);
+
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers(CosNotifyChannelAdmin::AND_OP, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (consumer_admin.in ()));
+
+ if (useFilter)
+ {
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (filter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Consumer unable to initialize filter.\n"));
+ 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 ("type != 1 and group != 0");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer_admin->add_filter (filter.in ());
+ }
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (sig.in ()));
+
+ create_consumer (consumer_admin.in (), ec.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "\nConsumer waiting for events...\n"));
+
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "\nConsumer done.\n"));
+
+ sig->done(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "\nError: Consumer:");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp
new file mode 100644
index 00000000000..161d3f3e8c4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/Structured_Supplier.cpp
@@ -0,0 +1,204 @@
+// $Id$
+
+// A Standard simple supplier.
+// All filtering is done on the consumer side.
+
+#include "Notify_StructuredPushSupplier.h"
+#include "goS.h"
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_unistd.h"
+
+static const char* ior_file = "supplier.ior";
+static TAO_Notify_Tests_StructuredPushSupplier* supplier = 0;
+static int num_events = 90;
+
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+int
+send_event (int id)
+{
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup ("TAO Test Suite");
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup ("Filtered Structured Event Notification Svc test");
+
+ event.header.fixed_header.event_name = CORBA::string_dup ("test");
+ event.header.variable_header.length (1);
+
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup ("id");
+ event.filterable_data[0].value <<= static_cast<CORBA::ULong>(id);
+ event.filterable_data[1].name = CORBA::string_dup ("group");
+ event.filterable_data[1].value <<= static_cast<CORBA::ULong>(id % 3);
+ event.filterable_data[2].name = CORBA::string_dup ("type");
+ // Divide by 3 first so that the type and group aren't synched
+ event.filterable_data[2].value <<= static_cast<CORBA::ULong>(id / 3 % 3);
+
+ ACE_TRY_NEW_ENV
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+
+ supplier->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "\nError: Supplier: ");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+static void create_supplier (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (supplier,
+ TAO_Notify_Tests_StructuredPushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int main (int argc, char * argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV;
+ {
+ Notify_Test_Client client;
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil(ec.in()));
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_ASSERT(! CORBA::is_nil (admin.in ()));
+
+ create_supplier (admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+
+ if (ior_file != 0)
+ {
+ CORBA::String_var ior =
+ client.orb ()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE *output_file= ACE_OS::fopen (ior_file, "w");
+ ACE_ASSERT (output_file != 0);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ ACE_DEBUG((LM_DEBUG, "Supplier ready...\n"));
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "Supplier sending %d events...\n", num_events));
+ for (int i = 0; i < num_events; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ send_event (i);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_file);
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/go.idl b/TAO/orbsvcs/tests/Notify/Structured_Filter/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf
new file mode 100644
index 00000000000..c8b44b649f0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/notify.conf
@@ -0,0 +1,3 @@
+## $Id$
+#
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl
new file mode 100755
index 00000000000..53d2f1d82d2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl
@@ -0,0 +1,119 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use strict;
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+my $ior = PerlACE::LocalFile ("supplier.ior");
+my $namingior = PerlACE::LocalFile ("naming.ior");
+my $notifyior = PerlACE::LocalFile ("notify.ior");
+my $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+
+my $status = 0;
+
+my $port = PerlACE::uniqueid () + 10005;
+my $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port " .
+ "-o $namingior");
+my $TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf" );
+my $STS = new PerlACE::Process ("Structured_Supplier");
+
+my $STC = new PerlACE::Process ("Structured_Consumer");
+
+my $args = " -ORBInitRef NameService=iioploc://localhost:$port/NameService ";
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+$NS->Spawn ();
+if (PerlACE::waitforfile_timed ($namingior, 20) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Spawn ();
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+print "\n**** Testing with no filtering ****\n";
+
+$STS->Arguments($args);
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$STC->Arguments($args);
+my $client = $STC->SpawnWaitKill(20);
+if ($client != 0) {
+ print STDERR "ERROR: Structured_Consumer did not run properly\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ $STS->Kill();
+ exit 1;
+}
+my $server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+unlink $ior;
+
+print "\n**** Testing with filtering ****\n";
+
+$STS->Arguments($args);
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$STC->Arguments("-f $args");
+my $client = $STC->SpawnWaitKill(20);
+if ($client != 0) {
+ print STDERR "ERROR: Structured_Consumer did not run properly\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ $STS->Kill();
+ exit 1;
+}
+
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Makefile.am b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Makefile.am
new file mode 100644
index 00000000000..34ce6df284b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Makefile.am
@@ -0,0 +1,155 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Struct_Multi_Filter_Idl.am
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+## Makefile.Struct_Multi_Filter_Ntf_Struct_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Consumer
+
+Structured_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Consumer_SOURCES = \
+ Notify_Push_Consumer.cpp \
+ Structured_Consumer.cpp \
+ goC.cpp \
+ Notify_Push_Consumer.h
+
+Structured_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Struct_Multi_Filter_Ntf_Struct_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Supplier
+
+Structured_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Supplier_SOURCES = \
+ Notify_Push_Supplier.cpp \
+ Structured_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Push_Supplier.h
+
+Structured_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp
new file mode 100644
index 00000000000..232c98a0f45
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.cpp
@@ -0,0 +1,185 @@
+// $Id$
+#include "Notify_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "tao/debug.h"
+
+Notify_Push_Consumer::Notify_Push_Consumer (const char* name,
+ int sent,
+ NS_FilterType consumerFilter,
+ NS_FilterType supplierFilter,
+ Notify_Test_Client& client)
+: name_ (name)
+, sent_(sent)
+, received_(0)
+, expected_(sent)
+, client_(client)
+, consumerFilter_(consumerFilter)
+, supplierFilter_(supplierFilter)
+{
+ // Calculate the expected number.
+ ACE_ASSERT(sent % 9 == 0);
+
+ // The supplier side filters combine group != 0 and type != 0, while the
+ // consumer side combines group != 1 and type != 1
+ if (consumerFilter == AndOp && supplierFilter == AndOp)
+ {
+ // group != 0 && type != 0 && group != 1 && type != 1
+ expected_ = sent_ / 9;
+ }
+ else if (consumerFilter == AndOp && supplierFilter == OrOp)
+ {
+ // group != 0 || type != 0 && group != 1 && type != 1
+ expected_ = sent_ * 3 / 9;
+ }
+ else if (consumerFilter == AndOp && supplierFilter == None)
+ {
+ // group != 1 && type != 1
+ expected_ = sent_ * 4 / 9;
+ }
+ else if (consumerFilter == OrOp && supplierFilter == AndOp)
+ {
+ // group != 0 && type != 0 && group != 1 || type != 1
+ expected_ = sent_ * 3 / 9;
+ }
+ else if (consumerFilter == OrOp && supplierFilter == OrOp)
+ {
+ // group != 0 || type != 0 && group != 1 || type != 1
+ expected_ = sent_ * 7 / 9;
+ }
+ else if (consumerFilter == OrOp && supplierFilter == None)
+ {
+ // group != 1 || type != 1
+ expected_ = sent_ * 8 / 9;
+ }
+ else if (consumerFilter == None && supplierFilter == OrOp)
+ {
+ // group != 0 && type != 0
+ expected_ = sent_ * 8 / 9;
+ }
+ else if (consumerFilter == None && supplierFilter == AndOp)
+ {
+ // group != 0 && type != 0
+ expected_ = sent_ * 4 / 9;
+ }
+ else if (consumerFilter == None && supplierFilter == None)
+ {
+ expected_ = sent_;
+ }
+ else
+ {
+ bool unknown_filter_combination = false;
+ ACE_ASSERT(unknown_filter_combination);
+ ACE_UNUSED_ARG(unknown_filter_combination);
+ }
+
+ this->client_.consumer_start (this);
+}
+
+void
+Notify_Push_Consumer::_connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ CosNotifyChannelAdmin::EventChannel_ptr notify_channel ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (consumerFilter_ != None)
+ {
+ CosNotifyFilter::FilterFactory_var ffact =
+ notify_channel->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter ("TCL" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (filter.in ()));
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup ("group != 1");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ proxysupplier->add_filter (filter.in ());
+ }
+
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_->connect_structured_push_consumer (objref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+static void validate_expression(bool expr, const char* msg)
+{
+ if (! expr)
+ {
+ ACE_ERROR((LM_ERROR, "Error: %s\n", msg));
+ }
+}
+
+#define validate(expr) validate_expression(expr, #expr)
+
+void
+Notify_Push_Consumer::push_structured_event (
+ const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_DEBUG, "-"));
+ received_++;
+
+ CORBA::ULong id = 0;
+ CORBA::ULong group = 0;
+ CORBA::ULong type = 0;
+
+ ACE_ASSERT(event.filterable_data.length() == 3);
+ ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[0].name.in(), "id") == 0);
+ ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[1].name.in(), "group") == 0);
+ ACE_ASSERT(ACE_OS::strcmp(event.filterable_data[2].name.in(), "type") == 0);
+ event.filterable_data[0].value >>= id;
+ event.filterable_data[1].value >>= group;
+ event.filterable_data[2].value >>= type;
+
+ if (consumerFilter_ == OrOp)
+ validate(type != 1 || group != 1);
+ else if (consumerFilter_ == AndOp)
+ validate(type != 1 && group != 1);
+
+ if (supplierFilter_ == OrOp)
+ validate(type != 0 || group != 0);
+ else if (supplierFilter_ == OrOp)
+ validate(type != 0 && group != 0);
+
+ if (received_ > expected_)
+ {
+ ACE_ERROR((LM_ERROR, "\nError: Expected %d, Received %d\n", expected_, received_));
+ this->client_.consumer_done (this);
+ return;
+ }
+ if (received_ >= expected_)
+ {
+ ACE_DEBUG((LM_DEBUG, "\nConsumer received %d events.\n", received_));
+ this->client_.consumer_done (this);
+ return;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h
new file mode 100644
index 00000000000..6231ecb69f7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Consumer.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Structured_Filter
+//
+// = FILENAME
+// Notify_Push_Consumer.h
+//
+// = DESCRIPTION
+// A structured push consumer implementation.
+//
+// = AUTHOR
+// Chip Jones <jones_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef NOTIFY_PUSH_CONSUMER_H
+#define NOTIFY_PUSH_CONSUMER_H
+
+#include "Notify_StructuredPushConsumer.h"
+
+class Notify_Test_Client;
+
+enum NS_FilterType {None, AndOp, OrOp};
+
+class Notify_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Notify_Push_Consumer (const char* name, int sent, NS_FilterType consumerFilter,
+ NS_FilterType supplierFilter, Notify_Test_Client& client);
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin,
+ CosNotifyChannelAdmin::EventChannel_ptr ec ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void push_structured_event (const CosNotification::StructuredEvent& ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+private:
+ ACE_CString name_;
+ CORBA::Long sent_;
+ CORBA::Long received_;
+ CORBA::Long expected_;
+ Notify_Test_Client& client_;
+ NS_FilterType consumerFilter_;
+ NS_FilterType supplierFilter_;
+};
+
+#endif /* NOTIFY_PUSH_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp
new file mode 100644
index 00000000000..352ef42df08
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.cpp
@@ -0,0 +1,58 @@
+// $Id$
+#include "Notify_Push_Supplier.h"
+
+void
+Notify_Push_Supplier::_connect (
+ CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ CosNotifyChannelAdmin::EventChannel_ptr notify_channel,
+ bool useFilter
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::StructuredPushSupplier_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer =
+ supplier_admin->obtain_notification_push_consumer (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (useFilter)
+ {
+ CosNotifyFilter::FilterFactory_var ffact =
+ notify_channel->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter ("TCL" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (filter.in ()));
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup ("group != 0");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ proxyconsumer->add_filter (filter.in ());
+ }
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow (
+ proxyconsumer.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_->connect_structured_push_supplier (objref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h
new file mode 100644
index 00000000000..03f5844fb5d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Notify_Push_Supplier.h
@@ -0,0 +1,18 @@
+// $Id$
+#ifndef NOTIFY_PUSH_SUPPLIER_H
+#define NOTIFY_PUSH_SUPPLIER_H
+
+#include "Notify_StructuredPushSupplier.h"
+
+
+class Notify_Push_Supplier: public TAO_Notify_Tests_StructuredPushSupplier
+{
+public:
+ void _connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin,
+ CosNotifyChannelAdmin::EventChannel_ptr notify_channel,
+ bool useFilter
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+#endif /* NOTIFY_PUSH_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/README b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/README
new file mode 100644
index 00000000000..30fd2d5d9f7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/README
@@ -0,0 +1,39 @@
+Structured Event InterFilterGroupOperator Test
+==============================================
+
+
+Description
+-----------
+
+This test checks push supplier and push consumer event logical operators
+between the Supplier/Consumer admins and their proxies. The supplier sends
+a number of events specified by the consumer. The supplier and consumer can
+filter or not filter the events, and can AND and OR the proxy and admin
+filters.
+
+
+Usage
+-----
+
+The test consists of a Supplier and Consumer. The usage for each as is
+follows:
+
+$ Structured_Supplier
+usage: ./Structured_Supplier [-f] -o <AND_OP | OR_OP> \
+ -ORBInitRef <Naming Service Location>
+
+$ Structured_Consumer -\?
+usage: ./Structured_Consumer [-f] [-s] -n <num events> -c <num consumers> \
+ -o <AND_OP | OR_OP> -ORBInitRef <Naming Service Location>
+
+The -f option applies an the event filter to the supplier or consumer.
+The -s option alerts the consumer to supplier filtering.
+The -c option lets the user specify the number of consumers to use.
+
+To run this test, run the run_test.pl perl script.
+
+
+Expected Results
+----------------
+The test script will display an error if for any test that fails.
+Otherwise, the test passed.
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc
new file mode 100644
index 00000000000..a7e74492d15
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Struct_Multi_Filter.mpc
@@ -0,0 +1,37 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl) : taoidldefaults {
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Struct Supp): notifytest {
+ exename = Structured_Supplier
+
+ after += *idl
+ Source_Files {
+ Notify_Push_Supplier.cpp
+ Structured_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Struct Cons): notifytest {
+ exename = Structured_Consumer
+
+ after += *idl
+ Source_Files {
+ goC.cpp
+ Notify_Push_Consumer.cpp
+ Structured_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp
new file mode 100644
index 00000000000..eb633882bcc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Consumer.cpp
@@ -0,0 +1,180 @@
+// $Id$
+
+#include "goC.h"
+#include "Notify_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_strings.h"
+
+static const char* ior = "file://supplier.ior";
+static NS_FilterType consumerFilter = None;
+static NS_FilterType supplierFilter = None;
+static int numEvents = 90; // Must be multiple of 9
+static Notify_Push_Consumer* consumer = 0;
+
+static const char* GRAMMAR = "TCL";
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "f:s:e:");
+ int x;
+
+ while ((x = get_opts ()) != -1)
+ switch (x)
+ {
+ case 'e':
+ numEvents = atoi (get_opts.optarg);
+ break;
+
+ case 'f':
+ if (ACE_OS::strcasecmp ("OR", get_opts.optarg) == 0)
+ consumerFilter = OrOp;
+ else
+ consumerFilter = AndOp;
+ break;
+
+ case 's':
+ if (ACE_OS::strcasecmp ("OR", get_opts.optarg) == 0)
+ supplierFilter = OrOp;
+ else
+ supplierFilter = AndOp;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "[-s <AND | OR>] -n <num events> "
+ "[-f <AND | OR>]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ return 0; // successful parse
+}
+
+static void
+create_consumer (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ CosNotifyChannelAdmin::EventChannel_ptr ec,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (consumer,
+ Notify_Push_Consumer ("Consumer", numEvents, consumerFilter,
+ supplierFilter, *client),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer->_connect (admin, ec ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int main (int argc, char * argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (status != 0)
+ {
+ ACE_ERROR((LM_ERROR, "Error: Unable to init consumer.\n"));
+ return 1;
+ }
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("Struct_Multi_Filter", 1 ACE_ENV_ARG_PARAMETER);
+
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
+ ec->new_for_consumers ((consumerFilter == OrOp
+ ? CosNotifyChannelAdmin::OR_OP : CosNotifyChannelAdmin::AND_OP),
+ adminid ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (consumer_admin.in ()));
+
+ if (consumerFilter != None)
+ {
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (filter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Consumer unable to initialize filter.\n"));
+ 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 ("type != 1");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ consumer_admin->add_filter (filter.in ());
+ }
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (sig.in ()));
+
+ create_consumer (consumer_admin.in (), ec.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "\nConsumer waiting for events...\n"));
+
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "\nConsumer done.\n"));
+
+ sig->done(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "\nError: Consumer:");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp
new file mode 100644
index 00000000000..69463ea273a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/Structured_Supplier.cpp
@@ -0,0 +1,281 @@
+// $Id$
+
+#include "Notify_Push_Supplier.h"
+#include "goS.h"
+#include "Notify_Test_Client.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_strings.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/OS_NS_unistd.h"
+
+static const char* ior_file = "supplier.ior";
+static bool useFilters = false;
+static Notify_Push_Supplier* supplier = 0;
+static bool use_or_operator = false;
+static int num_events = 90;
+
+static const char* GRAMMAR = "TCL";
+
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "e:f:");
+ int x;
+
+ while ((x = get_opts ()) != -1)
+ switch (x)
+ {
+ case 'f':
+ useFilters = true;
+ if (ACE_OS::strcasecmp ("OR", get_opts.optarg) == 0)
+ use_or_operator = true;
+ break;
+
+ case 'e':
+ num_events = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "[-f] [-e num_events] -o <AND | OR>"
+ " -ORBInitRef <Naming Service Location>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ return 0; // successful parse
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers ((use_or_operator ? CosNotifyChannelAdmin::OR_OP :
+ CosNotifyChannelAdmin::AND_OP),
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+int
+send_event (int id)
+{
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup ("TAO Test Suite");
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup ("Filtered Structured Event Notification Svc test");
+
+ event.header.fixed_header.event_name = CORBA::string_dup ("test");
+ event.header.variable_header.length (1);
+
+ event.filterable_data.length (3);
+ event.filterable_data[0].name = CORBA::string_dup ("id");
+ event.filterable_data[0].value <<= static_cast<CORBA::ULong>(id);
+ event.filterable_data[1].name = CORBA::string_dup ("group");
+ event.filterable_data[1].value <<= static_cast<CORBA::ULong>(id % 3);
+ event.filterable_data[2].name = CORBA::string_dup ("type");
+ // Divide by 3 first so that the type and group aren't synched
+ event.filterable_data[2].value <<= static_cast<CORBA::ULong>(id / 3 % 3);
+
+ ACE_TRY_NEW_ENV
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+
+ supplier->send_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "\nError: Supplier: ");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+static void create_supplier (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ CosNotifyChannelAdmin::EventChannel_ptr ec,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ ACE_NEW_THROW_EX (supplier,
+ Notify_Push_Supplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier->_connect (admin, ec, useFilters ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void add_admin_filter (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ CosNotifyChannelAdmin::EventChannel_ptr notify_channel
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyFilter::FilterFactory_var ffact =
+ notify_channel->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT(!CORBA::is_nil (filter.in ()));
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup ("type != 0");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int main (int argc, char * argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ ACE_TRY_NEW_ENV;
+ {
+ Supplier_Client client;
+ int status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_UNUSED_ARG(status);
+ ACE_ASSERT(status == 0);
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("Struct_Multi_Filter", 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil(ec.in()));
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+
+ if (useFilters)
+ {
+ add_admin_filter (admin.in (), ec.in () ACE_ENV_ARG_PARAMETER);
+ }
+
+ ACE_ASSERT(! CORBA::is_nil (admin.in ()));
+
+ create_supplier (admin.in(), ec.in(), client.root_poa() ACE_ENV_ARG_PARAMETER);
+
+ // If the ior_file exists, output the ior to it
+ if (ior_file != 0)
+ {
+ CORBA::String_var ior =
+ client.orb ()->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE *output_file= ACE_OS::fopen (ior_file, "w");
+ ACE_ASSERT (output_file != 0);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ ACE_DEBUG((LM_DEBUG, "Supplier ready...\n"));
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "Supplier sending %d events...\n", num_events));
+ for (int i = 0; i < num_events; ++i)
+ {
+ ACE_DEBUG((LM_DEBUG, "+"));
+ send_event (i);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", num_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_file);
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return 0;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier: ");
+ }
+ ACE_ENDTRY;
+
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/go.idl b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf
new file mode 100644
index 00000000000..a1c39a03050
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/notify.conf
@@ -0,0 +1,4 @@
+## $Id$
+#
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
+
diff --git a/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl
new file mode 100755
index 00000000000..d17cca1d9d9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl
@@ -0,0 +1,111 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use strict;
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+my $ior = PerlACE::LocalFile ("supplier.ior");
+my $namingior = PerlACE::LocalFile ("naming.ior");
+my $notifyior = PerlACE::LocalFile ("notify.ior");
+my $notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+
+my $status = 0;
+
+my $port = PerlACE::uniqueid () + 10005;
+my $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port " .
+ "-o $namingior");
+my $TS = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf" );
+my $STS = new PerlACE::Process ("Structured_Supplier");
+
+my $STC = new PerlACE::Process ("Structured_Consumer");
+
+my $args = " -ORBInitRef NameService=iioploc://localhost:$port/NameService ";
+
+my @ops = (undef, "AND", "OR");
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+$NS->Spawn ();
+if (PerlACE::waitforfile_timed ($namingior, 20) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Spawn ();
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+foreach my $supplier_op (@ops)
+{
+ foreach my $consumer_op (@ops)
+ {
+ my $supplier_args = "";
+ if (defined $supplier_op) {
+ $supplier_args .= " -f $supplier_op";
+ }
+
+ my $consumer_args = "";
+ if (defined $supplier_op) {
+ $consumer_args .= " -s $supplier_op";
+ }
+ if (defined $consumer_op) {
+ $consumer_args .= " -f $consumer_op";
+ }
+
+ print "\n**** Testing with $consumer_args ****\n";
+
+ $STS->Arguments($supplier_args . $args);
+ $STS->Spawn ();
+ if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $status = 1;
+ last;
+ }
+
+ $STC->Arguments($consumer_args . $args);
+ my $client = $STC->SpawnWaitKill(20);
+ if ($client != 0) {
+ print STDERR "ERROR: Structured_Consumer did not run properly\n";
+ $status = 1;
+ last;
+ }
+ my $server = $STS->WaitKill(5);
+ if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+ }
+
+ unlink $ior;
+ }
+ if ($status == 1) {
+ last;
+ }
+}
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $notifyior;
+unlink $namingior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/Makefile.am b/TAO/orbsvcs/tests/Notify/Test_Filter/Makefile.am
new file mode 100644
index 00000000000..98815fbca6e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Test_Filter/Makefile.am
@@ -0,0 +1,51 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.TAO_RT_NotifyTests_Filter.am
+
+if BUILD_RT_CORBA
+if !BUILD_MINIMUM_CORBA
+
+noinst_LTLIBRARIES = libTAO_RT_NotifyTests_Filter.la
+
+libTAO_RT_NotifyTests_Filter_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL \
+ -DTAO_RT_Test_Filter_BUILD_DLL
+
+libTAO_RT_NotifyTests_Filter_la_SOURCES = \
+ RT_Test_Filter.cpp \
+ RT_Test_FilterFactory.cpp
+
+noinst_HEADERS = \
+ RT_Test_Filter.h \
+ RT_Test_FilterFactory.h
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_RT_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp
new file mode 100644
index 00000000000..07ba1cbfdd9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.cpp
@@ -0,0 +1,292 @@
+// $Id$
+
+#include "RT_Test_Filter.h"
+
+ACE_RCSID(Notify, TAO_RT_Test_Filter, "$Id$")
+
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/RTCORBA/Thread_Pool.h"
+#include "tao/PortableServer/Root_POA.h"
+
+TAO_Notify_Tests_RT_Test_Filter::TAO_Notify_Tests_RT_Test_Filter (void)
+ : expected_pool_id_ (0)
+ , expected_lane_id_ (0)
+{
+}
+
+TAO_Notify_Tests_RT_Test_Filter::~TAO_Notify_Tests_RT_Test_Filter ()
+{
+
+}
+
+char*
+TAO_Notify_Tests_RT_Test_Filter::constraint_grammar (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ return CORBA::string_dup ("ETCL");
+}
+
+
+CosNotifyFilter::ConstraintInfoSeq*
+TAO_Notify_Tests_RT_Test_Filter::add_constraints (const CosNotifyFilter::ConstraintExpSeq& constraint_list
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidConstraint
+ ))
+{
+ const char* PoolId_prefix = "PoolId = ";
+ size_t poolId_index = ACE_OS::strlen (PoolId_prefix);
+
+ const char* LaneId_prefix = "LaneId = ";
+ size_t laneId_index = ACE_OS::strlen (LaneId_prefix);
+
+ for (CORBA::ULong i = 0; i < constraint_list.length (); ++i)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%t) received = %s\n", constraint_list[i].constraint_expr.in ()));
+
+ // Check Poolid
+ if (ACE_OS::strncmp (constraint_list[i].constraint_expr.in (), PoolId_prefix, poolId_index) == 0)
+ {
+ if (ACE_OS::strlen (constraint_list[i].constraint_expr) > poolId_index)
+ {
+ this->expected_pool_id_ = ACE_OS::atoi (&constraint_list[i].constraint_expr[poolId_index]);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%t) Parsed Pool Id = %d\n", this->expected_pool_id_));
+ }
+ }
+ // Check Poolid
+ else if (ACE_OS::strncmp (constraint_list[i].constraint_expr.in (), LaneId_prefix, laneId_index) == 0)
+ {
+ if (ACE_OS::strlen (constraint_list[i].constraint_expr) > laneId_index)
+ {
+ this->expected_lane_id_ = ACE_OS::atoi (&constraint_list[i].constraint_expr[laneId_index]);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%t) Parsed Lane Id = %d\n", this->expected_lane_id_));
+ }
+ }
+ }
+
+ // Create the list that goes out.
+ CosNotifyFilter::ConstraintInfoSeq* infoseq_ptr;
+ ACE_NEW_THROW_EX (infoseq_ptr,
+ CosNotifyFilter::ConstraintInfoSeq (0),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK_RETURN (0);
+
+ return infoseq_ptr;
+}
+
+void
+TAO_Notify_Tests_RT_Test_Filter::modify_constraints (const CosNotifyFilter::ConstraintIDSeq & /*del_list*/,
+ const CosNotifyFilter::ConstraintInfoSeq & /*modify_list*/
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidConstraint,
+ CosNotifyFilter::ConstraintNotFound
+ ))
+{
+
+}
+
+CosNotifyFilter::ConstraintInfoSeq*
+TAO_Notify_Tests_RT_Test_Filter::get_constraints (const CosNotifyFilter::ConstraintIDSeq & /*id_list*/
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyFilter::ConstraintNotFound))
+{
+ return 0;
+}
+
+CosNotifyFilter::ConstraintInfoSeq *
+TAO_Notify_Tests_RT_Test_Filter::get_all_constraints (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return 0;
+}
+
+void
+TAO_Notify_Tests_RT_Test_Filter::remove_all_constraints (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+}
+
+void
+TAO_Notify_Tests_RT_Test_Filter::destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ PortableServer::POA_var my_POA = _default_POA ();
+
+ PortableServer::ObjectId_var refTemp = my_POA->servant_to_id (this);
+
+ my_POA->deactivate_object (refTemp.in ());
+}
+
+CORBA::Boolean
+TAO_Notify_Tests_RT_Test_Filter::match (const CORBA::Any & /*filterable_data */
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ 0);
+}
+
+CORBA::Boolean
+TAO_Notify_Tests_RT_Test_Filter::match_structured (const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK_RETURN (0);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO_Notify_Tests_RT_Test_Filter (%x) ::match_structured (%t)\n", this));
+
+ TAO_Root_POA *poa = dynamic_cast<TAO_Root_POA*>(this->_default_POA ());
+
+ ACE_ASSERT (poa != 0);
+
+ CORBA::ORB_ptr orb = poa->orb_core ().orb ();
+
+ CORBA::Object_var object =
+ orb->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ RTCORBA::Current_var current =
+ RTCORBA::Current::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Get the ORB_Core's TSS resources.
+ TAO_ORB_Core_TSS_Resources *tss =
+ orb->orb_core ()->get_tss_resources ();
+
+ // Get the lane attribute in TSS.
+ TAO_Thread_Lane *lane =
+ (TAO_Thread_Lane *) tss->lane_;
+
+ // Check if the event carries a Priority.
+ const CosNotification::PropertySeq& prop_seq = notification.header.variable_header;
+
+ for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
+ {
+ if (ACE_OS::strcmp (prop_seq[i].name.in (), CosNotification::Priority) == 0)
+ {
+ CORBA::Short event_priority = 0;
+ prop_seq[i].value >>= event_priority;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,"(%P, %t) Event at %d priority, expected at %d\n",
+ current->the_priority (), event_priority));
+
+ if (current->the_priority () != event_priority)
+ {
+ ACE_DEBUG ((LM_DEBUG,"(%t) Error: Event at %d priority, expected at %d\n",
+ current->the_priority (), event_priority));
+ }
+
+ break;
+ }
+ }
+
+ if (lane)
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ " (%t) Expected (pool = %d; lane = %d), Received (pool = %d; lane = %d)\n",
+ this->expected_pool_id_,
+ this->expected_lane_id_,
+ lane->pool ().id (),
+ lane->id ()));
+
+ if (this->expected_lane_id_ != lane->id ()
+ ||
+ this->expected_pool_id_ != lane->pool ().id ())
+ ACE_DEBUG ((LM_DEBUG,
+ " (%t) Error: Expected (pool = %d; lane = %d), Received (pool = %d; lane = %d)\n",
+ this->expected_pool_id_,
+ this->expected_lane_id_,
+ lane->pool ().id (),
+ lane->id ()));
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ " (%t)(default thread pool) Expected (pool = %d; lane = %d)\n",
+ this->expected_pool_id_,
+ this->expected_lane_id_));
+
+ if (this->expected_lane_id_ != 0
+ ||
+ this->expected_pool_id_ != 0)
+ ACE_DEBUG ((LM_DEBUG,
+ " (%t) Error: (default thread pool) Expected (pool = %d; lane = %d)\n",
+ this->expected_pool_id_,
+ this->expected_lane_id_));
+ }
+
+ return 1;
+}
+
+CORBA::Boolean
+TAO_Notify_Tests_RT_Test_Filter::match_typed (
+ const CosNotification::PropertySeq & /* filterable_data */
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC (( CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ 0);
+}
+
+CosNotifyFilter::CallbackID
+TAO_Notify_Tests_RT_Test_Filter::attach_callback (
+ CosNotifyComm::NotifySubscribe_ptr /* callback */
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ 0);
+}
+
+void
+TAO_Notify_Tests_RT_Test_Filter::detach_callback (
+ CosNotifyFilter::CallbackID /* callback */
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyFilter::CallbackNotFound))
+{
+ ACE_THROW (CORBA::NO_IMPLEMENT ());
+}
+
+CosNotifyFilter::CallbackIDSeq *
+TAO_Notify_Tests_RT_Test_Filter::get_callbacks (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
+ 0);
+}
diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h
new file mode 100644
index 00000000000..3ca5f7d6445
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_Filter.h
@@ -0,0 +1,136 @@
+/* -*- C++ -*- */
+/**
+ * @file RT_Test_Filter.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_RT_Test_FILTER_H
+#define TAO_Notify_Tests_RT_Test_FILTER_H
+#include /**/ "ace/pre.h"
+
+#include "rt_test_filter_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyFilterS.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class TAO_RT_Test_Filter
+ *
+ * @brief Implementation of CosNotifyFilter::Filter servant.
+ *
+ */
+class TAO_RT_Test_Filter_Export TAO_Notify_Tests_RT_Test_Filter
+ : public POA_CosNotifyFilter::Filter
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_RT_Test_Filter (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_RT_Test_Filter ();
+
+protected:
+ virtual char * constraint_grammar (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual CosNotifyFilter::ConstraintInfoSeq * add_constraints (const CosNotifyFilter::ConstraintExpSeq & constraint_list ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidConstraint
+ ));
+
+ virtual void modify_constraints (const CosNotifyFilter::ConstraintIDSeq & del_list,
+ const CosNotifyFilter::ConstraintInfoSeq & modify_list
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidConstraint,
+ CosNotifyFilter::ConstraintNotFound
+ ));
+
+ virtual CosNotifyFilter::ConstraintInfoSeq * get_constraints (const CosNotifyFilter::ConstraintIDSeq & id_list ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::ConstraintNotFound
+ ));
+
+ virtual CosNotifyFilter::ConstraintInfoSeq * get_all_constraints (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void remove_all_constraints (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual CORBA::Boolean match (const CORBA::Any & filterable_data ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ));
+
+ virtual CORBA::Boolean match_structured (const CosNotification::StructuredEvent & filterable_data ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ));
+
+ virtual CORBA::Boolean match_typed (const CosNotification::PropertySeq & filterable_data ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::UnsupportedFilterableData
+ ));
+
+ virtual CosNotifyFilter::CallbackID attach_callback (CosNotifyComm::NotifySubscribe_ptr callback ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual void detach_callback (CosNotifyFilter::CallbackID callback ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::CallbackNotFound
+ ));
+
+ virtual CosNotifyFilter::CallbackIDSeq * get_callbacks (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+protected:
+
+ /// Lock to serialize access to data members.
+ TAO_SYNCH_MUTEX lock_;
+
+ CORBA::ULong expected_pool_id_;
+ CORBA::ULong expected_lane_id_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_RT_Test_FILTER_H */
diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.cpp b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.cpp
new file mode 100644
index 00000000000..ecd20e34d7a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.cpp
@@ -0,0 +1,82 @@
+// $Id$
+
+#include "RT_Test_FilterFactory.h"
+
+ACE_RCSID(Notify, TAO_RT_Test_FilterFactory, "$Id$")
+
+#include "RT_Test_Filter.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_string.h"
+
+TAO_Notify_Tests_RT_Test_FilterFactory::TAO_Notify_Tests_RT_Test_FilterFactory (void)
+{
+}
+
+TAO_Notify_Tests_RT_Test_FilterFactory::~TAO_Notify_Tests_RT_Test_FilterFactory ()
+{
+}
+
+CosNotifyFilter::FilterFactory_ptr
+TAO_Notify_Tests_RT_Test_FilterFactory::create (PortableServer::POA_var& filter_poa ACE_ENV_ARG_DECL)
+{
+ this->filter_poa_ = filter_poa; // save the filter poa.
+
+ PortableServer::ServantBase_var servant_var (this);
+
+ return _this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+CosNotifyFilter::Filter_ptr
+TAO_Notify_Tests_RT_Test_FilterFactory::create_filter (const char *constraint_grammar ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidGrammar
+ ))
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)In TAO_Notify_Tests_RT_Test_FilterFactory::create_filter\n"));
+
+ // @@: change to "ExTCL" later.
+ if (ACE_OS::strcmp (constraint_grammar, "TCL") != 0 &&
+ ACE_OS::strcmp (constraint_grammar, "ETCL") != 0 &&
+ ACE_OS::strcmp (constraint_grammar, "EXTENDED_TCL") != 0)
+ ACE_THROW_RETURN (CosNotifyFilter::InvalidGrammar (), 0);
+
+
+ // Create the RefCounted servant.
+ TAO_Notify_Tests_RT_Test_Filter* filter = 0;
+
+ ACE_NEW_THROW_EX (filter,
+ TAO_Notify_Tests_RT_Test_Filter (),
+ CORBA::NO_MEMORY ());
+
+ PortableServer::ServantBase_var filter_var (filter);
+
+ PortableServer::ObjectId_var oid =
+ this->filter_poa_->activate_object (filter
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyFilter::Filter::_nil ());
+
+ CORBA::Object_var obj =
+ this->filter_poa_->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyFilter::Filter::_nil ());
+
+ return CosNotifyFilter::Filter::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+CosNotifyFilter::MappingFilter_ptr
+TAO_Notify_Tests_RT_Test_FilterFactory::create_mapping_filter (const char * /*constraint_grammar*/,
+ const CORBA::Any & /*default_value*/
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidGrammar
+ ))
+{
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CosNotifyFilter::MappingFilter::_nil ());
+}
+
+ACE_FACTORY_DEFINE (TAO_RT_Test_Filter, TAO_Notify_Tests_RT_Test_FilterFactory)
diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h
new file mode 100644
index 00000000000..b9c5f4d6075
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Test_Filter/RT_Test_FilterFactory.h
@@ -0,0 +1,82 @@
+/* -*- C++ -*- */
+/**
+ * @file RT_Test_FilterFactory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_RT_Test_FILTERFACTORY_H
+#define TAO_Notify_Tests_RT_Test_FILTERFACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "rt_test_filter_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyFilterS.h"
+#include "orbsvcs/Notify/FilterFactory.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class TAO_Notify_Tests_RT_Test_FilterFactory
+ *
+ * @brief
+ *
+ */
+class TAO_RT_Test_Filter_Export TAO_Notify_Tests_RT_Test_FilterFactory
+ : public virtual POA_CosNotifyFilter::FilterFactory
+ , public virtual TAO_Notify_FilterFactory
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_RT_Test_FilterFactory (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_RT_Test_FilterFactory ();
+
+ ///= TAO_Notify_Tests_FilterFactory methods.
+
+ virtual CosNotifyFilter::FilterFactory_ptr create (PortableServer::POA_var& filter_poa ACE_ENV_ARG_DECL);
+
+ ///= CosNotifyFilter::FilterFactory methods
+
+ virtual CosNotifyFilter::Filter_ptr create_filter (const char * constraint_grammar
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidGrammar
+ ));
+
+ virtual CosNotifyFilter::MappingFilter_ptr create_mapping_filter (const char * constraint_grammar,
+ const CORBA::Any & default_value
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyFilter::InvalidGrammar
+ ));
+
+protected:
+ /// The POA in which to activate the Filters.
+ PortableServer::POA_var filter_poa_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+ACE_FACTORY_DECLARE (TAO_RT_Test_Filter, TAO_Notify_Tests_RT_Test_FilterFactory)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_RT_Test_FILTERFACTORY_H */
diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/Test_Filter.mpc b/TAO/orbsvcs/tests/Notify/Test_Filter/Test_Filter.mpc
new file mode 100644
index 00000000000..1964722a76f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Test_Filter/Test_Filter.mpc
@@ -0,0 +1,17 @@
+// -*- MPC -*-
+// $Id$
+
+project(TAO_RT_NotifyTests_Filter): orbsvcslib, notification_skel, rtcorba, etcl, dynamicany, portableserver, iortable {
+
+ sharedname = TAO_RT_NotifyTests_Filter
+
+ dynamicflags = TAO_RT_Test_Filter_BUILD_DLL
+
+ IDL_Files {
+ }
+
+ Source_Files{
+ RT_Test_Filter.cpp
+ RT_Test_FilterFactory.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/Test_Filter/rt_test_filter_export.h b/TAO/orbsvcs/tests/Notify/Test_Filter/rt_test_filter_export.h
new file mode 100644
index 00000000000..055ee6f273f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/Test_Filter/rt_test_filter_export.h
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_RT_Test_Filter_EXPORT_H
+#define TAO_RT_Test_Filter_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_RT_Test_Filter_HAS_DLL)
+# define TAO_RT_Test_Filter_HAS_DLL 0
+# endif /* ! TAO_RT_Test_Filter_HAS_DLL */
+#else
+# if !defined (TAO_RT_Test_Filter_HAS_DLL)
+# define TAO_RT_Test_Filter_HAS_DLL 1
+# endif /* ! TAO_RT_Test_Filter_HAS_DLL */
+#endif
+
+#if defined (TAO_RT_Test_Filter_HAS_DLL) && (TAO_RT_Test_Filter_HAS_DLL == 1)
+# if defined (TAO_RT_Test_Filter_BUILD_DLL)
+# define TAO_RT_Test_Filter_Export ACE_Proper_Export_Flag
+# define TAO_RT_Test_Filter_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_RT_Test_Filter_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_RT_Test_Filter_BUILD_DLL */
+# define TAO_RT_Test_Filter_Export ACE_Proper_Import_Flag
+# define TAO_RT_Test_Filter_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_RT_Test_Filter_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_RT_Test_Filter_BUILD_DLL */
+#else /* TAO_RT_Test_Filter_HAS_DLL == 1 */
+# define TAO_RT_Test_Filter_Export
+# define TAO_RT_Test_Filter_SINGLETON_DECLARATION(T)
+# define TAO_RT_Test_Filter_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_RT_Test_Filter_HAS_DLL == 1 */
+
+#endif /* TAO_RT_Test_Filter_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/README b/TAO/orbsvcs/tests/Notify/ThreadPool/README
new file mode 100644
index 00000000000..d690937f041
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/ThreadPool/README
@@ -0,0 +1,52 @@
+ThreadPool test
+===============
+
+This test verifies the ThreadPool support in the RT Notification
+Service.
+
+Description:
+===========
+
+notify.conf:
+-----------
+The notify.conf file specifies the Test Filter Factory to be used by
+the RT Notification library.
+The Test Filter factory create special filter objects. these objects
+check if the correct thread pool is being used for invocations.
+
+supplier.conf:
+-------------
+
+This creates the following -
+- An EventChannel with a threadpool.
+- A SupplierAdmin (SA1)with a threadpool.
+- Another SupplierAdmin (SA2) with no threadpool.
+
+- A ProxyConsumer(1) is connected to SA1 with a threadpool.
+- A ProxyConsumer(2) is connected to SA1 with no threadpool.
+- A ProxyConsumer(3) is connected to SA2 with no threadpool.
+
+Periodic Suppliers are associated with each Proxy and send events at
+different priorities.
+
+consumer.conf:
+-------------
+
+This creates:
+- A ConsumerAdmin (CA1)with a threadpool.
+- Another ConsumerAdmin (CA2) with no threadpool.
+
+An RT POA is created in which the ProxySuppliers are activated.
+
+- A ProxySupplier(1) is connected to CA1 with a threadpool.
+- A ProxySupplier(2) is connected to CA1 with no threadpool.
+- A ProxySupplier(3) is connected to CA2 with no threadpool.
+
+Periodic Consumers are associated with each Proxy and receive events at
+different priorities.
+
+Expected Result:
+==============
+if a request reaches a threadpool that it was not supposed to, an
+error message is printed. otherwise some housekeeping messages are
+generated when the test runs. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf b/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf
new file mode 100644
index 00000000000..872c66654d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf
@@ -0,0 +1,61 @@
+##---- Load the Factories------
+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_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -ThreadPool 1 0"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
+static Command_Builder "ConsumerAdmin -Set_QoS ca1 -ThreadPool -Threads 1 -Priority 5"
+#
+##--------- Consumer 1 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c1 -Admin ca1 -POA poa_1 -Set_QoS -ThreadPool -Threads 1 -Priority 5 -Proxy c1_proxy -MaxCount 5 -Check_Priority"
+#
+static Command_Builder "PeriodicConsumer -Subscription c1 +Path1"
+#
+static Command_Builder "Filter -CreateFilter f_c1 ff"
+static Command_Builder "Filter -Add_Constraint f_c1 'PoolId = 5'"
+static Command_Builder "Filter -Add_Filter f_c1 c1_proxy"
+#
+##--------- Consumer 2 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c2 -Admin ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 5 -Check_Priority"
+#
+static Command_Builder "PeriodicConsumer -Subscription c2 +Path2"
+#
+static Command_Builder "Filter -CreateFilter f_c2 ff"
+static Command_Builder "Filter -Add_Constraint f_c2 'PoolId = 4'"
+static Command_Builder "Filter -Add_Filter f_c2 c2_proxy"
+#
+##--------- Consumer Admin 2 -------------
+static Command_Builder "ConsumerAdmin -Create ca2 ec1 -AND_OP"
+#
+##--------- Consumer 3 , connected to CA 2 --------
+static Command_Builder "PeriodicConsumer -Create c3 -Admin ca2 -POA poa_1 -Proxy c3_proxy -MaxCount 5 -Check_Priority"
+#
+static Command_Builder "PeriodicConsumer -Subscription c3 +Path3"
+#
+static Command_Builder "Filter -CreateFilter f_c3 ff"
+static Command_Builder "Filter -Add_Constraint f_c3 'PoolId = 1'"
+static Command_Builder "Filter -Add_Filter f_c3 c3_proxy"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf b/TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf
new file mode 100644
index 00000000000..f56362f30ea
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/ThreadPool/notify.conf
@@ -0,0 +1,8 @@
+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_FilterFactory Service_Object* TAO_RT_NotifyTests_Filter:_make_TAO_Notify_Tests_RT_Test_FilterFactory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
+
diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl b/TAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl
new file mode 100755
index 00000000000..d5c758f77b3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/ThreadPool/run_test.pl
@@ -0,0 +1,96 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 120;
+$startup_timeout = 120;
+$notify_conf = PerlACE::LocalFile ("notify.conf");
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service");
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+
+$Supplier = new PerlACE::Process ("../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
+
+$Consumer = new PerlACE::Process ("../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$Notification->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $supplier_ior;
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->Spawn ();
+
+if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Supplier->Kill ();
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf b/TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf
new file mode 100644
index 00000000000..7ef7b0b4b1c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/ThreadPool/supplier.conf
@@ -0,0 +1,66 @@
+## $Id$
+## This file has the following configuration:
+## EventChannel ec1 with 1 Thread
+## SupplierAdmim sa1 with 1 Thread
+## SupplierAdmin sa2
+##
+## Supplier s1 has 1 Thread and is connected to sa1
+## Supplier s2 is connected to sa1
+##
+## Supplier s3 is connected to sa2
+##
+#
+##---- Load the Factories------
+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_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+dynamic TAO_Notify_Tests_Filter_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Filter_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -ThreadPool -Threads 1 -Priority 0"
+static Command_Builder "Filter -CreateFactory ff ec1"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+static Command_Builder "SupplierAdmin -Set_QoS sa1 -ThreadPool -Threads 1 -Priority 2"
+#
+### --- Create Supplier s1 connected to sa1. It has its own Thread ----
+static Command_Builder "PeriodicSupplier -Create s1 -Admin sa1 -Set_QoS -ThreadPool -Threads 1 -Priority 5 -Proxy s1_proxy -EventType Path1 -Priority 1 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 "
+#
+static Command_Builder "Filter -CreateFilter f1 ff"
+static Command_Builder "Filter -Add_Constraint f1 'PoolId = 3'"
+static Command_Builder "Filter -Add_Filter f1 s1_proxy"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s2 -Admin sa1 -Proxy s2_proxy -EventType Path2 -Priority 3 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 "
+#
+static Command_Builder "Filter -CreateFilter f2 ff"
+static Command_Builder "Filter -Add_Constraint f2 'PoolId = 2'"
+static Command_Builder "Filter -Add_Filter f2 s2_proxy"
+#
+### --- Create Supplier Admin 2 ----
+static Command_Builder "SupplierAdmin -Create sa2 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa2 ----
+static Command_Builder "PeriodicSupplier -Create s3 -Admin sa2 -Proxy s3_proxy -EventType Path3 -Priority 6 -Period 10000 -ExecTime 10000 -Phase 0 -Iter 5 -Load 1 "
+static Command_Builder "Filter -CreateFilter f3 ff"
+static Command_Builder "Filter -Add_Constraint f3 'PoolId = 1'"
+static Command_Builder "Filter -Add_Filter f3 s3_proxy"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/Makefile.am b/TAO/orbsvcs/tests/Notify/XML_Persistence/Makefile.am
new file mode 100644
index 00000000000..78d0832f1b2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/Makefile.am
@@ -0,0 +1,67 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.XML_Persistence.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = main
+
+main_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+main_SOURCES = \
+ main.cpp
+
+main_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/XML_Persistence.mpc b/TAO/orbsvcs/tests/Notify/XML_Persistence/XML_Persistence.mpc
new file mode 100644
index 00000000000..141f3252109
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/XML_Persistence.mpc
@@ -0,0 +1,5 @@
+// $Id$
+
+project : orbsvcsexe, portableserver, notify_serv {
+ exename = main
+}
diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp b/TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp
new file mode 100644
index 00000000000..463a3fc9b8d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/main.cpp
@@ -0,0 +1,409 @@
+/**
+ * $Id$
+ */
+
+#include "orbsvcs/CosNotificationC.h"
+#include "orbsvcs/NotifyExtC.h"
+#include "orbsvcs/Notify/Notify_EventChannelFactory_i.h"
+
+// 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 (sun) || defined (__APPLE__)
+#include "orbsvcs/Notify/CosNotify_Initializer.h"
+#endif /* sun || __APPLE__ */
+
+#include "tao/TimeBaseC.h"
+#include "tao/corba.h"
+#include "tao/PortableServer/PortableServer.h"
+
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/Dynamic_Service.h"
+#include "ace/ARGV.h"
+
+class TestSupplier
+: public POA_CosNotifyComm::StructuredPushSupplier
+{
+ virtual void disconnect_structured_push_supplier(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) throw (CORBA::SystemException) {
+ }
+
+ virtual void subscription_change( const CosNotification::EventTypeSeq&,
+ const CosNotification::EventTypeSeq& ACE_ENV_ARG_DECL_NOT_USED)
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+ {
+ }
+};
+
+class TestConsumer
+: public POA_CosNotifyComm::StructuredPushConsumer
+{
+ virtual void disconnect_structured_push_consumer(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) throw (CORBA::SystemException) {
+ }
+
+ virtual void offer_change( const CosNotification::EventTypeSeq&, const CosNotification::EventTypeSeq& ACE_ENV_ARG_DECL_NOT_USED)
+ throw (CORBA::SystemException, CosNotifyComm::InvalidEventType)
+ {
+ }
+
+ virtual void push_structured_event(const CosNotification::StructuredEvent& ACE_ENV_ARG_DECL_NOT_USED)
+ throw (CORBA::SystemException, CosEventComm::Disconnected)
+ {
+ }
+};
+
+int main(int ac, char **av)
+{
+ int retval = 1;
+
+ bool pass1 = false;
+ bool pass2 = false;
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CORBA::ORB_var orb;
+ PortableServer::POA_var poa;
+
+ orb = CORBA::ORB_init(ac, av, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (orb.in ()));
+
+ if (ac > 2 && ACE_OS::strcmp (av[1], "-pass") == 0)
+ {
+ int pn = av[2][0] - '0';
+ switch (pn)
+ {
+ case 1:
+ pass1 = true;
+ pass2 = false;
+ break;
+ case 2:
+ pass1 = false;
+ pass2 = true;
+ break;
+ case 3:
+ pass1 = true;
+ pass2 = true;
+ break;
+ default:
+ ACE_OS::fprintf (stderr, "Illegal -pass command line option. Expecting 1, 2, or 3\n");
+ return -1;
+ }
+ }
+ if (! pass1 && !pass2)
+ {
+ FILE *f;
+ f = fopen ("loadtest.xml", "r");
+ if (f != 0)
+ {
+ fclose (f);
+ pass1 = false;
+ pass2 = true;
+ }
+ else
+ {
+ pass1 = true;
+ pass2 = false;
+ }
+ }
+ CORBA::Object_var obj =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (obj.in ()));
+ poa = PortableServer::POA::_narrow(obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_ASSERT(! CORBA::is_nil (poa.in ()));
+ PortableServer::POAManager_var mgr = poa->the_POAManager();
+ mgr->activate();
+
+ CORBA::PolicyList policies (1);
+ policies.length (1);
+
+ policies[0] =
+ poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var persistentPOA = poa->create_POA (
+ "PersistentPOA",
+ mgr.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ policies[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (pass1)
+ {
+ CosNotifyChannelAdmin::EventChannelFactory_var cosecf =
+ TAO_Notify_EventChannelFactory_i::create(persistentPOA.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ NotifyExt::EventChannelFactory_var ecf =
+ NotifyExt::EventChannelFactory::_narrow (cosecf.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (ecf.in ()))
+ {
+ return -1;
+ }
+
+ CosNotification::QoSProperties qosprops(7);
+ CORBA::ULong i = 0;
+
+ qosprops.length(7);
+ qosprops[i].name = CORBA::string_dup(CosNotification::EventReliability);
+ qosprops[i++].value <<= CosNotification::Persistent;
+ qosprops[i].name = CORBA::string_dup(CosNotification::ConnectionReliability);
+ qosprops[i++].value <<= CosNotification::Persistent; // Required, or we won't persist much
+ qosprops[i].name = CORBA::string_dup(CosNotification::Priority);
+ qosprops[i++].value <<= CosNotification::HighestPriority;
+ qosprops[i].name = CORBA::string_dup(CosNotification::Timeout);
+ qosprops[i++].value <<= (TimeBase::TimeT) 42000; // 4.2 ms
+ qosprops[i].name = CORBA::string_dup(CosNotification::StopTimeSupported);
+ qosprops[i++].value <<= CORBA::Any::from_boolean(1);
+ qosprops[i].name = CORBA::string_dup(CosNotification::MaximumBatchSize);
+ qosprops[i++].value <<= (CORBA::Long) 555;
+ qosprops[i].name = CORBA::string_dup(CosNotification::PacingInterval);
+ qosprops[i++].value <<= (TimeBase::TimeT) 34300; // 3.4 ms
+ qosprops.length(i);
+
+ CosNotification::AdminProperties adminprops(4);
+ adminprops.length(4);
+ i = 0;
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxQueueLength);
+ adminprops[i++].value <<= (CORBA::Long) 1234;
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxConsumers);
+ adminprops[i++].value <<= (CORBA::Long) 3;
+ adminprops[i].name = CORBA::string_dup(CosNotification::MaxSuppliers);
+ adminprops[i++].value <<= (CORBA::Long) 3;
+ adminprops[i].name = CORBA::string_dup(CosNotification::RejectNewEvents);
+ adminprops[i++].value <<= CORBA::Any::from_boolean(1);
+ adminprops.length (i);
+
+ CosNotifyChannelAdmin::ChannelID ecid;
+ ::CosNotifyChannelAdmin::EventChannel_var ec =
+ ecf->create_channel(qosprops, adminprops, ecid ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::AdminID consumer_admin_id;
+ CosNotifyChannelAdmin::ConsumerAdmin_var ca =
+ ec->new_for_consumers(CosNotifyChannelAdmin::OR_OP,
+ consumer_admin_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::AdminID supplier_admin_id;
+ CosNotifyChannelAdmin::SupplierAdmin_var sa =
+ ec->new_for_suppliers(CosNotifyChannelAdmin::OR_OP,
+ supplier_admin_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::ProxyID proxy_id;
+ CosNotifyChannelAdmin::ProxySupplier_var ps =
+ ca->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var strps =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow(ps.in());
+
+ ps = ca->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxy_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier_var seqps =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow(ps.in());
+
+ ps = ca->obtain_notification_push_supplier(
+ CosNotifyChannelAdmin::ANY_EVENT,
+ proxy_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::ProxyPushSupplier_var anyps =
+ CosNotifyChannelAdmin::ProxyPushSupplier::_narrow(ps.in());
+
+ CosNotifyChannelAdmin::ProxyConsumer_var pc =
+ sa->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var strpc = CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow(pc.in());
+
+ pc = sa->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxy_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::SequenceProxyPushConsumer_var seqpc = CosNotifyChannelAdmin::SequenceProxyPushConsumer::_narrow(pc.in());
+
+ pc =
+ sa->obtain_notification_push_consumer(
+ CosNotifyChannelAdmin::ANY_EVENT,
+ proxy_id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyChannelAdmin::ProxyPushConsumer_var anypc = CosNotifyChannelAdmin::ProxyPushConsumer::_narrow(pc.in());
+
+ CosNotifyFilter::FilterFactory_var ff =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotifyFilter::Filter_var filter1 =
+ ff->create_filter("EXTENDED_TCL" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (filter1.in ()));
+
+ CosNotifyFilter::Filter_var filter2 =
+ ff->create_filter("EXTENDED_TCL" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT(! CORBA::is_nil (filter2.in ()));
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list(1);
+ constraint_list.length(1);
+ constraint_list[0].event_types.length(0);
+ constraint_list[0].constraint_expr = CORBA::string_dup("Number == 100");
+
+ filter1->add_constraints(constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ filter2->add_constraints(constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ca->add_filter (filter1.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sa->add_filter (filter2.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ strps->add_filter (filter1.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ seqps->add_filter (filter2.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ anyps->add_filter (filter1.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ strpc->add_filter (filter2.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ seqpc->add_filter (filter1.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ anypc->add_filter (filter1.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ anypc->add_filter (filter2.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNotification::EventTypeSeq added1(1), removed1(0);
+ added1.length(1);
+ added1[0].domain_name = CORBA::string_dup("nightly_builds");
+ added1[0].type_name = CORBA::string_dup("*");
+ ca->subscription_change(added1, removed1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Connect a PushConsumer and PushSupplier
+ TestSupplier test_supplier_svt;
+ PortableServer::ObjectId_var oid1 = persistentPOA->activate_object (&test_supplier_svt
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var obj1 = persistentPOA->id_to_reference (oid1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CosNotifyComm::StructuredPushSupplier_var push_sup = CosNotifyComm::StructuredPushSupplier::_narrow (obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TestConsumer test_consumer_svt;
+ PortableServer::ObjectId_var oid2 = persistentPOA->activate_object (&test_consumer_svt
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var obj2 = persistentPOA->id_to_reference (oid2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CosNotifyComm::StructuredPushConsumer_var push_cons = CosNotifyComm::StructuredPushConsumer::_narrow (obj2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ strpc->connect_structured_push_supplier(push_sup.in());
+ strps->connect_structured_push_consumer(push_cons.in());
+
+ strps->suspend_connection();
+
+ persistentPOA->deactivate_object (oid1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ persistentPOA->deactivate_object (oid2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ecf->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ////////////////////////////////
+ // TODO make this not hardcoded
+ ACE_OS::rename ("abc.xml", "loadtest.xml");
+
+ } // end of pass 1
+
+ if (pass2)
+ {
+
+ // Create a new ecf, which should load itself from loadtest.xml
+ CosNotifyChannelAdmin::EventChannelFactory_var
+ cosecf = TAO_Notify_EventChannelFactory_i::create(persistentPOA.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_TRY_CHECK;
+ NotifyExt::EventChannelFactory_var
+ ecf = NotifyExt::EventChannelFactory::_narrow (cosecf.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (ecf.in ()))
+ {
+ return -1;
+ }
+
+ // Force a change, which should write out a new abc.xml.
+ ecf->save_topology (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ecf->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ poa = PortableServer::POA::_nil ();
+ orb = CORBA::ORB::_nil ();
+ retval = 0;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ex, "Error: Unexpected exception caught in main. ");
+ retval = -1;
+ }
+ ACE_CATCHALL
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Error : Unknown exception caught in main.") ));
+ retval = -2;
+ }
+ ACE_ENDTRY;
+ return retval;
+}
diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl b/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl
new file mode 100755
index 00000000000..8140370ffd8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl
@@ -0,0 +1,50 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# ex
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::Run_Test;
+use File::Compare;
+
+$ACE_ROOT = $ENV{ACE_ROOT};
+$TAO_ROOT = "$ACE_ROOT/TAO";
+
+$port = 12000 + PerlACE::uniqueid ();
+
+sub cleanup() {
+ unlink "loadtest.xml";
+ unlink "abc.xml";
+ for ($i = 0; $i < 10; ++$i) {
+ unlink "abc.00" . $i;
+ }
+ for ($i = 10; $i < 20; ++$i) {
+ unlink "abc.0" . $i;
+ }
+}
+
+cleanup();
+
+$ret = 0;
+
+$UTEST = new PerlACE::Process("main", "-orbobjrefstyle url -ORBEndpoint iiop://:$port -pass 3");
+$ret = $UTEST->SpawnWaitKill(20);
+if ($ret != 0) {
+ print "ERROR : main returned $ret\n";
+ exit $ret;
+}
+
+$different = compare("loadtest.xml", "abc.xml");
+if ($different) {
+ print "ERROR : loadtest.xml != abc.xml\n";
+ exit 1;
+} else {
+ print "Success : loadtest.xml == abc.xml\n";
+}
+
+
+exit $ret;
diff --git a/TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf b/TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf
new file mode 100644
index 00000000000..c0d276565cb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/XML_Persistence/svc.conf
@@ -0,0 +1,2 @@
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
+dynamic Topology_Factory Service_Object* TAO_CosNotification_Persist:_make_TAO_Notify_XML_Topology_Factory() "-v -save_base_path ./abc -load_base_path ./loadtest -backup_count 2 -no_timestamp"
diff --git a/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.cpp b/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.cpp
new file mode 100644
index 00000000000..86b477c1bba
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.cpp
@@ -0,0 +1,296 @@
+// $Id$
+
+#include "Activation_Manager.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/os_include/os_netdb.h"
+
+ACE_RCSID (lib,
+ TAO_Activation_Manager,
+ "$Id$")
+
+#include "LookupManager.h"
+#include "Command_Builder.h"
+#include "Name.h"
+#include "ace/Barrier.h"
+
+TAO_Notify_Tests_Activation_Manager::TAO_Notify_Tests_Activation_Manager (void)
+ : barrier_ (0)
+ , active_suppliers_ (0)
+ , active_consumers_ (0)
+ , active_done_ (lock_)
+ , ior_output_file_ (0)
+ , started_ (0)
+ , started_condition_ (lock_)
+{
+ LOOKUP_MANAGER->_register (this);
+}
+
+TAO_Notify_Tests_Activation_Manager::~TAO_Notify_Tests_Activation_Manager ()
+{
+ delete this->barrier_;
+
+ if (this->ior_output_file_)
+ ACE_OS::fclose(this->ior_output_file_);
+}
+
+int
+TAO_Notify_Tests_Activation_Manager::ior_output_file (const ACE_TCHAR *file_name)
+{
+ this->ior_output_file_ = ACE_OS::fopen (file_name, ACE_TEXT("w"));
+
+ if (this->ior_output_file_ == 0)
+ return -1;
+ else
+ return 0;
+}
+
+int
+TAO_Notify_Tests_Activation_Manager::ior_input_file (const ACE_TCHAR *file_name)
+{
+ this->ior_input_file_ = file_name;
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::done (TAO_Notify_Tests_Periodic_Supplier* /*supplier*/)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ --active_suppliers_;
+
+ if (active_suppliers_ == 0)
+ this->active_done_.broadcast ();
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::done (TAO_Notify_Tests_Periodic_Consumer* /*consumer*/)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ --active_consumers_;
+
+ if (active_consumers_ == 0)
+ this->active_done_.broadcast ();
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::wait_for_completion (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ while (active_suppliers_ != 0 || active_consumers_ != 0)
+ this->active_done_.wait (); //@@ use timed wait.
+}
+
+int
+TAO_Notify_Tests_Activation_Manager::supplier_count (void)
+{
+ return this->supplier_map_.current_size ();
+}
+
+int
+TAO_Notify_Tests_Activation_Manager::consumer_count (void)
+{
+ return this->consumer_map_.current_size ();
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::_register (TAO_Notify_Tests_Periodic_Supplier* supplier, const char* obj_name ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ // Register in supplier map.
+ ACE_CString name (obj_name);
+
+ if (this->supplier_map_.bind (name, supplier) == -1)
+ ACE_ERROR ((LM_ERROR, "Failed to bind supplier %s in LookupMap\n", obj_name));
+
+ // Designate application manager as the callback object.
+ supplier->task_callback (this);
+
+ active_suppliers_++;
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::_register (TAO_Notify_Tests_Periodic_Consumer* consumer, const char* obj_name ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ // Register in consumer map.
+ ACE_CString name (obj_name);
+
+ if (this->consumer_map_.bind (name, consumer) == -1)
+ ACE_ERROR ((LM_ERROR, "Failed to bind consumer %s in LookupMap\n", obj_name));
+
+ // Designate application manager as the callback object.
+ consumer->task_callback (this);
+
+ active_consumers_++;
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::resolve (TAO_Notify_Tests_Periodic_Supplier*& supplier, const char* obj_name ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ ACE_CString name (obj_name);
+
+ if (this->supplier_map_.find (name, supplier) == -1)
+ ACE_ERROR ((LM_ERROR, "Failed to find supplier %s in LookupMap\n", obj_name));
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::resolve (TAO_Notify_Tests_Periodic_Consumer*& consumer, const char* obj_name ACE_ENV_ARG_DECL_NOT_USED)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ ACE_CString name (obj_name);
+
+ if (this->consumer_map_.find (name, consumer) == -1)
+ ACE_ERROR ((LM_ERROR, "Failed to find consumer %s in LookupMap\n", obj_name));
+}
+
+int
+TAO_Notify_Tests_Activation_Manager::activate_suppliers (void)
+{
+ TAO_Notify_Tests_PeriodicSupplier_Iterator iter(this->supplier_map_);
+
+ TAO_Notify_Tests_PeriodicSupplier_Entry* entry;
+
+ // Create the barrier to synch activated auppiers.
+ this->barrier_ = new ACE_Barrier (this->supplier_count () + 1);
+
+ // For each supplier : activate
+ TAO_Notify_Tests_Periodic_Supplier* supplier = 0;
+
+ for (u_int index = 0; iter.done () == 0; iter.advance (), ++index)
+ {
+ if (iter.next (entry) != 0)
+ {
+ supplier = entry->int_id_;
+
+ if (supplier->activate_task (this->barrier_) != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Supplier list activation failed\n"));
+ return -1;
+ }
+ }
+ }
+
+ this->barrier_->wait ();
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::dump_stats (int dump_samples)
+{
+ char hostname[MAXHOSTNAMELEN];
+ ACE_OS::hostname (hostname, MAXHOSTNAMELEN);
+
+ /// dump suppliers:
+ char msg[BUFSIZ];
+ ACE_OS::sprintf (msg, "# Stats generated on %s\n", hostname);
+
+ TAO_Notify_Tests_PeriodicSupplier_Iterator sup_iter(this->supplier_map_);
+
+ TAO_Notify_Tests_PeriodicSupplier_Entry* sup_entry;
+
+ // For each supplier
+ TAO_Notify_Tests_Periodic_Supplier* supplier = 0;
+
+ u_int index = 0;
+ for (; sup_iter.done () == 0; sup_iter.advance (), ++index)
+ {
+ if (sup_iter.next (sup_entry) != 0)
+ {
+ supplier = sup_entry->int_id_;
+ supplier->dump_stats (msg, dump_samples);
+ }
+ }
+
+ // dump consumers
+ TAO_Notify_Tests_PeriodicConsumer_Iterator cons_iter(this->consumer_map_);
+
+ TAO_Notify_Tests_PeriodicConsumer_Entry* cons_entry;
+
+ TAO_Notify_Tests_Periodic_Consumer* consumer = 0;
+ for (index = 0; cons_iter.done () == 0; cons_iter.advance (), ++index)
+ {
+ if (cons_iter.next (cons_entry) != 0)
+ {
+ consumer = cons_entry->int_id_;
+ consumer->dump_stats (msg, dump_samples);
+ }
+ }
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::write_ior (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::ServantBase_var servant_var (this);
+
+ Notify_Test::Activation_Manager_var am_object = _this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::ORB_var orb;
+ LOOKUP_MANAGER->resolve (orb);
+
+ // Write IOR to a file, if asked.
+ CORBA::String_var str =
+ orb->object_to_string (am_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->ior_output_file_)
+ {
+ ACE_OS::fprintf (this->ior_output_file_,
+ "%s",
+ str.in ());
+ ACE_OS::fclose (this->ior_output_file_);
+ this->ior_output_file_ = 0;
+ }
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::wait_for_start_signal (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ while (this->started_ == 0)
+ this->started_condition_.wait (); //@@ use timed wait.
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::start (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_);
+
+ this->started_ = 1;
+
+ this->started_condition_.signal (); //@@ use timed wait.
+}
+
+void
+TAO_Notify_Tests_Activation_Manager::signal_peer (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::ORB_var orb;
+ LOOKUP_MANAGER->resolve (orb);
+
+ CORBA::Object_var object =
+ orb->string_to_object (this->ior_input_file_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Notify_Test::Activation_Manager_var peer = Notify_Test::Activation_Manager::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (peer.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ this->ior_input_file_.c_str ()));
+ }
+
+ peer->start (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.h b/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.h
new file mode 100644
index 00000000000..838516b3d64
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.h
@@ -0,0 +1,139 @@
+/* -*- C++ -*- */
+/**
+ * @file Activation_Manager.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_ACTIVATION_MANAGER_H
+#define TAO_Notify_Tests_ACTIVATION_MANAGER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Null_Mutex.h"
+#include "ace/SString.h"
+#include "ace/Hash_Map_Manager.h"
+#include "Task_Callback.h"
+#include "Periodic_Supplier.h"
+#include "Periodic_Consumer.h"
+#include "Activation_ManagerS.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Barrier;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Tests_Activation_Manager
+ *
+ * @brief Class to handle Suppliers and Consumers.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Activation_Manager : public TAO_Notify_Tests_Task_Callback
+ , public POA_Notify_Test::Activation_Manager
+{
+ typedef ACE_Hash_Map_Manager<ACE_CString, TAO_Notify_Tests_Periodic_Supplier*, ACE_SYNCH_NULL_MUTEX> TAO_Notify_Tests_PeriodicSupplier_Map;
+ typedef ACE_Hash_Map_Manager<ACE_CString, TAO_Notify_Tests_Periodic_Consumer*, ACE_SYNCH_NULL_MUTEX> TAO_Notify_Tests_PeriodicConsumer_Map;
+ typedef ACE_Hash_Map_Iterator<ACE_CString, TAO_Notify_Tests_Periodic_Supplier*, ACE_SYNCH_NULL_MUTEX> TAO_Notify_Tests_PeriodicSupplier_Iterator;
+ typedef ACE_Hash_Map_Iterator<ACE_CString, TAO_Notify_Tests_Periodic_Consumer*, ACE_SYNCH_NULL_MUTEX> TAO_Notify_Tests_PeriodicConsumer_Iterator;
+ typedef ACE_Hash_Map_Entry<ACE_CString, TAO_Notify_Tests_Periodic_Supplier*> TAO_Notify_Tests_PeriodicSupplier_Entry;
+ typedef ACE_Hash_Map_Entry<ACE_CString, TAO_Notify_Tests_Periodic_Consumer*> TAO_Notify_Tests_PeriodicConsumer_Entry;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Activation_Manager (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_Activation_Manager ();
+
+ /// Interface impl.
+ virtual void start (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Register Supplier
+ void _register (TAO_Notify_Tests_Periodic_Supplier* supplier, const char* obj_name ACE_ENV_ARG_DECL);
+ /// Register Consumer
+ void _register (TAO_Notify_Tests_Periodic_Consumer* consumer, const char* obj_name ACE_ENV_ARG_DECL);
+
+ /// Resolve Supplier
+ void resolve (TAO_Notify_Tests_Periodic_Supplier*& supplier, const char* obj_name ACE_ENV_ARG_DECL);
+
+ /// Resolve Consumer
+ void resolve (TAO_Notify_Tests_Periodic_Consumer*& consumer, const char* obj_name ACE_ENV_ARG_DECL);
+
+ // Activate the tasks for each supplier.
+ int activate_suppliers (void);
+
+ // Supplier Count
+ int supplier_count (void);
+
+ // Consumer Count
+ int consumer_count (void);
+
+ /// Wait till active suppliers and consumers are done.
+ void wait_for_completion (void);
+
+ /// TAO_Notify_Tests_Task_Callback methods
+ virtual void done (TAO_Notify_Tests_Periodic_Supplier* supplier);
+ virtual void done (TAO_Notify_Tests_Periodic_Consumer* consumer);
+
+ // Dump stats gathered during exec..
+ void dump_stats (int dump_samples);
+
+ // Returns 0 if the file could be opened for write.
+ int ior_output_file (const ACE_TCHAR *file_name);
+
+ // Returns 1 if the file could be opened for read.
+ int ior_input_file (const ACE_TCHAR *file_name);
+
+ void write_ior (ACE_ENV_SINGLE_ARG_DECL);
+ void wait_for_start_signal (ACE_ENV_SINGLE_ARG_DECL);
+ void signal_peer (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// Lock to serialize internal state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// The barrier to synch all supplier on so that everyone starts at the same instance.
+ ACE_Barrier* barrier_;
+
+ /// Number of Active suppliers (still running a ACE_Task and sending events)
+ int active_suppliers_;
+
+ /// Number of Active consumers (still receiving events)
+ int active_consumers_;
+
+ // Condition that all active suppliers and consumers are done.
+ TAO_SYNCH_CONDITION active_done_;
+
+ // Map that stores suppliers.
+ TAO_Notify_Tests_PeriodicSupplier_Map supplier_map_;
+
+ // Map that stores consumers.
+ TAO_Notify_Tests_PeriodicConsumer_Map consumer_map_;
+
+ /// The file for output
+ FILE *ior_output_file_;
+
+ /// The file for input
+ ACE_CString ior_input_file_;
+
+ /// Set when the start method is called.
+ CORBA::Boolean started_;
+
+ // Condition that the start method has been called.
+ TAO_SYNCH_CONDITION started_condition_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_ACTIVATION_MANAGER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.idl b/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.idl
new file mode 100644
index 00000000000..21c7b985ab4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Activation_Manager.idl
@@ -0,0 +1,32 @@
+/**
+ * @file Activation_Manager.idl
+ *
+ * @brief
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ */
+
+#ifndef _NOTIFY_TEST_IDL_
+#define _NOTIFY_TEST_IDL_
+
+#pragma prefix ""
+
+/**
+ * @namespace Activation_Manager
+ *
+ * @brief Notify Test
+ */
+module Notify_Test
+{
+ interface Activation_Manager
+ {
+ /*
+ * Prompts the Activation Manager to start.
+ */
+ void start ();
+ };
+};
+
+#endif /* _NOTIFY_TEST_IDL_ */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Application_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/Application_Command.cpp
new file mode 100644
index 00000000000..5172ae18620
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Application_Command.cpp
@@ -0,0 +1,224 @@
+// $Id$
+
+#include "Application_Command.h"
+
+ACE_RCSID(lib, TAO_Application_Command, "$Id$")
+
+#include "tao/PortableServer/PortableServer.h"
+#include "LookupManager.h"
+#include "Name.h"
+#include "Activation_Manager.h"
+#include "Driver_Base.h"
+#include "Priority_Mapping.h"
+
+TAO_Notify_Tests_Application_Command::TAO_Notify_Tests_Application_Command (void)
+ : dump_samples_ (0)
+{
+}
+
+TAO_Notify_Tests_Application_Command::~TAO_Notify_Tests_Application_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_Application_Command::get_name (void)
+{
+ return TAO_Notify_Tests_Application_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_Application_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::application_command;
+}
+
+void
+TAO_Notify_Tests_Application_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ if (arg_shifter.is_anything_left ())
+ {
+ /// -Init | Run | Shutdown
+ if (arg_shifter.cur_arg_strncasecmp ("-Init") == 0)
+ {
+ this->command_ = INIT;
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Run") == 0)
+ {
+ this->command_ = RUN;
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-WaitForEvents") == 0)
+ {
+ this->command_ = WAIT_FOR_EVENTS;
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Shutdown") == 0)
+ {
+ this->command_ = SHUTDOWN;
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-DumpStats") == 0)
+ {
+ this->command_ = DUMP_STATE;
+
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.cur_arg_strncasecmp ("-Samples") == 0)
+ {
+ this->dump_samples_ = 1;
+
+ arg_shifter.consume_arg ();
+ }
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-SignalPeer") == 0)
+ {
+ this->command_ = SIGNAL_PEER;
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-WaitToStart") == 0)
+ {
+ this->command_ = WAIT_TO_START;
+
+ arg_shifter.consume_arg ();
+ }
+
+ }
+}
+
+void
+TAO_Notify_Tests_Application_Command::handle_init (ACE_ENV_SINGLE_ARG_DECL)
+{
+ /// Fetch the root poa.
+ PortableServer::POA_var root_poa;
+ LOOKUP_MANAGER->resolve (root_poa);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ /// Activate the root POA.
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_Notify_Tests_Priority_Mapping* mapping = new TAO_Notify_Tests_Priority_Mapping ();
+
+ LOOKUP_MANAGER->_register (mapping);
+}
+
+void
+TAO_Notify_Tests_Application_Command::handle_wait_for_completion (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Waiting for suppliers and consumers to finish...\n"));
+
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ act_mgr->wait_for_completion ();
+}
+
+void
+TAO_Notify_Tests_Application_Command::handle_shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)Shutting down the Application...\n"));
+
+ TAO_Notify_Tests_Driver_Base* driver = 0;
+ LOOKUP_MANAGER->resolve (driver);
+
+ driver->shutdown ();
+
+}
+
+void
+TAO_Notify_Tests_Application_Command::handle_dump_stats (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)Dumpimg stats...\n"));
+
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ act_mgr->dump_stats (this->dump_samples_);
+}
+
+void
+TAO_Notify_Tests_Application_Command::handle_run (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // Run the Consumers
+
+
+ //= Run the Suppliers
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ if (act_mgr->activate_suppliers () == 0)
+ ACE_DEBUG ((LM_DEBUG, "Suppliers activated...\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG, "Suppliers activation failed!...\n"));
+}
+
+void
+TAO_Notify_Tests_Application_Command::handle_signal_peer (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ act_mgr->signal_peer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_Application_Command::handle_wait_to_start (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ act_mgr->write_ior (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ act_mgr->wait_for_start_signal (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_Application_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == INIT)
+ {
+ this->handle_init (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == RUN)
+ {
+ this->handle_run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == WAIT_FOR_EVENTS)
+ {
+ this->handle_wait_for_completion (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SHUTDOWN)
+ {
+ this->handle_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DUMP_STATE)
+ {
+ this->handle_dump_stats (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SIGNAL_PEER)
+ {
+ this->handle_signal_peer (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == WAIT_TO_START)
+ {
+ this->handle_wait_to_start (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Application_Command.h b/TAO/orbsvcs/tests/Notify/lib/Application_Command.h
new file mode 100644
index 00000000000..ff267fc37a3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Application_Command.h
@@ -0,0 +1,83 @@
+/* -*- C++ -*- */
+/**
+ * @file Application_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_APPLICATION_COMMAND_H
+#define TAO_Notify_Tests_APPLICATION_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/ORB.h"
+#include "Command.h"
+
+class TAO_Notify_Tests_Application_Command;
+
+/**
+ * @class TAO_Notify_Tests_Application_Command
+ *
+ * @brief Command to control the Application.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Application_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Application_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Application_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Get the command name.
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ INIT,
+ RUN,
+ WAIT_FOR_EVENTS,
+ SHUTDOWN,
+ DUMP_STATE,
+ SIGNAL_PEER,
+ WAIT_TO_START
+ };
+
+ /// Flag used with the DUMP_STATE command that asks for all samples to be put into the
+ /// output data file.
+ int dump_samples_;
+
+ ///= Handlers
+ virtual void handle_init (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_run (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_wait_for_completion (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_shutdown (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_dump_stats (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_signal_peer (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_wait_to_start (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_APPLICATION_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command.cpp b/TAO/orbsvcs/tests/Notify/lib/Command.cpp
new file mode 100644
index 00000000000..4e63d4ba284
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command.cpp
@@ -0,0 +1,59 @@
+// $Id$
+
+#include "Command.h"
+
+#include "tao/Exception.h"
+#include "tao/Environment.h"
+
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(lib, TAO_Command, "$Id$")
+
+TAO_Notify_Tests_Command::TAO_Notify_Tests_Command (void)
+ :next_ (0), command_ (INVALID)
+{
+}
+
+TAO_Notify_Tests_Command::~TAO_Notify_Tests_Command ()
+{
+}
+
+void
+TAO_Notify_Tests_Command::init (ACE_Arg_Shifter& /*arg_shifter*/)
+{
+ // default: do nothing.
+}
+
+void
+TAO_Notify_Tests_Command::next (TAO_Notify_Tests_Command* command)
+{
+ this->next_ = command;
+}
+
+void
+TAO_Notify_Tests_Command::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == INVALID)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Invalid command: %s\n", this->get_name ()));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Executing command: %s\n", this->get_name ()));
+
+ ACE_TRY
+ {
+ this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT("Error: Exception running command\n"));
+ }
+ ACE_ENDTRY;
+ }
+
+ if (this->next_)
+ this->next_->execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command.h b/TAO/orbsvcs/tests/Notify/lib/Command.h
new file mode 100644
index 00000000000..41f23995f0b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command.h
@@ -0,0 +1,78 @@
+/* -*- C++ -*- */
+/**
+ * @file Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_COMMAND_H
+#define TAO_Notify_Tests_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/orbconf.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/CORBA_macros.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+namespace CORBA
+{
+ class Environment;
+}
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Tests_Command
+ *
+ * @brief Base Class for all command objects.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Command
+{
+ friend class TAO_Notify_Tests_Command_Builder;
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Command (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Implement command execution.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ /// Return the name of this command.
+ virtual const char* get_name (void)= 0;
+
+ ///= Each derived type must also implement the following signature:
+ // static const char* name (void);
+
+protected:
+ /// Next command after this one.
+ TAO_Notify_Tests_Command* next_;
+
+ enum {INVALID = -1};
+
+ int command_;
+
+private:
+ /// Execute the command.
+ void execute (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Save the next command to exec.
+ void next (TAO_Notify_Tests_Command* command);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command_Builder.cpp b/TAO/orbsvcs/tests/Notify/lib/Command_Builder.cpp
new file mode 100644
index 00000000000..e95b8ed81b2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command_Builder.cpp
@@ -0,0 +1,92 @@
+// $Id$
+
+#include "Command_Builder.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "Command.h"
+#include "Command_Factory.h"
+#include "Name.h"
+
+ACE_RCSID(lib, TAO_Command_Builder, "$Id$")
+
+TAO_Notify_Tests_Command_Builder::TAO_Notify_Tests_Command_Builder (void)
+ :start_command_ (0)
+{
+}
+
+TAO_Notify_Tests_Command_Builder::~TAO_Notify_Tests_Command_Builder ()
+{
+}
+
+int
+TAO_Notify_Tests_Command_Builder::init (int argc, char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ ACE_CString current_arg;
+ TAO_Notify_Tests_Command_Factory* factory = 0;
+
+ if (arg_shifter.is_anything_left ())
+ {
+ current_arg = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ // obtain the factory
+ if (this->factory_map_.find (current_arg, factory) == -1)
+ ACE_DEBUG ((LM_DEBUG, "NS Command: %s not recognized!\n", current_arg.c_str ()));
+ else
+ {
+ TAO_Notify_Tests_Command* new_command = factory->create ();
+
+ new_command->init (arg_shifter);
+
+ if (this->start_command_ == 0)
+ {
+ this->start_command_ = new_command;
+ this->last_command_ = new_command;
+ }
+ else
+ {
+ // linked list
+ this->last_command_->next (new_command);
+ this->last_command_ = new_command;
+ }
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_Notify_Tests_Command_Builder::fini (void)
+{
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Command_Builder::_register (ACE_CString command_factory_name, TAO_Notify_Tests_Command_Factory* command_factory)
+{
+ if (this->factory_map_.bind (command_factory_name, command_factory) == -1)
+ ACE_DEBUG ((LM_DEBUG, "Failed to register command factory for %s\n", command_factory_name.c_str ()));
+ else
+ ACE_DEBUG ((LM_DEBUG, "Registered command factory for %s\n", command_factory_name.c_str ()));
+}
+
+void
+TAO_Notify_Tests_Command_Builder::execute (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->start_command_)
+ this->start_command_->execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+ACE_STATIC_SVC_DEFINE(TAO_Notify_Tests_Command_Builder,
+ TAO_Notify_Tests_Name::command_builder,
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_Notify_Tests_Command_Builder),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_NOTIFY_TEST, TAO_Notify_Tests_Command_Builder)
+
+ACE_STATIC_SVC_REQUIRE (TAO_Notify_Tests_Command_Builder)
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command_Builder.h b/TAO/orbsvcs/tests/Notify/lib/Command_Builder.h
new file mode 100644
index 00000000000..7ca63765dbe
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command_Builder.h
@@ -0,0 +1,74 @@
+/* -*- C++ -*- */
+/**
+ * @file Command_Builder.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_COMMAND_BUILDER_H
+#define TAO_Notify_Tests_COMMAND_BUILDER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Config.h"
+#include "ace/Service_Object.h"
+#include "ace/Unbounded_Queue.h"
+#include "ace/SString.h"
+#include "ace/CORBA_macros.h"
+#include "ace/Hash_Map_Manager.h"
+#include "tao/ORB.h"
+
+class TAO_Notify_Tests_Command_Factory;
+class TAO_Notify_Tests_Command;
+
+/**
+ * @class TAO_Notify_Tests_Command_Builder
+ *
+ * @brief Class for collating and serially executing command objects.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Command_Builder : public ACE_Service_Object
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Command_Builder (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Command_Builder ();
+
+ /// = Service_Object virtual method overloads.
+ virtual int init (int argc, char *argv[]);
+ virtual int fini (void);
+
+ /// Register the factory against the name of the factory.
+ void _register (ACE_CString command_factory_name, TAO_Notify_Tests_Command_Factory* command_factory);
+
+ /// Execute the <start_command_>.
+ void execute (ACE_ENV_SINGLE_ARG_DECL);
+
+protected:
+ /// The starting command. each command executes the next one when done.
+ TAO_Notify_Tests_Command* start_command_;
+
+ /// Last command initialized.
+ TAO_Notify_Tests_Command* last_command_;
+
+ /// The factory map.
+ ACE_Hash_Map_Manager <ACE_CString, TAO_Notify_Tests_Command_Factory*, TAO_SYNCH_MUTEX> factory_map_;
+};
+
+ACE_STATIC_SVC_DECLARE_EXPORT (TAO_NOTIFY_TEST, TAO_Notify_Tests_Command_Builder)
+
+ACE_FACTORY_DECLARE (TAO_NOTIFY_TEST, TAO_Notify_Tests_Command_Builder)
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_COMMAND_BUILDER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command_Factory.cpp b/TAO/orbsvcs/tests/Notify/lib/Command_Factory.cpp
new file mode 100644
index 00000000000..5005641fe4a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command_Factory.cpp
@@ -0,0 +1,14 @@
+// $Id$
+
+
+#include "Command_Factory.h"
+
+ACE_RCSID(lib, TAO_Command_Factory, "$Id$")
+
+TAO_Notify_Tests_Command_Factory::TAO_Notify_Tests_Command_Factory (void)
+{
+}
+
+TAO_Notify_Tests_Command_Factory::~TAO_Notify_Tests_Command_Factory ()
+{
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command_Factory.h b/TAO/orbsvcs/tests/Notify/lib/Command_Factory.h
new file mode 100644
index 00000000000..5101acad53f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command_Factory.h
@@ -0,0 +1,44 @@
+/* -*- C++ -*- */
+/**
+ * @file Command_Factory.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_COMMAND_FACTORY_H
+#define TAO_Notify_Tests_COMMAND_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_Notify_Tests_Command;
+
+/**
+ * @class TAO_Notify_Tests_Command_Factory
+ *
+ * @brief Base class for Factory to create command objects.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Command_Factory
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Command_Factory (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_Command_Factory ();
+
+ /// Create the command.
+ virtual TAO_Notify_Tests_Command* create (void) = 0;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_COMMAND_FACTORY_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.cpp b/TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.cpp
new file mode 100644
index 00000000000..8b3cd92b48f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.cpp
@@ -0,0 +1,53 @@
+// $Id$
+
+#ifndef TAO_Notify_Tests_COMMAND_FACTORY_T_CPP
+#define TAO_Notify_Tests_COMMAND_FACTORY_T_CPP
+
+#include "Command_Factory_T.h"
+
+ACE_RCSID(Notify, TAO_Command_Factory_T, "$Id$")
+
+#include "ace/Dynamic_Service.h"
+#include "tao/debug.h"
+#include "Command_Builder.h"
+#include "Name.h"
+
+template <class COMMAND>
+TAO_Notify_Tests_Command_Factory_T<COMMAND>::TAO_Notify_Tests_Command_Factory_T (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Creating command factory for %s\n", COMMAND::name()));
+}
+
+template <class COMMAND>
+TAO_Notify_Tests_Command_Factory_T<COMMAND>::~TAO_Notify_Tests_Command_Factory_T ()
+{
+}
+
+template <class COMMAND> int
+TAO_Notify_Tests_Command_Factory_T<COMMAND>::init (int /*argc*/, char/*argv*/ *[])
+{
+ /// register with Command builder
+ TAO_Notify_Tests_Command_Builder* cmd_builder =
+ ACE_Dynamic_Service<TAO_Notify_Tests_Command_Builder>::instance (TAO_Notify_Tests_Name::command_builder);
+
+ if (cmd_builder)
+ cmd_builder->_register (COMMAND::name(), this);
+ else
+ ACE_DEBUG ((LM_DEBUG, "Could not register command builder %s\n", COMMAND::name()));
+ return 0;
+}
+
+template <class COMMAND> int
+TAO_Notify_Tests_Command_Factory_T<COMMAND>::fini (void)
+{
+ return 0;
+}
+
+template <class COMMAND> TAO_Notify_Tests_Command*
+TAO_Notify_Tests_Command_Factory_T<COMMAND>::create (void)
+{
+ return new COMMAND ();
+}
+
+#endif /* TAO_Notify_Tests_COMMAND_FACTORY_T_CPP */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.h b/TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.h
new file mode 100644
index 00000000000..a7a8edce20a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Command_Factory_T.h
@@ -0,0 +1,64 @@
+/* -*- C++ -*- */
+/**
+ * @file Command_Factory_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_COMMAND_FACTORY_T_H
+#define TAO_COMMAND_FACTORY_T_H
+#include /**/ "ace/pre.h"
+
+#include "ace/Service_Config.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Object.h"
+#include "Command_Factory.h"
+
+class TAO_Notify_Tests_Command;
+
+/**
+ * @class TAO_Command_Factory_T
+ *
+ * @brief Template class to create COMMAND specific factories.
+ *
+ */
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+template <class COMMAND>
+class TAO_Notify_Tests_Command_Factory_T : public TAO_Notify_Tests_Command_Factory, public ACE_Service_Object
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Command_Factory_T (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Command_Factory_T ();
+
+ /// = Service_Object virtual method overloads.
+ virtual int init (int argc, char *argv[]);
+ virtual int fini (void);
+
+ /// Create the <COMMAND> command.
+ TAO_Notify_Tests_Command* create (void);
+};
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Command_Factory_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Command_Factory_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_COMMAND_FACTORY_T_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.cpp
new file mode 100644
index 00000000000..2965bc0094c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.cpp
@@ -0,0 +1,180 @@
+// $Id$
+
+#include "ConsumerAdmin_Command.h"
+
+ACE_RCSID(lib, TAO_ConsumerAdmin_Command, "$Id$")
+
+#include "LookupManager.h"
+#include "Name.h"
+#include "Options_Parser.h"
+
+TAO_Notify_Tests_ConsumerAdmin_Command::TAO_Notify_Tests_ConsumerAdmin_Command (void)
+ :ifgop_ (CosNotifyChannelAdmin::OR_OP), id_ (0)
+{
+}
+
+TAO_Notify_Tests_ConsumerAdmin_Command::~TAO_Notify_Tests_ConsumerAdmin_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_ConsumerAdmin_Command::get_name (void)
+{
+ return TAO_Notify_Tests_ConsumerAdmin_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_ConsumerAdmin_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::consumer_admin_command;
+}
+
+void
+TAO_Notify_Tests_ConsumerAdmin_Command::handle_create (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ LOOKUP_MANAGER->resolve (ec, this->factory_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // create consumer admin
+ CosNotifyChannelAdmin::ConsumerAdmin_var sa =
+ ec->new_for_consumers (this->ifgop_,
+ this->id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ LOOKUP_MANAGER->_register (sa.in(), this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+TAO_Notify_Tests_ConsumerAdmin_Command::handle_subscriptions (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin;
+
+ LOOKUP_MANAGER->resolve (admin, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Let the user see what we're subscribed for,
+ ACE_DEBUG ((LM_DEBUG, "Calling ConsumerAdmin subscription_change : "));
+
+ CORBA::ULong i = 0;
+
+ for (; i < added_.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "+(%s,%s), ", added_[i].domain_name.in (), added_[i].type_name.in ()));
+ }
+ for (i = 0; i < removed_.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "-(%s,%s), ", removed_[i].domain_name.in (), removed_[i].type_name.in ()));
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+
+ admin->subscription_change (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_ConsumerAdmin_Command::handle_set_qos (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin;
+
+ LOOKUP_MANAGER->resolve (admin, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ admin->set_qos (this->qos_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_ConsumerAdmin_Command::handle_status (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ //@@ TODO:
+}
+
+void
+TAO_Notify_Tests_ConsumerAdmin_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ if (arg_shifter.is_anything_left ())
+ {
+ /// -Create ca_name factory_name
+ if (arg_shifter.cur_arg_strncasecmp ("-Create") == 0)
+ {
+ this->command_ = CREATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ this->factory_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.cur_arg_strncasecmp ("-AND_OP") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->ifgop_ = CosNotifyChannelAdmin::AND_OP;
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-OR_OP") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->ifgop_ = CosNotifyChannelAdmin::OR_OP;
+ }
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Subscription") == 0) // -Subscription admin_name +added_type1 +-added_type2 ... -added_type3 -added_type4..
+ {
+ this->command_ = SUBSCRIPTION;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser options_parser;
+ options_parser.execute (this->added_, this->removed_, arg_shifter);
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Set_QoS") == 0) // -Set_QoS admin_name [Qos Options]
+ {
+ this->command_ = SET_QOS;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser qos_parser;
+ qos_parser.execute (this->qos_, arg_shifter);
+ }
+ }
+}
+
+void
+TAO_Notify_Tests_ConsumerAdmin_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == CREATE)
+ {
+ this->handle_create (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SUBSCRIPTION)
+ {
+ this->handle_subscriptions (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SET_QOS)
+ {
+ this->handle_set_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DUMP_STATE)
+ {
+ this->handle_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.h b/TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.h
new file mode 100644
index 00000000000..a94146e47bc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/ConsumerAdmin_Command.h
@@ -0,0 +1,90 @@
+/* -*- C++ -*- */
+/**
+ * @file ConsumerAdmin_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_CONSUMERADMIN_COMMAND_H
+#define TAO_Notify_Tests_CONSUMERADMIN_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "Command.h"
+
+/**
+ * @class TAO_Notify_Tests_ConsumerAdmin_Command
+ *
+ * @brief Command for ConsumerAdmin objects.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_ConsumerAdmin_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_ConsumerAdmin_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_ConsumerAdmin_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Name of object
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+
+ /// = Data Members
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ CREATE,
+ DESTROY,
+ SET_QOS,
+ SET_ADMIN,
+ SUBSCRIPTION,
+ DUMP_STATE
+ };
+
+ ACE_CString name_;
+
+ ACE_CString factory_;
+
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_;
+
+ CosNotifyChannelAdmin::AdminID id_;
+
+ CosNotification::QoSProperties qos_;
+
+ // Subscription change
+ CosNotification::EventTypeSeq added_;
+ CosNotification::EventTypeSeq removed_;
+
+ /// = Handlers
+ void handle_create (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_subscriptions (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_status (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_set_qos (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_CONSUMERADMIN_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Consumer_T.cpp b/TAO/orbsvcs/tests/Notify/lib/Consumer_T.cpp
new file mode 100644
index 00000000000..9441287f68b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Consumer_T.cpp
@@ -0,0 +1,107 @@
+// $Id$
+#ifndef TAO_Notify_Tests_Consumer_T_CPP
+#define TAO_Notify_Tests_Consumer_T_CPP
+
+#include "Consumer_T.h"
+
+ACE_RCSID(Notify, TAO_Notify_Tests_Consumer_T, "$Id$")
+
+template <class Consumer_Traits>
+TAO_Notify_Tests_Consumer_T<Consumer_Traits>::TAO_Notify_Tests_Consumer_T (void)
+{
+}
+
+template <class Consumer_Traits>
+TAO_Notify_Tests_Consumer_T<Consumer_Traits>::~TAO_Notify_Tests_Consumer_T ()
+{
+}
+
+template <class Consumer_Traits> ACE_TYPENAME TAO_Notify_Tests_Consumer_T<Consumer_Traits>::Proxy_Traits_PTR
+TAO_Notify_Tests_Consumer_T<Consumer_Traits>::get_proxy_supplier (void)
+{
+ return this->get_proxy ();
+}
+
+template <class Consumer_Traits> ACE_TYPENAME TAO_Notify_Tests_Consumer_T<Consumer_Traits>::Proxy_Traits_PTR
+TAO_Notify_Tests_Consumer_T<Consumer_Traits>::obtain_proxy (ACE_TYPENAME TAO_Notify_Tests_Consumer_T<Consumer_Traits>::Admin_Traits_PTR admin_ptr ACE_ENV_ARG_DECL)
+{
+ Consumer_Traits traits;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ admin_ptr->obtain_notification_push_supplier (traits.type_
+ , this->proxy_id_
+ ACE_ENV_ARG_PARAMETER
+ );
+
+ ACE_CHECK_RETURN (Proxy_Traits_INTERFACE::_nil ());
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_supplier.in ()));
+
+ return Proxy_Traits_INTERFACE::_narrow (proxy_supplier.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class Consumer_Traits> ACE_TYPENAME TAO_Notify_Tests_Consumer_T<Consumer_Traits>::Proxy_Traits_PTR
+TAO_Notify_Tests_Consumer_T<Consumer_Traits>::obtain_proxy (ACE_TYPENAME TAO_Notify_Tests_Consumer_T<Consumer_Traits>::Admin_Ext_Traits_PTR admin_ptr
+ , CosNotification::QoSProperties& qos
+ ACE_ENV_ARG_DECL)
+{
+ Consumer_Traits traits;
+
+ // create the proxy consumer
+ CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
+ admin_ptr->obtain_notification_push_supplier_with_qos (traits.type_
+ , this->proxy_id_
+ , qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (Proxy_Traits_INTERFACE::_nil ());
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_supplier.in ()));
+
+ return Proxy_Traits_INTERFACE::_narrow (proxy_supplier.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class Consumer_Traits> void
+TAO_Notify_Tests_Consumer_T<Consumer_Traits>::subscription_change (CosNotification::EventTypeSeq &added, CosNotification::EventTypeSeq& removed ACE_ENV_ARG_DECL)
+{
+ // Let the user see what we're subscribed for,
+ ACE_DEBUG ((LM_DEBUG, "Calling Consumer subscription change: "));
+
+ CORBA::ULong i = 0;
+
+ for (; i < added.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "+(%s,%s), ", added[i].domain_name.in (), added[i].type_name.in ()));
+ }
+ for (i = 0; i < removed.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "-(%s,%s), ", removed[i].domain_name.in (), removed[i].type_name.in ()));
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+
+ /// subscribe
+ ACE_TYPENAME Proxy_Traits::PTR proxy_supplier = this->get_proxy ();
+
+ if (proxy_supplier != 0)
+ {
+ proxy_supplier->subscription_change (added, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else
+ ACE_DEBUG ((LM_DEBUG, "Proxy Supplier not available, subscription change not made."));
+}
+
+template <class Consumer_Traits> void
+TAO_Notify_Tests_Consumer_T<Consumer_Traits>::offer_change
+ (const CosNotification::EventTypeSeq & /*added*/,
+ const CosNotification::EventTypeSeq & /*removed*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ // No-Op.
+}
+
+#endif /* TAO_Notify_Tests_Consumer_T_CPP */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Consumer_T.h b/TAO/orbsvcs/tests/Notify/lib/Consumer_T.h
new file mode 100644
index 00000000000..82f23b0af2a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Consumer_T.h
@@ -0,0 +1,98 @@
+/* -*- C++ -*- */
+/**
+ * @file Consumer_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_CONSUMER_T_H
+#define TAO_Notify_Tests_CONSUMER_T_H
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Peer_T.h"
+
+class TAO_Notify_Tests_ConsumerAdmin_Traits
+{
+ public:
+ typedef CosNotifyChannelAdmin::ConsumerAdmin INTERFACE;
+ typedef CosNotifyChannelAdmin::ConsumerAdmin_ptr PTR;
+ typedef CosNotifyChannelAdmin::ConsumerAdmin_var VAR;
+};
+
+class TAO_Notify_Tests_ConsumerAdmin_Ext_Traits
+{
+ public:
+ typedef NotifyExt::ConsumerAdmin INTERFACE;
+ typedef NotifyExt::ConsumerAdmin_ptr PTR;
+ typedef NotifyExt::ConsumerAdmin_var VAR;
+};
+
+/**
+ * @class TAO_Notify_Tests_Consumer_T
+ *
+ * @brief Base template to implement Consumers.
+ *
+ */
+template <class Consumer_Traits>
+class TAO_Notify_Tests_Consumer_T : public TAO_Notify_Tests_Peer_T <Consumer_Traits>
+{
+ typedef ACE_TYPENAME Consumer_Traits::Admin_Traits Admin_Traits;
+ typedef ACE_TYPENAME Consumer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef ACE_TYPENAME Consumer_Traits::Proxy_Traits Proxy_Traits;
+
+ typedef ACE_TYPENAME Proxy_Traits::INTERFACE Proxy_Traits_INTERFACE;
+ typedef ACE_TYPENAME Proxy_Traits::PTR Proxy_Traits_PTR;
+ typedef ACE_TYPENAME Admin_Traits::PTR Admin_Traits_PTR;
+ typedef ACE_TYPENAME Admin_Ext_Traits::PTR Admin_Ext_Traits_PTR;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Consumer_T (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Consumer_T ();
+
+ /// For backward compatibility. use <get_proxy> instead.
+ Proxy_Traits_PTR get_proxy_supplier (void);
+
+ /// Send subscription_change
+ virtual void subscription_change (CosNotification::EventTypeSeq &added, CosNotification::EventTypeSeq& removed ACE_ENV_ARG_DECL);
+
+protected:
+ /// Obtain Proxy.
+ virtual Proxy_Traits_PTR obtain_proxy (Admin_Traits_PTR admin_ptr ACE_ENV_ARG_DECL);
+
+ /// Obtain Proxy with QoS.
+ virtual Proxy_Traits_PTR obtain_proxy (Admin_Ext_Traits_PTR admin_ptr
+ , CosNotification::QoSProperties& qos
+ ACE_ENV_ARG_DECL);
+
+ // = NotifyPublish method
+ virtual void offer_change (const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ));
+};
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Consumer_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Consumer_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_CONSUMER_T_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.cpp b/TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.cpp
new file mode 100644
index 00000000000..502d535a91a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.cpp
@@ -0,0 +1,37 @@
+// $Id$
+
+#include "Direct_Consumer.h"
+
+ACE_RCSID(lib, TAO_Direct_Consumer, "$Id$")
+
+#include "LookupManager.h"
+
+TAO_Notify_Tests_Direct_Consumer::TAO_Notify_Tests_Direct_Consumer (void)
+{
+}
+
+TAO_Notify_Tests_Direct_Consumer::~TAO_Notify_Tests_Direct_Consumer ()
+{
+}
+
+void
+TAO_Notify_Tests_Direct_Consumer::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get the POA
+ PortableServer::POA_var poa;
+ LOOKUP_MANAGER->resolve (poa, this->poa_name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // set the POA
+ this->set_poa (poa.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Activate the consumer with the default_POA_.
+ CosNotifyComm::StructuredPushConsumer_var consumer_ref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register the activated object.
+ LOOKUP_MANAGER->_register (consumer_ref.in (), this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.h b/TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.h
new file mode 100644
index 00000000000..d27c57924c0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Direct_Consumer.h
@@ -0,0 +1,44 @@
+/* -*- C++ -*- */
+/**
+ * @file Direct_Consumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_DIRECT_CONSUMER_H
+#define TAO_Notify_Tests_DIRECT_CONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Periodic_Consumer.h"
+
+/**
+ * @class TAO_Notify_Tests_Direct_Consumer
+ *
+ * @brief Does not connect to the Notification Service. The Direct Supplier supplies events directly.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Direct_Consumer : public TAO_Notify_Tests_Periodic_Consumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Direct_Consumer (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Direct_Consumer ();
+
+ /// Connect using options parsed and set initial QoS.
+ virtual void connect (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_DIRECT_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.cpp b/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.cpp
new file mode 100644
index 00000000000..a647893b1f7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "Direct_Supplier.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "Direct_Supplier.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(Notify, TAO_Notify_Tests_Direct_Supplier, "$Id$")
+
+#include "LookupManager.h"
+
+TAO_Notify_Tests_Direct_Supplier::TAO_Notify_Tests_Direct_Supplier (ACE_CString& target)
+ : target_ (target)
+{
+}
+
+TAO_Notify_Tests_Direct_Supplier::~TAO_Notify_Tests_Direct_Supplier ()
+{
+}
+
+void
+TAO_Notify_Tests_Direct_Supplier::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get the POA
+ PortableServer::POA_var poa;
+ LOOKUP_MANAGER->resolve (poa, this->poa_name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // set the POA
+ this->set_poa (poa.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Get hold of the reference.
+ CosNotifyComm::StructuredPushSupplier_var supplier_ref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register the activated object.
+ LOOKUP_MANAGER->_register (supplier_ref.in (), this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the target object.
+ LOOKUP_MANAGER->resolve (this->target_object_, this->target_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Direct_Supplier::send_event (const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->target_object_.in ()));
+
+ this->target_object_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.h b/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.h
new file mode 100644
index 00000000000..999bf7463ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.h
@@ -0,0 +1,59 @@
+/* -*- C++ -*- */
+/**
+ * @file Direct_Supplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_DIRECT_SUPPLIER_H
+#define TAO_Notify_Tests_DIRECT_SUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Periodic_Supplier.h"
+
+/**
+ * @class TAO_Notify_Tests_Direct_Supplier
+ *
+ * @brief Send Directly to a consumer.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Direct_Supplier : public TAO_Notify_Tests_Periodic_Supplier
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Direct_Supplier (ACE_CString& target);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Direct_Supplier ();
+
+ /// Connect using options parsed and set initial QoS.
+ virtual void connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ // Send one event. Bypass sending to the Notify and send directly to taget consumer.
+ virtual void send_event (const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Target object.
+ ACE_CString target_;
+
+ /// This object is resolved in the connect method.
+ CosNotifyComm::StructuredPushConsumer_var target_object_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "Direct_Supplier.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_DIRECT_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.inl b/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.inl
new file mode 100644
index 00000000000..94e7f9bf7fa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Direct_Supplier.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "Direct_Supplier.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/Driver.cpp b/TAO/orbsvcs/tests/Notify/lib/Driver.cpp
new file mode 100644
index 00000000000..8985aa6f772
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Driver.cpp
@@ -0,0 +1,325 @@
+// $Id$
+
+#include "Driver.h"
+
+ACE_RCSID(lib, TAO_Driver, "$Id$")
+
+#include "ace/Dynamic_Service.h"
+#include "ace/Thread_Manager.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Argv_Type_Converter.h"
+#include "tao/ORB.h"
+#include "tao/ORB_Core.h"
+#include "ace/Sched_Params.h"
+#include "LookupManager.h"
+#include "Command_Builder.h"
+#include "Name.h"
+#include "Activation_Manager.h"
+
+const char *
+sched_policy_name (int sched_policy)
+{
+ const char *name = 0;
+
+ switch (sched_policy)
+ {
+ case ACE_SCHED_OTHER:
+ name = "SCHED_OTHER";
+ break;
+ case ACE_SCHED_RR:
+ name = "SCHED_RR";
+ break;
+ case ACE_SCHED_FIFO:
+ name = "SCHED_FIFO";
+ break;
+ }
+
+ return name;
+}
+
+void
+check_supported_priorities (CORBA::ORB_ptr orb)
+{
+ int sched_policy =
+ orb->orb_core ()->orb_params ()->ace_sched_policy ();
+
+ // Check that we have sufficient priority range to run this test,
+ // i.e., more than 1 priority level.
+ int max_priority =
+ ACE_Sched_Params::priority_max (sched_policy);
+ int min_priority =
+ ACE_Sched_Params::priority_min (sched_policy);
+
+ if (max_priority == min_priority)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Not enough priority levels with the %s scheduling policy\n"
+ "on this platform to run the test, terminating program....\n"
+ "Check svc.conf options\n",
+ sched_policy_name (sched_policy)));
+
+ ACE_OS::exit (2);
+ }
+}
+
+/*****************************************************************/
+TAO_Notify_Tests_Worker::TAO_Notify_Tests_Worker (void)
+{
+}
+
+void
+TAO_Notify_Tests_Worker::command_builder (TAO_Notify_Tests_Command_Builder* cmd_builder)
+{
+ this->cmd_builder_ = cmd_builder;
+}
+
+int
+TAO_Notify_Tests_Worker::svc (void)
+{
+#if 0
+ ACE_hthread_t current;
+ ACE_Thread::self (current);
+
+ int priority;
+ if (ACE_Thread::getprio (current, priority) == -1)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - Failed to get Worker thread priority\n")));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_ERROR, "Activated Worker Thread for commands @ priority:%d \n", priority));
+#endif
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Running Commands... \n"));
+ this->cmd_builder_->execute (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: ORB run error\n");
+ }
+ ACE_ENDTRY;
+
+
+ ACE_DEBUG ((LM_DEBUG, "Finished executing commands\n"));
+
+ return 0;
+}
+
+/*****************************************************************/
+
+TAO_Notify_Tests_ORB_Run_Worker::TAO_Notify_Tests_ORB_Run_Worker (void)
+{
+}
+
+void
+TAO_Notify_Tests_ORB_Run_Worker::orb (CORBA::ORB_ptr orb)
+{
+ orb_ = CORBA::ORB::_duplicate (orb);
+}
+
+void
+TAO_Notify_Tests_ORB_Run_Worker::run_period (ACE_Time_Value run_period)
+{
+ this->run_period_ = run_period;
+}
+
+int
+TAO_Notify_Tests_ORB_Run_Worker::svc (void)
+{
+#if 0
+ // ACE_Thread::getprio() fails on systems that do not support thread
+ // priorities. While we could just treat the failure as benign, I'm
+ // just disabling it altogether. It doesn't provide much value, and
+ // makes service startup needlessly more verbose. See bugzilla 2477
+ // for details.
+
+ ACE_hthread_t current;
+ ACE_Thread::self (current);
+
+ int priority;
+ if (ACE_Thread::getprio (current, priority) == -1)
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - Failed to get Worker thread priority\n")));
+ return -1;
+ }
+
+ ACE_DEBUG ((LM_ERROR, "Activated ORB Run Worker Thread to run the ORB @ priority:%d \n", priority));
+#endif
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_DEBUG ((LM_ERROR, "Running ORB, timeout in %d sec\n", this->run_period_.sec ()));
+
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+/*****************************************************************/
+
+TAO_Notify_Tests_Driver::TAO_Notify_Tests_Driver (void)
+ :cmd_builder_ (0), activation_manager_ (0), run_period_ (0,0), skip_priority_levels_check_ (0)
+{
+ this->activation_manager_ = new TAO_Notify_Tests_Activation_Manager ();
+ LOOKUP_MANAGER->_register (this->activation_manager_);
+
+ LOOKUP_MANAGER->_register (this);
+}
+
+TAO_Notify_Tests_Driver::~TAO_Notify_Tests_Driver ()
+{
+ delete this->activation_manager_;
+}
+
+int
+TAO_Notify_Tests_Driver::parse_args (int argc, char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ const ACE_TCHAR *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-Timeout")))) // -Timeout timeout_period_S
+ {
+ if (current_arg != 0)
+ {
+ this->run_period_ = ACE_Time_Value (ACE_OS::atoi (current_arg), 0);
+ }
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-IORoutput")))) // -IORoutput file_name
+ {
+ if (this->activation_manager_->ior_output_file (current_arg) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ current_arg), -1);
+
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-IORinput")))) // -IORinput file_name
+ {
+ if (this->activation_manager_->ior_input_file (current_arg) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for reading: %p\n",
+ current_arg), -1);
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Skip_Priority_Levels_Check") == 0) // Skip the check for multiple priority levels.
+ {
+ this->skip_priority_levels_check_ = 1;
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+int
+TAO_Notify_Tests_Driver::init (int argc, ACE_TCHAR *argv[] ACE_ENV_ARG_DECL)
+{
+ ACE_Argv_Type_Converter command_line(argc, argv);
+
+ this->orb_ = CORBA::ORB_init (command_line.get_argc(),
+ command_line.get_ASCII_argv(),
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->parse_args (argc, argv) == -1)
+ return -1;
+
+ // Make sure we can support multiple priorities that are required
+ // for this test.
+ if (skip_priority_levels_check_ == 0)
+ check_supported_priorities (this->orb_.in());
+
+ LOOKUP_MANAGER->init (this->orb_.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->cmd_builder_ =
+ ACE_Dynamic_Service<TAO_Notify_Tests_Command_Builder>::instance (TAO_Notify_Tests_Name::command_builder);
+
+ worker_.command_builder (this->cmd_builder_);
+
+ // Set the run period.
+ if (this->run_period_ != ACE_Time_Value::zero)
+ this->orb_run_worker_.run_period (this->run_period_);
+
+ // Set the ORB
+ this->orb_run_worker_.orb (this->orb_.in ());
+
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Driver::run (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // Task activation flags.
+ long flags =
+ THR_NEW_LWP |
+ THR_JOINABLE |
+ this->orb_->orb_core ()->orb_params ()->thread_creation_flags ();
+
+ // Become an active object.
+ int priority = ACE_Sched_Params::priority_min (this->orb_->orb_core ()->orb_params ()->sched_policy ()
+ , this->orb_->orb_core ()->orb_params ()->scope_policy ());
+
+ // Become an active object.
+ if (this->worker_.activate (flags, 1, 0, priority) == -1)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Insufficient privilege to activate ACE_Task.\n")));
+ else
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%t) Task activation at priority %d failed, ")
+ ACE_TEXT ("exiting!\n%a"),
+ ACE_DEFAULT_THREAD_PRIORITY,
+ -1));
+ }
+
+
+ // Activate the ORB run worker.
+ if (this->orb_run_worker_.activate (flags, 1, 0, priority) == -1)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Insufficient privilege to activate ACE_Task.\n")));
+ else
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%t) Task activation at priority %d failed, ")
+ ACE_TEXT ("exiting!\n%a"),
+ ACE_DEFAULT_THREAD_PRIORITY,
+ -1));
+ }
+
+ // Wait till we're done.
+ this->orb_run_worker_.thr_mgr ()->wait ();
+ this->worker_.thr_mgr ()->wait ();
+}
+
+void
+TAO_Notify_Tests_Driver::shutdown (void)
+{
+ this->orb_->shutdown ();
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Driver.h b/TAO/orbsvcs/tests/Notify/lib/Driver.h
new file mode 100644
index 00000000000..610e6b02e79
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Driver.h
@@ -0,0 +1,151 @@
+/* -*- C++ -*- */
+/**
+ * @file Driver.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_DRIVER_H
+#define TAO_Notify_Tests_DRIVER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Config.h"
+#include "ace/Task.h"
+
+#include "tao/ORB.h"
+
+#include "Driver_Base.h"
+
+class TAO_Notify_Tests_Command_Builder;
+class TAO_Notify_Tests_Activation_Manager;
+
+/**
+ * @class TAO_Notify_Tests_Worker
+ *
+ * @brief A Task to execute commands asynchronously.
+ *
+ */
+class TAO_Notify_Tests_Worker : public ACE_Task_Base
+{
+ // = TITLE
+ // Run a server thread
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class to run server threads
+ //
+public:
+ TAO_Notify_Tests_Worker (void);
+ // ctor
+
+ /// Set the command builder.
+ void command_builder (TAO_Notify_Tests_Command_Builder* cmd_builder);
+
+ virtual int svc (void);
+ // The thread entry point.
+
+ void shutdown (void);
+
+private:
+ /// The command builder
+ TAO_Notify_Tests_Command_Builder* cmd_builder_;
+};
+
+
+
+class TAO_Notify_Tests_ORB_Run_Worker : public ACE_Task_Base
+{
+ // = TITLE
+ // Run a server thread
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class to run server threads
+ //
+public:
+ TAO_Notify_Tests_ORB_Run_Worker (void);
+ // ctor
+
+ void orb (CORBA::ORB_ptr orb);
+
+ /// Srt the run period.
+ void run_period (ACE_Time_Value run_period);
+
+ virtual int svc (void);
+ // The thread entry point.
+
+private:
+ /// The orb
+ CORBA::ORB_var orb_;
+
+ /// ORB Run Period.
+ ACE_Time_Value run_period_;
+};
+
+
+/**
+ * @class TAO_Notify_Tests_Driver
+ *
+ * @brief A default Application Starter.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Driver : public TAO_Notify_Tests_Driver_Base
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Driver (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Driver ();
+
+ /// Init
+ int init (int argc, ACE_TCHAR *argv[] ACE_ENV_ARG_DECL);
+
+ /// Execute the commands.
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Shutdown
+ virtual void shutdown (void);
+
+protected:
+ /// Parse command line parameters.
+ int parse_args (int argc, char *argv[]);
+
+ /// The command builder
+ TAO_Notify_Tests_Command_Builder* cmd_builder_;
+
+ /// Manage activation of periodic suppliers and consumers.
+ TAO_Notify_Tests_Activation_Manager* activation_manager_;
+
+ /// Thread in which to run commands.
+ TAO_Notify_Tests_Worker worker_;
+
+ /// Thread in which to run the orb.
+ TAO_Notify_Tests_ORB_Run_Worker orb_run_worker_;
+
+ /// The ORB we run.
+ CORBA::ORB_var orb_;
+
+ /// ORB Run Period.
+ ACE_Time_Value run_period_;
+
+ /// The file for output
+ ACE_CString ior_output_file_;
+
+ /// The file for input
+ ACE_CString ior_input_file_;
+
+ /// Set to skip the check for multiple priority levels.
+ int skip_priority_levels_check_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_DRIVER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Driver_Base.h b/TAO/orbsvcs/tests/Notify/lib/Driver_Base.h
new file mode 100644
index 00000000000..fabec43f639
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Driver_Base.h
@@ -0,0 +1,38 @@
+/* -*- C++ -*- */
+/**
+ * @file Driver_Base.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_APPLICATION_STARTER_H
+#define TAO_Notify_Tests_APPLICATION_STARTER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class TAO_Notify_Tests_Driver_Base
+ *
+ * @brief Base class for Driver.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Driver_Base
+{
+public:
+ virtual ~TAO_Notify_Tests_Driver_Base () {};
+
+ /// Shutdown
+ virtual void shutdown (void) = 0;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_APPLICATION_STARTER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp
new file mode 100644
index 00000000000..519fee9fc45
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.cpp
@@ -0,0 +1,225 @@
+// $Id$
+
+#include "EventChannel_Command.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(lib, TAO_EventChannel_Command, "$Id$")
+
+#include "LookupManager.h"
+#include "Name.h"
+#include "Options_Parser.h"
+#include "ace/Dynamic_Service.h"
+#include "../../../orbsvcs/Notify/Service.h"
+
+TAO_Notify_Tests_EventChannel_Command::TAO_Notify_Tests_EventChannel_Command (void)
+ : collocated_ (0)
+{
+}
+
+TAO_Notify_Tests_EventChannel_Command::~TAO_Notify_Tests_EventChannel_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_EventChannel_Command::get_name (void)
+{
+ return TAO_Notify_Tests_EventChannel_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_EventChannel_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::event_channel_command;
+}
+
+void
+TAO_Notify_Tests_EventChannel_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ if (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-Create") == 0) // -Create ec_name factory_name [COLLOCATED]
+ {
+ this->command_ = CREATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ this->factory_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.cur_arg_strncasecmp ("COLLOCATED") == 0)
+ {
+ this->collocated_ = 1;
+ }
+
+ if (arg_shifter.cur_arg_strncasecmp ("COLOCATED") == 0) // grandfather in misspelled
+ {
+ this->collocated_ = 1;
+ ACE_DEBUG ((LM_WARNING, "TAO_Notify_Tests_EventChannel_Command::init --"
+ " warning: deprecated misspelled COLOCATED option used.\n"));
+ }
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Destroy") == 0) // -Destroy ec_name
+ {
+ this->command_ = DESTROY;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Set_QoS") == 0) // -Set_QoS ec_name [Qos Options]
+ {
+ this->command_ = SET_QOS;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser qos_parser;
+ qos_parser.execute (this->qos_, arg_shifter);
+ }
+ }
+}
+
+void
+TAO_Notify_Tests_EventChannel_Command::create_collocated_ecf (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory;
+
+ // The Service Object.
+ TAO_Notify_Service* notify_service = 0;
+
+ notify_service = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_NOTIFICATION_SERVICE_NAME);
+
+ if (notify_service == 0)
+ {
+ notify_service = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_NOTIFY_DEF_EMO_FACTORY_NAME);
+ }
+
+ if (notify_service == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Service not found! check conf. file\n"));
+ return;
+ }
+
+ // Resolve some helpers.
+ CORBA::ORB_var orb;
+ PortableServer::POA_var poa;
+ CosNaming::NamingContextExt_var naming;
+
+ LOOKUP_MANAGER->resolve (orb);
+
+ LOOKUP_MANAGER->resolve (poa);
+
+ LOOKUP_MANAGER->resolve (naming);
+
+ notify_service->init_service (orb.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Activate the factory
+ notify_factory =
+ notify_service->create (poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Register with the Naming Service
+ CosNaming::Name_var name =
+ naming->to_name (TAO_Notify_Tests_Name::event_channel_factory
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ naming->rebind (name.in (),
+ notify_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_EventChannel_Command::handle_create (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->collocated_ == 1)
+ {
+ this->create_collocated_ecf (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ CosNotifyChannelAdmin::EventChannelFactory_var ec_factory;
+
+ LOOKUP_MANAGER->resolve (ec_factory , TAO_Notify_Tests_Name::event_channel_factory ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties qos;
+ CosNotification::AdminProperties admin;
+
+ // Create an event channel
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ ec_factory->create_channel (qos,
+ admin,
+ this->id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ LOOKUP_MANAGER->_register (ec.in(), this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_EventChannel_Command::handle_destroy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "Destroying event channel %s\n", this->name_.c_str ()));
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ LOOKUP_MANAGER->resolve (ec, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ec->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+void
+TAO_Notify_Tests_EventChannel_Command::handle_set_qos (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ LOOKUP_MANAGER->resolve (ec, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ec->set_qos (this->qos_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_EventChannel_Command::handle_status (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ //@@ TODO: Implement
+}
+
+void
+TAO_Notify_Tests_EventChannel_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == CREATE)
+ {
+ this->handle_create (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DESTROY)
+ {
+ this->handle_destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SET_QOS)
+ {
+ this->handle_set_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DUMP_STATE)
+ {
+ this->handle_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.h b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.h
new file mode 100644
index 00000000000..35a2baa4bb0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/EventChannel_Command.h
@@ -0,0 +1,95 @@
+/* -*- C++ -*- */
+/**
+ * @file EventChannel_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_EVENTCHANNEL_COMMAND_H
+#define TAO_Notify_Tests_EVENTCHANNEL_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "Command.h"
+//#include "../../../orbsvcs/Notify/CosNotify_Initializer.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+class TAO_Notify_Service;
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class TAO_Notify_Tests_EventChannel_Command
+ *
+ * @brief Command object for event channels.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_EventChannel_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_EventChannel_Command (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_EventChannel_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Name of object
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+ ///= Data Members
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ CREATE,
+ DESTROY,
+ SET_QOS,
+ SET_ADMIN,
+ DUMP_STATE
+ };
+
+ ACE_CString name_;
+
+ ACE_CString factory_;
+
+ CosNotifyChannelAdmin::ChannelID id_;
+
+ CosNotification::QoSProperties qos_;
+
+ CosNotification::AdminProperties admin_;
+
+ /// Flag to tell if the Channel Factory should be collocated.
+ CORBA::Boolean collocated_;
+
+ /// Helper method to create a collocated ECF.
+ void create_collocated_ecf (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// = Handlers
+ void handle_create (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_destroy (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_set_qos (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_status (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_EVENTCHANNEL_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Factories_Define.cpp b/TAO/orbsvcs/tests/Notify/lib/Factories_Define.cpp
new file mode 100644
index 00000000000..337e8651108
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Factories_Define.cpp
@@ -0,0 +1,23 @@
+// $Id$
+#include "Factories_Define.h"
+
+ACE_RCSID(lib, TAO_Notify_Tests_Factories_Define, "$Id$")
+
+#include "Name.h"
+#include "Command_Factory_T.h"
+
+#include "EventChannel_Command.h"
+#include "Application_Command.h"
+#include "SupplierAdmin_Command.h"
+#include "ConsumerAdmin_Command.h"
+#include "Periodic_Supplier_Command.h"
+#include "Periodic_Consumer_Command.h"
+#include "Filter_Command.h"
+
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_NOTIFY_TEST,TAO_Notify_Tests_EventChannel_Command,TAO_Notify_Tests_Name::event_channel_command_factory)
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_NOTIFY_TEST,TAO_Notify_Tests_Application_Command,TAO_Notify_Tests_Name::application_command_factory)
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_NOTIFY_TEST,TAO_Notify_Tests_SupplierAdmin_Command,TAO_Notify_Tests_Name::supplier_admin_command_factory)
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_NOTIFY_TEST,TAO_Notify_Tests_ConsumerAdmin_Command,TAO_Notify_Tests_Name::consumer_admin_command_factory)
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_NOTIFY_TEST,TAO_Notify_Tests_Periodic_Supplier_Command,TAO_Notify_Tests_Name::periodic_supplier_command_factory)
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_NOTIFY_TEST,TAO_Notify_Tests_Periodic_Consumer_Command,TAO_Notify_Tests_Name::periodic_consumer_command_factory)
+TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(TAO_NOTIFY_TEST,TAO_Notify_Tests_Filter_Command,TAO_Notify_Tests_Name::filter_command_factory)
diff --git a/TAO/orbsvcs/tests/Notify/lib/Factories_Define.h b/TAO/orbsvcs/tests/Notify/lib/Factories_Define.h
new file mode 100644
index 00000000000..59a5aadd8ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Factories_Define.h
@@ -0,0 +1,38 @@
+/* -*- C++ -*- */
+/**
+ * @file Factories_Define.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_FACTORIES_DEFINE_H
+#define TAO_FACTORIES_DEFINE_H
+#include /**/ "ace/pre.h"
+
+#include "Command_Factory_T.h"
+
+#define TAO_Notify_Tests_COMMAND_FACTORY_DEFINE(export, command, factory_name) \
+\
+typedef TAO_Notify_Tests_Command_Factory_T <command> command##_Factory;\
+\
+ACE_STATIC_SVC_DECLARE_EXPORT (export, command##_Factory) \
+\
+ACE_FACTORY_DECLARE (export, command##_Factory) \
+\
+ACE_STATIC_SVC_DEFINE(command##_Factory, \
+ factory_name, \
+ ACE_SVC_OBJ_T, \
+ &ACE_SVC_NAME (command##_Factory), \
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, \
+ 0) \
+\
+ACE_FACTORY_DEFINE (export, command##_Factory) \
+\
+
+
+#include /**/ "ace/post.h"
+#endif /* TAO_FACTORIES_DEFINE_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Filter_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/Filter_Command.cpp
new file mode 100644
index 00000000000..2bb7bb716b4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Filter_Command.cpp
@@ -0,0 +1,208 @@
+// $Id$
+
+#include "Filter_Command.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(lib, TAO_Filter_Command, "$Id$")
+
+#include "LookupManager.h"
+#include "Name.h"
+
+TAO_Notify_Tests_Filter_Command::TAO_Notify_Tests_Filter_Command (void)
+{
+}
+
+TAO_Notify_Tests_Filter_Command::~TAO_Notify_Tests_Filter_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_Filter_Command::get_name (void)
+{
+ return TAO_Notify_Tests_Filter_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_Filter_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::filter_command;
+}
+
+void
+TAO_Notify_Tests_Filter_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ if (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-CreateFactory") == 0) // -Create factory_name ec
+ {
+ this->command_ = CREATE_FACTORY;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current (); // FF name
+ arg_shifter.consume_arg ();
+
+ this->factory_ = arg_shifter.get_current (); //EC
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-CreateFilter") == 0) // -CreateFilter filter_name filterfactory_name
+ {
+ this->command_ = CREATE_FILTER;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current (); // Filter name
+
+ arg_shifter.consume_arg ();
+
+ this->factory_ = arg_shifter.get_current (); //FF
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Add_Constraint") == 0) // -Add_Constraint filter_name constraint_expr
+ {
+ this->command_ = ADD_CONSTRAINT;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current (); // Filter name
+
+ arg_shifter.consume_arg ();
+
+ this->constraint_ = arg_shifter.get_current (); //Constraint
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Add_Filter") == 0) // -Add_Filter filter_name FilterAdmin_Name
+ {
+ this->command_ = ADD_FILTER;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current (); // Filter name
+
+ arg_shifter.consume_arg ();
+
+ this->factory_ = arg_shifter.get_current (); //FilterAdmin
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Destroy") == 0) // -Destroy filter_name
+ {
+ this->command_ = DESTROY;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current (); // filter
+
+ arg_shifter.consume_arg ();
+ }
+ }
+}
+
+void
+TAO_Notify_Tests_Filter_Command::handle_create_filter_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ LOOKUP_MANAGER->resolve (ec, this->factory_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyFilter::FilterFactory_var ff =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ LOOKUP_MANAGER->_register (ff.in(), this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Filter_Command::handle_create_filter (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyFilter::FilterFactory_var ff;
+
+ LOOKUP_MANAGER->resolve (ff , this->factory_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyFilter::Filter_var filter =
+ ff->create_filter ("ETCL" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ LOOKUP_MANAGER->_register (filter.in(), this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Filter_Command::handle_add_constraint (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyFilter::Filter_var filter;
+
+ LOOKUP_MANAGER->resolve (filter , this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr = CORBA::string_dup (this->constraint_.c_str ());
+
+ ACE_DEBUG ((LM_DEBUG, "Adding constraint %s\n", this->constraint_.c_str ()));
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Filter_Command::handle_add_filter (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyFilter::Filter_var filter;
+
+ LOOKUP_MANAGER->resolve (filter , this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyFilter::FilterAdmin_var filter_admin;
+
+ LOOKUP_MANAGER->resolve (filter_admin , this->factory_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ filter_admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Filter_Command::handle_destroy_filter (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyFilter::Filter_var filter;
+
+ LOOKUP_MANAGER->resolve (filter, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ filter->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Filter_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == CREATE_FACTORY)
+ {
+ this->handle_create_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == CREATE_FILTER)
+ {
+ this->handle_create_filter (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == ADD_CONSTRAINT)
+ {
+ this->handle_add_constraint (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == ADD_FILTER)
+ {
+ this->handle_add_filter (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DESTROY)
+ {
+ this->handle_destroy_filter (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Filter_Command.h b/TAO/orbsvcs/tests/Notify/lib/Filter_Command.h
new file mode 100644
index 00000000000..2678b6c4437
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Filter_Command.h
@@ -0,0 +1,83 @@
+/* -*- C++ -*- */
+/**
+ * @file Filter_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_FILTER_COMMAND_H
+#define TAO_Notify_Tests_FILTER_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "Command.h"
+
+/**
+ * @class TAO_Notify_Tests_Filter_Command
+ *
+ * @brief Command for Filter Objects.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Filter_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Filter_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Filter_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Name of object
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ CREATE_FACTORY,
+ CREATE_FILTER,
+ ADD_CONSTRAINT,
+ ADD_FILTER,
+ REMOVE_CONSTRAINT,
+ DESTROY,
+ DUMP_STATE
+ };
+
+ ACE_CString name_;
+
+ ACE_CString factory_;
+
+ ACE_CString constraint_;
+
+ ///= Handlers
+ void handle_create_filter_factory (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_create_filter (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_add_constraint (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_add_filter (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_destroy_filter (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_FILTER_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp b/TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp
new file mode 100644
index 00000000000..14ebdb482d8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/LookupManager.cpp
@@ -0,0 +1,256 @@
+// $Id$
+
+#include "LookupManager.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID(lib, TAO_LookupManager, "$Id$")
+
+#include "Name.h"
+
+TAO_Notify_Tests_LookupManager::TAO_Notify_Tests_LookupManager (void)
+ : app_ (0)
+ , activation_manager_ (0)
+ , priority_mapping_ (0)
+{
+}
+
+TAO_Notify_Tests_LookupManager::~TAO_Notify_Tests_LookupManager ()
+{
+}
+
+void
+TAO_Notify_Tests_LookupManager::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
+{
+ orb_ = CORBA::ORB::_duplicate (orb);
+
+ this->resolve (this->root_poa_, TAO_Notify_Tests_Name::root_poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->resolve (this->naming_, TAO_Notify_Tests_Name::naming_service ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_LookupManager::_register (CORBA::Object_ptr obj, const char* obj_name ACE_ENV_ARG_DECL)
+{
+ CosNaming::Name_var name =
+ this->naming_->to_name (obj_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ //@@ Warning: this is rebind..
+ this->naming_->rebind (name.in (),
+ obj
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Registered %s with Naming Service\n", obj_name));
+}
+
+void
+TAO_Notify_Tests_LookupManager::_register (TAO_Notify_Tests_Driver_Base* app)
+{
+ this->app_ = app;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (TAO_Notify_Tests_Driver_Base*& app)
+{
+ app = this->app_;
+}
+
+void
+TAO_Notify_Tests_LookupManager::_register (TAO_Notify_Tests_Activation_Manager* activation_manager)
+{
+ this->activation_manager_ = activation_manager;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (TAO_Notify_Tests_Activation_Manager*& activation_manager)
+{
+ activation_manager = this->activation_manager_;
+}
+
+void
+TAO_Notify_Tests_LookupManager::_register (TAO_Notify_Tests_Priority_Mapping* priority_mapping)
+{
+ this->priority_mapping_ = priority_mapping;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (TAO_Notify_Tests_Priority_Mapping* &priority_mapping)
+{
+ priority_mapping = this->priority_mapping_;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CORBA::ORB_var& orb)
+{
+ orb = this->orb_;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (PortableServer::POA_var& poa)
+{
+ poa = this->root_poa_;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNaming::NamingContextExt_var& naming)
+{
+ naming = this->naming_;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (PortableServer::POA_var& poa, const char *poa_name ACE_ENV_ARG_DECL)
+{
+ if (ACE_OS::strcmp (poa_name, TAO_Notify_Tests_Name::root_poa) == 0)
+ {
+ CORBA::Object_ptr poa_object =
+ this->orb_->resolve_initial_references(TAO_Notify_Tests_Name::root_poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (poa_object))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to resolve the Root POA.\n"));
+ return;
+ }
+
+ poa = PortableServer::POA::_narrow (poa_object ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->root_poa_ = poa;
+ }
+ else
+ {
+ poa = root_poa_->find_POA (poa_name, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNaming::NamingContextExt_var& naming, const char *naming_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (naming_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW (CORBA::UNKNOWN ());
+
+ this->naming_ = CosNaming::NamingContextExt::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNaming::NamingContextExt::_duplicate (this->naming_.in ());
+
+ naming = this->naming_;
+}
+
+CORBA::Object_ptr
+TAO_Notify_Tests_LookupManager::resolve_object (const char* obj_name ACE_ENV_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (obj_name);
+
+ CORBA::Object_var obj =
+ this->naming_->resolve (name ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (CORBA::Object::_nil ());
+ return obj._retn ();
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyChannelAdmin::EventChannelFactory_var& ecf, const char * factory_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (factory_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ecf = CosNotifyChannelAdmin::EventChannelFactory::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyChannelAdmin::EventChannel_var& ec, const char * channel_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (channel_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ec = CosNotifyChannelAdmin::EventChannel::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyChannelAdmin::SupplierAdmin_var& sa, const char * admin_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (admin_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ sa = CosNotifyChannelAdmin::SupplierAdmin::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyChannelAdmin::ConsumerAdmin_var& ca , const char * admin_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (admin_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ca = CosNotifyChannelAdmin::ConsumerAdmin::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyComm::StructuredPushSupplier_var& supplier, const char *supplier_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (supplier_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier = CosNotifyComm::StructuredPushSupplier::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyComm::StructuredPushConsumer_var& consumer, const char * consumer_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (consumer_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer = CosNotifyComm::StructuredPushConsumer::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyFilter::FilterFactory_var& ff, const char *filter_factory_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (filter_factory_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ff = CosNotifyFilter::FilterFactory::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyFilter::Filter_var& filter, const char *filter_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (filter_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ filter = CosNotifyFilter::Filter::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_LookupManager::resolve (CosNotifyFilter::FilterAdmin_var& filter_admin, const char *filter_admin_name ACE_ENV_ARG_DECL)
+{
+ CORBA::Object_var object = this->resolve_object (filter_admin_name ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ filter_admin = CosNotifyFilter::FilterAdmin::_narrow (object.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Singleton<TAO_Notify_Tests_LookupManager, ACE_Thread_Mutex> *ACE_Singleton<TAO_Notify_Tests_LookupManager, ACE_Thread_Mutex>::singleton_;
+#endif /*ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/Notify/lib/LookupManager.h b/TAO/orbsvcs/tests/Notify/lib/LookupManager.h
new file mode 100644
index 00000000000..b7ebe49ef06
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/LookupManager.h
@@ -0,0 +1,120 @@
+/* -*- C++ -*- */
+/**
+ * @file LookupManager.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_LOOKUPMANAGER_H
+#define TAO_Notify_Tests_LOOKUPMANAGER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Singleton.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/Hash_Map_Manager.h"
+
+class TAO_Notify_Tests_Periodic_Supplier;
+class TAO_Notify_Tests_Periodic_Consumer;
+class TAO_Notify_Tests_Driver_Base;
+class TAO_Notify_Tests_Activation_Manager;
+class TAO_Notify_Tests_Priority_Mapping;
+
+/**
+ * @class TAO_Notify_Tests_LookupManager
+ *
+ * @brief Utility to register and resolve object references.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_LookupManager
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_LookupManager (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_LookupManager ();
+
+ /// Init
+ void init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
+
+ ///= Register Objects
+
+ /// Register the application starter object.
+ void _register (TAO_Notify_Tests_Driver_Base* app);
+ void _register (TAO_Notify_Tests_Activation_Manager* activation_manager);
+ void _register (TAO_Notify_Tests_Priority_Mapping *priority_mapping);
+
+ /// Register Objects with Naming Service
+ void _register(CORBA::Object_ptr obj, const char* obj_name ACE_ENV_ARG_DECL);
+
+ ///= Resolve methods
+
+ /// Resolve the application starter object.
+ void resolve (TAO_Notify_Tests_Driver_Base*& app);
+ void resolve (TAO_Notify_Tests_Activation_Manager*& activation_manager);
+ void resolve (TAO_Notify_Tests_Priority_Mapping* &priority_mapping);
+
+ /// Return the orb
+ void resolve (CORBA::ORB_var& orb);
+
+ /// Return the Root POA.
+ void resolve (PortableServer::POA_var& poa);
+
+ /// Return the default Naming context.
+ void resolve (CosNaming::NamingContextExt_var& naming);
+
+ void resolve (PortableServer::POA_var& poa, const char *poa_name ACE_ENV_ARG_DECL);
+ void resolve (CosNaming::NamingContextExt_var& naming, const char *naming_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyChannelAdmin::EventChannelFactory_var& ecf, const char *factory_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyChannelAdmin::EventChannel_var& ec, const char *channel_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyChannelAdmin::SupplierAdmin_var& sa, const char *admin_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyChannelAdmin::ConsumerAdmin_var& ca , const char *admin_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyComm::StructuredPushSupplier_var& supplier, const char *supplier_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyComm::StructuredPushConsumer_var& consumer, const char *consumer_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyFilter::FilterFactory_var& ff, const char *filter_factory_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyFilter::Filter_var& filter, const char *filter_name ACE_ENV_ARG_DECL);
+ void resolve (CosNotifyFilter::FilterAdmin_var& filter_admin, const char *filter_admin_name ACE_ENV_ARG_DECL);
+
+protected:
+ /// Application Starter
+ TAO_Notify_Tests_Driver_Base* app_;
+
+ /// Activation Manager
+ TAO_Notify_Tests_Activation_Manager* activation_manager_;
+
+ /// Resolve to CORBA::Object
+ CORBA::Object_ptr resolve_object (const char* obj_name ACE_ENV_ARG_DECL);
+
+ // The ORB that we use.
+ CORBA::ORB_var orb_;
+
+ // Reference to the root poa.
+ PortableServer::POA_var root_poa_;
+
+ // A naming context.
+ CosNaming::NamingContextExt_var naming_;
+
+ // Priority Mapping.
+ TAO_Notify_Tests_Priority_Mapping *priority_mapping_;
+};
+
+TAO_NOTIFY_TEST_SINGLETON_DECLARE (ACE_Singleton, TAO_Notify_Tests_LookupManager, TAO_SYNCH_MUTEX)
+
+typedef ACE_Singleton<TAO_Notify_Tests_LookupManager, TAO_SYNCH_MUTEX> _TAO_Notify_Tests_LookupManager;
+
+#define LOOKUP_MANAGER _TAO_Notify_Tests_LookupManager::instance()
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_LOOKUPMANAGER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Makefile.am b/TAO/orbsvcs/tests/Notify/lib/Makefile.am
new file mode 100644
index 00000000000..a209a46382e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Makefile.am
@@ -0,0 +1,183 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.NotifyTests_Lib.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES = \
+ Activation_ManagerC.cpp \
+ Activation_ManagerC.h \
+ Activation_ManagerC.inl \
+ Activation_ManagerS.cpp \
+ Activation_ManagerS.h \
+ Activation_ManagerS.inl \
+ Activation_ManagerS_T.cpp \
+ Activation_ManagerS_T.h \
+ Activation_ManagerS_T.inl
+
+CLEANFILES = \
+ Activation_Manager-stamp \
+ Activation_ManagerC.cpp \
+ Activation_ManagerC.h \
+ Activation_ManagerC.inl \
+ Activation_ManagerS.cpp \
+ Activation_ManagerS.h \
+ Activation_ManagerS.inl \
+ Activation_ManagerS_T.cpp \
+ Activation_ManagerS_T.h \
+ Activation_ManagerS_T.inl
+
+Activation_ManagerC.cpp Activation_ManagerC.h Activation_ManagerC.inl Activation_ManagerS.cpp Activation_ManagerS.h Activation_ManagerS.inl Activation_ManagerS_T.cpp Activation_ManagerS_T.h Activation_ManagerS_T.inl: Activation_Manager-stamp
+
+Activation_Manager-stamp: $(srcdir)/Activation_Manager.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/Activation_Manager.idl
+ @touch $@
+
+noinst_LTLIBRARIES = libTAO_NotifyTests.la
+
+libTAO_NotifyTests_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL \
+ -DTAO_NOTIFY_TEST_BUILD_DLL
+
+libTAO_NotifyTests_la_SOURCES = \
+ Activation_Manager.cpp \
+ Activation_ManagerC.cpp \
+ Activation_ManagerS.cpp \
+ Application_Command.cpp \
+ Command.cpp \
+ Command_Builder.cpp \
+ Command_Factory.cpp \
+ ConsumerAdmin_Command.cpp \
+ Direct_Consumer.cpp \
+ Direct_Supplier.cpp \
+ Driver.cpp \
+ EventChannel_Command.cpp \
+ Factories_Define.cpp \
+ Filter_Command.cpp \
+ LookupManager.cpp \
+ Name.cpp \
+ Notify_Test_Client.cpp \
+ Options_Parser.cpp \
+ Peer.cpp \
+ Periodic_Consumer.cpp \
+ Periodic_Consumer_Command.cpp \
+ Periodic_Supplier.cpp \
+ Periodic_Supplier_Command.cpp \
+ Priority_Mapping.cpp \
+ PushConsumer.cpp \
+ PushSupplier.cpp \
+ Relay_Consumer.cpp \
+ SequencePushConsumer.cpp \
+ SequencePushSupplier.cpp \
+ StructuredEvent.cpp \
+ StructuredPushConsumer.cpp \
+ StructuredPushSupplier.cpp \
+ SupplierAdmin_Command.cpp \
+ Task_Callback.cpp \
+ Task_Stats.cpp \
+ common.cpp
+
+noinst_HEADERS = \
+ Activation_Manager.h \
+ Activation_Manager.idl \
+ Activation_ManagerC.h \
+ Activation_ManagerC.inl \
+ Activation_ManagerS.h \
+ Activation_ManagerS.inl \
+ Activation_ManagerS_T.cpp \
+ Activation_ManagerS_T.h \
+ Activation_ManagerS_T.inl \
+ Application_Command.h \
+ Command.h \
+ Command_Builder.h \
+ Command_Factory.h \
+ Command_Factory_T.cpp \
+ Command_Factory_T.h \
+ ConsumerAdmin_Command.h \
+ Consumer_T.cpp \
+ Consumer_T.h \
+ Direct_Consumer.h \
+ Direct_Supplier.h \
+ Direct_Supplier.inl \
+ Driver.h \
+ Driver_Base.h \
+ EventChannel_Command.h \
+ Factories_Define.h \
+ Filter_Command.h \
+ LookupManager.h \
+ Name.h \
+ Notify_PushConsumer.h \
+ Notify_PushSupplier.h \
+ Notify_SequencePushConsumer.h \
+ Notify_SequencePushSupplier.h \
+ Notify_StructuredPushConsumer.h \
+ Notify_StructuredPushSupplier.h \
+ Notify_Test_Client.h \
+ Options_Parser.h \
+ Peer.h \
+ Peer.inl \
+ Peer_T.cpp \
+ Peer_T.h \
+ Periodic_Consumer.h \
+ Periodic_Consumer_Command.h \
+ Periodic_Supplier.h \
+ Periodic_Supplier_Command.h \
+ Priority_Mapping.h \
+ PushConsumer.h \
+ PushConsumer.inl \
+ PushSupplier.h \
+ PushSupplier.inl \
+ Relay_Consumer.h \
+ Relay_Consumer.inl \
+ SequencePushConsumer.h \
+ SequencePushConsumer.inl \
+ SequencePushSupplier.h \
+ SequencePushSupplier.inl \
+ StructuredEvent.h \
+ StructuredPushConsumer.h \
+ StructuredPushConsumer.inl \
+ StructuredPushSupplier.h \
+ StructuredPushSupplier.inl \
+ SupplierAdmin_Command.h \
+ Supplier_T.cpp \
+ Supplier_T.h \
+ Task_Callback.h \
+ Task_Stats.h \
+ Task_Stats.inl \
+ common.h \
+ notify_test_export.h
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/lib/Name.cpp b/TAO/orbsvcs/tests/Notify/lib/Name.cpp
new file mode 100644
index 00000000000..87e0c004674
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Name.cpp
@@ -0,0 +1,37 @@
+// $Id$
+
+#include "Name.h"
+
+ACE_RCSID(lib, TAO_Name, "$Id$")
+
+#define TAO_Notify_Tests_DECLARE_NAME(target, name) \
+const char* const TAO_Notify_Tests_Name::target = ACE_TEXT (name);
+
+TAO_Notify_Tests_DECLARE_NAME (command_builder,"Command_Builder")
+TAO_Notify_Tests_DECLARE_NAME (root_poa,"RootPOA")
+TAO_Notify_Tests_DECLARE_NAME (event_channel_factory,"NotifyEventChannelFactory")
+TAO_Notify_Tests_DECLARE_NAME (naming_service,"NameService")
+
+TAO_Notify_Tests_DECLARE_NAME (application_command,"Application")
+TAO_Notify_Tests_DECLARE_NAME (application_command_factory,"Application_Command_Factory")
+
+TAO_Notify_Tests_DECLARE_NAME (event_channel_command,"EventChannel")
+TAO_Notify_Tests_DECLARE_NAME (event_channel_command_factory,"EventChannel_Command_Factory")
+
+TAO_Notify_Tests_DECLARE_NAME (consumer_admin_command,"ConsumerAdmin")
+TAO_Notify_Tests_DECLARE_NAME (consumer_admin_command_factory,"ConsumerAdmin_Command_Factory")
+
+TAO_Notify_Tests_DECLARE_NAME (supplier_admin_command,"SupplierAdmin")
+TAO_Notify_Tests_DECLARE_NAME (supplier_admin_command_factory,"SupplierAdmin_Command_Factory")
+
+TAO_Notify_Tests_DECLARE_NAME (periodic_supplier_command, "PeriodicSupplier")
+TAO_Notify_Tests_DECLARE_NAME (periodic_supplier_command_factory, "PeriodicSupplier_Command_Factory")
+
+TAO_Notify_Tests_DECLARE_NAME (periodic_consumer_command, "PeriodicConsumer")
+TAO_Notify_Tests_DECLARE_NAME (periodic_consumer_command_factory, "PeriodicConsumer_Command_Factory")
+
+TAO_Notify_Tests_DECLARE_NAME (poa_command, "POA")
+TAO_Notify_Tests_DECLARE_NAME (poa_command_factory, "POA_Command_Factory")
+
+TAO_Notify_Tests_DECLARE_NAME (filter_command, "Filter")
+TAO_Notify_Tests_DECLARE_NAME (filter_command_factory, "Filter_Command_Factory")
diff --git a/TAO/orbsvcs/tests/Notify/lib/Name.h b/TAO/orbsvcs/tests/Notify/lib/Name.h
new file mode 100644
index 00000000000..602f3d1e6de
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Name.h
@@ -0,0 +1,63 @@
+/* -*- C++ -*- */
+/**
+ * @file Name.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_NAME_H
+#define TAO_Notify_Tests_NAME_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class TAO_Notify_Tests_Name
+ *
+ * @brief Define the names for command objects and other common strings.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Name
+{
+public:
+ static const char* const root_poa;
+ static const char* const event_channel_factory;
+ static const char* const naming_service;
+
+ static const char* const command_builder;
+
+ static const char* const application_command_factory;
+ static const char* const application_command;
+
+ static const char* const event_channel_command_factory;
+ static const char* const event_channel_command;
+
+ static const char* const supplier_admin_command_factory;
+ static const char* const supplier_admin_command;
+
+ static const char* const consumer_admin_command_factory;
+ static const char* const consumer_admin_command;
+
+ static const char* const periodic_supplier_command;
+ static const char* const periodic_supplier_command_factory;
+
+ static const char* const periodic_consumer_command;
+ static const char* const periodic_consumer_command_factory;
+
+ static const char* const poa_command;
+ static const char* const poa_command_factory;
+
+ static const char* const filter_command;
+ static const char* const filter_command_factory;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_NAME_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_PushConsumer.h b/TAO/orbsvcs/tests/Notify/lib/Notify_PushConsumer.h
new file mode 100644
index 00000000000..0a66baa40e3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_PushConsumer.h
@@ -0,0 +1,36 @@
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Notify_PushConsumer.h
+//
+// = DESCRIPTION
+// This is a utility class is to be used by clients of the Notification
+// Service to implement the servant for CosNotifyComm::PushConsumer
+//
+// = HOW-TO
+// 1. Derive from Notify_ProxyConsumer and implement <push>.
+// 2. Create the servant on the heap.(refcounted servant).
+// 3. Initialize the object, provide a POA.
+// 4. To connect, call <connect>, this will activate the object in the POA.
+// You must provide a ConsumerAdmin to <connect>.
+// 5. To disconnect, call <disconnect> this will also deactivate the object.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef TAO_NOTIFY_PUSHCONSUMER_H
+#define TAO_NOTIFY_PUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "PushConsumer.h"
+
+typedef TAO_Notify_Tests_PushConsumer TAO_Notify_PushConsumer;
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_PUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_PushSupplier.h b/TAO/orbsvcs/tests/Notify/lib/Notify_PushSupplier.h
new file mode 100644
index 00000000000..502431afa05
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_PushSupplier.h
@@ -0,0 +1,12 @@
+// $Id$
+
+#ifndef TAO_NOTIFY_PUSHSUPPLIER_H
+#define TAO_NOTIFY_PUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "PushSupplier.h"
+
+typedef TAO_Notify_Tests_PushSupplier TAO_Notify_PushSupplier;
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_PUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushConsumer.h b/TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushConsumer.h
new file mode 100644
index 00000000000..453abae9d5a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushConsumer.h
@@ -0,0 +1,30 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Notify_SequencePushConsumer.h
+//
+// = DESCRIPTION
+// This is a utility class is to be used by clients of the Notification
+// Service to implement the servant for CosNotifyComm::SequencePushConsumer
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_SEQUENCEPUSHCONSUMER_H
+#define NOTIFY_SEQUENCEPUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "SequencePushConsumer.h"
+
+typedef TAO_Notify_Tests_SequencePushConsumer TAO_Notify_SequencePushConsumer;
+
+#include /**/ "ace/post.h"
+
+#endif /* NOTIFY_SEQUENCEPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushSupplier.h b/TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushSupplier.h
new file mode 100644
index 00000000000..74fd09d4498
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_SequencePushSupplier.h
@@ -0,0 +1,29 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Notify_SequencePushSupplier
+//
+// = DESCRIPTION
+// This class is to be used by clients of the Notification Service
+// to implement Sequence Push Suppliers.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef TAO_NOTIFY_SEQUENCEPUSHSUPPLIER_H
+#define TAO_NOTIFY_SEQUENCEPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "SequencePushSupplier.h"
+
+typedef TAO_Notify_Tests_SequencePushSupplier TAO_Notify_SequencePushSupplier;
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_SequencePUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushConsumer.h b/TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushConsumer.h
new file mode 100644
index 00000000000..8364a0394b3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushConsumer.h
@@ -0,0 +1,29 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Notify_StructuredPushConsumer.h
+//
+// = DESCRIPTION
+// This is a utility class is to be used by clients of the Notification
+// Service to implement the servant for CosNotifyComm::PushConsumer
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_STRUCTUREDPUSHCONSUMER_H
+#define NOTIFY_STRUCTUREDPUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "StructuredPushConsumer.h"
+
+typedef TAO_Notify_Tests_StructuredPushConsumer TAO_Notify_StructuredPushConsumer;
+
+#include /**/ "ace/post.h"
+#endif /* NOTIFY_STRUCTUREDPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushSupplier.h b/TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushSupplier.h
new file mode 100644
index 00000000000..ecc804ae3aa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_StructuredPushSupplier.h
@@ -0,0 +1,29 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// orbsvcs
+//
+// = FILENAME
+// Notify_StructuredPushSupplier
+//
+// = DESCRIPTION
+// This class is to be used by clients of the Notification Service
+// to implement Structured Push Suppliers.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef TAO_NOTIFY_STRUCTUREDPUSHSUPPLIER_H
+#define TAO_NOTIFY_STRUCTUREDPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "StructuredPushSupplier.h"
+
+typedef TAO_Notify_Tests_StructuredPushSupplier TAO_Notify_StructuredPushSupplier;
+
+#include /**/ "ace/post.h"
+#endif /* TAO_NOTIFY_STRUCTUREDPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp
new file mode 100644
index 00000000000..cd6a689acfa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.cpp
@@ -0,0 +1,242 @@
+// $Id$
+
+#include "Notify_Test_Client.h"
+
+ACE_RCSID (lib,
+ Notify_Test_Client,
+ "$Id$")
+
+#define NOTIFY_FACTORY_NAME "NotifyEventChannelFactory"
+#define NAMING_SERVICE_NAME "NameService"
+
+Notify_Test_Client::Notify_Test_Client (void)
+: num_clients_( 0 )
+, done_( false )
+{
+ // @@ Later: accept the inter filter operator as a param.
+ ifgop_ = CosNotifyChannelAdmin::OR_OP;
+}
+
+Notify_Test_Client::~Notify_Test_Client ()
+{
+ ACE_TRY_NEW_ENV
+ {
+ root_poa_->destroy(1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ orb_->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "\nError: ");
+ }
+ ACE_ENDTRY;
+}
+
+int
+Notify_Test_Client::init (int argc, char *argv [] ACE_ENV_ARG_DECL)
+{
+ int status = this->init_ORB (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (status == 0)
+ {
+ this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ this->resolve_Notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+ return status;
+}
+
+int
+Notify_Test_Client::parse_args (int /*argc*/, char** /*argv*/)
+{
+ return 0;
+}
+
+
+int
+Notify_Test_Client::init_ORB (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (this->parse_args (argc, argv) != 0)
+ {
+ return -1;
+ }
+
+ CORBA::Object_ptr poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (poa_object))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"));
+ return -1;
+ }
+ this->root_poa_ =
+ PortableServer::POA::_narrow (poa_object ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+Notify_Test_Client::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ ACE_THROW (CORBA::UNKNOWN ());
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Notify_Test_Client::resolve_Notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (NOTIFY_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->notify_factory_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+}
+
+int
+Notify_Test_Client::ORB_run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ while (! is_done())
+ {
+ ACE_Time_Value tv(0, 10 * 1000);
+ orb_->run(tv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+ }
+
+ ACE_DEBUG((LM_DEBUG, "\nWaiting for stray events...\n"));
+
+ ACE_Time_Value tv(2);
+ orb_->run(tv ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN(-1);
+
+ return 0;
+}
+
+void Notify_Test_Client::consumer_start (TAO_Notify_Tests_Peer*)
+{
+ num_clients_++;
+}
+
+void
+Notify_Test_Client::consumer_done (TAO_Notify_Tests_Peer*)
+{
+ int value = --num_clients_;
+ if ( value == 0 )
+ {
+ this->done_ = true;
+ }
+}
+
+bool
+Notify_Test_Client::is_done (void) const
+{
+ return this->done_;
+}
+
+CORBA::ORB_ptr
+Notify_Test_Client::orb (void)
+{
+ return this->orb_.in ();
+}
+
+
+PortableServer::POA_ptr
+Notify_Test_Client::root_poa (void)
+{
+ return this->root_poa_.in ();
+}
+
+
+CosNaming::NamingContext_ptr
+Notify_Test_Client::naming_context (void)
+{
+ return this->naming_context_.in ();
+}
+
+
+CosNotifyChannelAdmin::EventChannelFactory_ptr
+Notify_Test_Client::notify_factory (void)
+{
+ return this->notify_factory_.in ();
+}
+
+
+CosNotifyChannelAdmin::EventChannel_ptr
+Notify_Test_Client::create_event_channel (const char* cname,
+ int resolve
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec;
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (cname);
+
+ if (resolve)
+ {
+ CORBA::Object_var obj = naming_context_->resolve (name);
+ ec = CosNotifyChannelAdmin::EventChannel::_narrow (obj.in ());
+ }
+ else
+ {
+ if (CORBA::is_nil (this->notify_factory_.in ()))
+ {
+ return CosNotifyChannelAdmin::EventChannel::_nil ();
+ }
+
+ CosNotifyChannelAdmin::ChannelID id;
+ CosNotification::QoSProperties initial_qos;
+ CosNotification::AdminProperties initial_admin;
+
+ ec = notify_factory_->create_channel (initial_qos,
+ initial_admin,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (CosNotifyChannelAdmin::EventChannel::_nil ());
+
+
+ naming_context_->rebind(name, ec.in());
+ }
+
+ return ec._retn ();
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h
new file mode 100644
index 00000000000..39bbed208fe
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_Test_Client.h
@@ -0,0 +1,116 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Notify_Test_Client.h
+//
+// = DESCRIPTION
+// Prototype Test Driver for all the Notify tests.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_TEST_CLIENT_H
+#define NOTIFY_TEST_CLIENT_H
+
+#include "ace/Atomic_Op_T.h"
+#include "ace/Thread_Mutex.h"
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "notify_test_export.h"
+
+class TAO_Notify_Tests_Peer;
+
+class TAO_NOTIFY_TEST_Export Notify_Test_Client
+{
+ // = TITLE
+ // Notify_Test_Client
+ // = DESCRIPTION
+ // Shows how consumers Notify_Test_Client for events.
+
+public:
+ // = Initialization and Termination
+ Notify_Test_Client (void);
+ virtual ~Notify_Test_Client ();
+
+ virtual int init (int argc, char *argv [] ACE_ENV_ARG_DECL);
+ // starts the orb and resolves the notify factory via a naming service.
+
+ virtual int parse_args (int argc, char* argv[]);
+ // Allow the user to override this empty method
+
+ int ORB_run (ACE_ENV_SINGLE_ARG_DECL);
+ // Call ORB::run to accept requests.
+
+ void consumer_start (TAO_Notify_Tests_Peer*);
+ // How many clients will call consumer_done.
+
+ void consumer_done (TAO_Notify_Tests_Peer*);
+ // Callback for clients to unregister themselves.
+
+ bool is_done (void) const;
+ // Access the done boolean.
+
+ CORBA::ORB_ptr orb (void);
+ // Access the ORB. This class retains ownership.
+
+ PortableServer::POA_ptr root_poa (void);
+ // Access the Root POA. This class retains ownership.
+
+ CosNaming::NamingContext_ptr naming_context (void);
+ // Access the Naming Context. This class retains ownership.
+
+ CosNotifyChannelAdmin::EventChannelFactory_ptr notify_factory (void);
+ // Access the Notify Factory. This class retains ownership.
+
+ CosNotifyChannelAdmin::EventChannel_ptr create_event_channel (
+ const char* name,
+ int resolve
+ ACE_ENV_ARG_DECL
+ );
+ // Create an Event Channel. Ownership is passed to the caller.
+
+protected:
+ int init_ORB (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // Initializes the ORB.
+
+ void resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Try to get hold of a running naming service.
+
+ void resolve_Notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+ // Try to resolve the Notify factory from the Naming service.
+
+ // = Data Members
+ PortableServer::POA_var root_poa_;
+ // Reference to the root poa.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+ // Channel factory.
+
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_;
+ // The group operator between admin-proxy's.
+
+ CosNotification::QoSProperties initial_qos_;
+ // Initial qos specified to the factory when creating the EC.
+
+ CosNotification::AdminProperties initial_admin_;
+ // Initial admin props specified to the factory when creating the EC.
+
+private:
+ ACE_Atomic_Op< TAO_SYNCH_MUTEX, int > num_clients_;
+ bool done_;
+};
+
+#endif /* NOTIFY_TEST_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Notify_lib.mpc b/TAO/orbsvcs/tests/Notify/lib/Notify_lib.mpc
new file mode 100644
index 00000000000..293ba3bed29
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Notify_lib.mpc
@@ -0,0 +1,8 @@
+// -*- MPC -*-
+// $Id$
+
+project(NotifyTests_Lib): orbsvcslib, notification_skel, notify_serv, naming, svc_utils {
+ sharedname = TAO_NotifyTests
+ dynamicflags = TAO_NOTIFY_TEST_BUILD_DLL
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp b/TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp
new file mode 100644
index 00000000000..fbcb5f8c03b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Options_Parser.cpp
@@ -0,0 +1,149 @@
+// $Id$
+
+#include "Options_Parser.h"
+
+ACE_RCSID (lib,
+ TAO_Options_Parser,
+ "$Id$")
+
+#include "orbsvcs/NotifyExtC.h"
+#include "tao/debug.h"
+#include "ace/Log_Msg.h"
+
+TAO_Notify_Tests_Options_Parser::TAO_Notify_Tests_Options_Parser (void)
+{
+}
+
+TAO_Notify_Tests_Options_Parser::~TAO_Notify_Tests_Options_Parser ()
+{
+}
+
+void
+TAO_Notify_Tests_Options_Parser::execute (CosNotification::EventTypeSeq& added, CosNotification::EventTypeSeq& removed, ACE_Arg_Shifter& arg_shifter)
+{
+ const ACE_TCHAR* current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ current_arg = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ if (current_arg[0] == '+')
+ {
+ // create 1 more space.
+ int seq_ln = added.length ();
+ added.length (seq_ln + 1);
+
+ added[seq_ln].domain_name = CORBA::string_dup ("*");
+ added[seq_ln].type_name = CORBA::string_dup (++current_arg); // Skip the '+' sign.
+ }
+ else if (current_arg[0] == '-')
+ {
+ // create 1 more space.
+ int seq_ln = removed.length ();
+ removed.length (seq_ln + 1);
+
+ removed[seq_ln].domain_name = CORBA::string_dup ("*");
+ removed[seq_ln].type_name = CORBA::string_dup (++current_arg); // Skip the '-' sign.
+ }
+ }
+}
+
+void
+TAO_Notify_Tests_Options_Parser::execute (CosNotification::QoSProperties& qos, ACE_Arg_Shifter& arg_shifter)
+{
+ const ACE_TCHAR *current_arg = 0;
+ int default_priority = ACE_DEFAULT_THREAD_PRIORITY;
+
+ if (arg_shifter.cur_arg_strncasecmp ("-ThreadPool") == 0) // -ThreadPool [-Threads static_threads] [-Priority default_priority]
+ {
+ arg_shifter.consume_arg ();
+
+ int static_threads = 1;
+
+ if (arg_shifter.cur_arg_strncasecmp ("-Threads") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ current_arg = arg_shifter.get_current ();
+
+ static_threads = ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+ }
+
+ if (arg_shifter.cur_arg_strncasecmp ("-Priority") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ current_arg = arg_shifter.get_current ();
+
+ default_priority = ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+ }
+
+ NotifyExt::ThreadPoolParams tp_params
+ = { NotifyExt::CLIENT_PROPAGATED, default_priority,
+ 0, static_threads, 0, default_priority, 0, 0, 0 };
+
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPool);
+ qos[0].value <<= tp_params;
+
+ } /* ThreadPool */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Lanes") == 0) // -Lanes lane_count -Lane prio static_thr dy_thr
+ {
+ arg_shifter.consume_arg ();
+
+ current_arg = arg_shifter.get_current ();
+ int lanecount = ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+
+ NotifyExt::ThreadPoolLanesParams tpl_params;
+
+ tpl_params.priority_model = NotifyExt::CLIENT_PROPAGATED;
+ tpl_params.server_priority = default_priority;
+ tpl_params.stacksize = 0;
+ tpl_params.lanes.length (lanecount);
+ tpl_params.allow_borrowing = 0;
+ tpl_params.allow_request_buffering = 0;
+ tpl_params.max_buffered_requests = 0;
+ tpl_params.max_request_buffer_size = 0;
+
+ int l_index = 0;
+ //parse lane values ...
+ while (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-Lane") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ // read priority
+ tpl_params.lanes[l_index].lane_priority = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ // static thread count
+ tpl_params.lanes[l_index].static_threads = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ // dynamic thread count
+ tpl_params.lanes[l_index].dynamic_threads = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "QoS Parser parsed lane: - %d, %d, %d\n",
+ tpl_params.lanes[l_index].lane_priority, tpl_params.lanes[l_index].static_threads, tpl_params.lanes[l_index].dynamic_threads));
+ l_index++;
+ }
+ else
+ break;
+ } /* while -- lane values */
+
+ qos.length (1);
+ qos[0].name = CORBA::string_dup (NotifyExt::ThreadPoolLanes);
+ qos[0].value <<= tpl_params;
+
+ } /* ThreadPoolLane */
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Options_Parser.h b/TAO/orbsvcs/tests/Notify/lib/Options_Parser.h
new file mode 100644
index 00000000000..009713d6d1e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Options_Parser.h
@@ -0,0 +1,48 @@
+/* -*- C++ -*- */
+/**
+ * @file Options_Parser.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_OPTIONS_PARSER_H
+#define TAO_Notify_Tests_OPTIONS_PARSER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+#include "ace/Arg_Shifter.h"
+
+/**
+ * @class TAO_Notify_Tests_Options_Parser
+ *
+ * @brief Common Options parsing code.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Options_Parser
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Options_Parser (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Options_Parser ();
+
+ /// Populates <qos> with options apecified in <arg_shifter>
+ void execute (CosNotification::QoSProperties& qos, ACE_Arg_Shifter& arg_shifter);
+
+ /// Populates <added> and <removed> with options apecified in <arg_shifter>
+ void execute (CosNotification::EventTypeSeq& added, CosNotification::EventTypeSeq& removed, ACE_Arg_Shifter& arg_shifter);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_OPTIONS_PARSER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Peer.cpp b/TAO/orbsvcs/tests/Notify/lib/Peer.cpp
new file mode 100644
index 00000000000..f2e6347a9ea
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Peer.cpp
@@ -0,0 +1,94 @@
+// $Id$
+
+#include "Peer.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "Peer.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (lib,
+ TAO_Peer,
+ "$Id$")
+
+#include "Name.h"
+#include "LookupManager.h"
+#include "Options_Parser.h"
+#include "orbsvcs/NotifyExtC.h"
+
+TAO_Notify_Tests_Peer::TAO_Notify_Tests_Peer (void)
+ : poa_name_ (TAO_Notify_Tests_Name::root_poa)
+ , ifgop_ (CosNotifyChannelAdmin::OR_OP)
+{
+}
+
+TAO_Notify_Tests_Peer::~TAO_Notify_Tests_Peer ()
+{
+}
+
+void
+TAO_Notify_Tests_Peer::init (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL_NOT_USED)
+{
+ this->default_POA_ = PortableServer::POA::_duplicate (poa);
+}
+
+int
+TAO_Notify_Tests_Peer::init_state (ACE_Arg_Shifter& arg_shifter)
+{
+ while (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-Admin") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->admin_name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Proxy") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->proxy_name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ }
+ // Is a POA name specified?
+ else if (arg_shifter.cur_arg_strncasecmp ("-POA") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->poa_name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Set_QoS") == 0) // -Set_QoS [Qos Options]
+ {
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser qos_parser;
+ qos_parser.execute (this->qos_, arg_shifter);
+ }
+ else
+ {
+ break;
+ }
+ } /* while */
+
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Peer::set_name (ACE_CString& name)
+{
+ this->name_ = name;
+}
+
+const ACE_CString&
+TAO_Notify_Tests_Peer::get_name (void)
+{
+ return this->name_;
+}
+
+void
+TAO_Notify_Tests_Peer::set_poa (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL_NOT_USED)
+{
+ this->default_POA_ = PortableServer::POA::_duplicate (poa);
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/lib/Peer.h b/TAO/orbsvcs/tests/Notify/lib/Peer.h
new file mode 100644
index 00000000000..cff35edb8fa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Peer.h
@@ -0,0 +1,80 @@
+/* -*- C++ -*- */
+/**
+ * @file Peer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PEER_H
+#define TAO_Notify_Tests_PEER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "ace/SString.h"
+#include "ace/Arg_Shifter.h"
+
+/**
+ * @class TAO_Notify_Tests_Peer
+ *
+ * @brief
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Peer
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Peer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_Peer ();
+
+ /// Init
+ void init (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL_NOT_USED);
+
+ /// Init this object.
+ virtual int init_state (ACE_Arg_Shifter& arg_shifter);
+
+ /// Set POA
+ void set_poa (PortableServer::POA_ptr poa ACE_ENV_ARG_DECL);
+
+ // Accessor to set/get our name.
+ void set_name (ACE_CString& name);
+ const ACE_CString& get_name (void);
+
+protected:
+
+ /// My name.
+ ACE_CString name_;
+
+ /// Proxy Name.
+ ACE_CString proxy_name_;
+
+ ACE_CString admin_name_;
+
+ ACE_CString poa_name_;
+
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_;
+
+ CosNotification::QoSProperties qos_;
+
+ /// The default POA.
+ PortableServer::POA_var default_POA_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "Peer.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PEER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Peer.inl b/TAO/orbsvcs/tests/Notify/lib/Peer.inl
new file mode 100644
index 00000000000..b29bbd147fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Peer.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "Peer.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp b/TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp
new file mode 100644
index 00000000000..556d11fb0f0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Peer_T.cpp
@@ -0,0 +1,251 @@
+// $Id$
+
+#ifndef TAO_Notify_Tests_Peer_T_CPP
+#define TAO_Notify_Tests_Peer_T_CPP
+
+#include "Peer_T.h"
+
+ACE_RCSID (Notify,
+ TAO_Notify_Tests_Peer_T,
+ "$Id$")
+
+#include "ace/Arg_Shifter.h"
+#include "Name.h"
+#include "LookupManager.h"
+#include "Options_Parser.h"
+#include "orbsvcs/NotifyExtC.h"
+
+template <class Peer_Traits>
+TAO_Notify_Tests_Peer_T<Peer_Traits>::TAO_Notify_Tests_Peer_T (void)
+ : proxy_id_ (0)
+{
+}
+
+template <class Peer_Traits>
+TAO_Notify_Tests_Peer_T<Peer_Traits>::~TAO_Notify_Tests_Peer_T ()
+{
+}
+
+template <class Peer_Traits>
+ACE_TYPENAME TAO_Notify_Tests_Peer_T<Peer_Traits>::Proxy_Traits_PTR
+TAO_Notify_Tests_Peer_T<Peer_Traits>::get_proxy (void)
+{
+ return proxy_.in ();
+}
+
+template <class Peer_Traits>
+ACE_TYPENAME TAO_Notify_Tests_Peer_T<Peer_Traits>::Peer_Traits_PTR
+TAO_Notify_Tests_Peer_T<Peer_Traits>::activate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ return this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+template <class Peer_Traits>
+void
+TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (Proxy_Traits_PTR proxy,
+ Proxy_Traits_ID proxy_id
+ ACE_ENV_ARG_DECL)
+{
+ // This will decr the ref count on exit.
+ // Clients of this class should use raw pointers, not vars.
+ PortableServer::ServantBase_var servant_var (this);
+
+ ACE_TYPENAME Peer_Traits::VAR peer_var =
+ this->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->connect_to_peer (proxy, peer_var.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // save the proxy
+ this->proxy_ = Proxy_Traits_INTERFACE::_duplicate (proxy);
+ this->proxy_id_ = proxy_id;
+
+ // Register the proxy.
+ if (this->proxy_name_.length () != 0)
+ {
+ LOOKUP_MANAGER->_register (this->proxy_.in (),
+ this->proxy_name_.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+template <class Peer_Traits>
+void
+TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (Admin_Traits_PTR admin_ptr
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TYPENAME Proxy_Traits::VAR proxy_var =
+ this->obtain_proxy (admin_ptr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_var.in ()));
+
+ this->connect (proxy_var.in (),
+ this->proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+template <class Peer_Traits>
+void
+TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get the POA
+ PortableServer::POA_var poa;
+ LOOKUP_MANAGER->resolve (poa,
+ this->poa_name_.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // set the POA
+ this->set_poa (poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the admin
+ ACE_TYPENAME Admin_Traits::VAR admin_var;
+
+ LOOKUP_MANAGER->resolve (admin_var,
+ this->admin_name_.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TYPENAME Admin_Ext_Traits::VAR admin_ext_var =
+ Admin_Ext_Traits_INTERFACE::_narrow (admin_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_TYPENAME Proxy_Traits::VAR proxy_var =
+ this->obtain_proxy (admin_ext_var.in (),
+ this->qos_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_var.in ()));
+
+ // connect supplier to proxy,
+ // also activates the servant as CORBA object in the POA specified.
+ this->connect (proxy_var.in (),
+ this->proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+template <class Peer_Traits>
+void
+TAO_Notify_Tests_Peer_T<Peer_Traits>::set_qos (
+ CosNotification::QoSProperties& qos
+ ACE_ENV_ARG_DECL
+ )
+{
+ this->get_proxy ()->set_qos (qos ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+template <class Peer_Traits>
+void
+TAO_Notify_Tests_Peer_T<Peer_Traits>::status (ACE_ENV_SINGLE_ARG_DECL)
+{
+#if (TAO_HAS_MINIMUM_CORBA == 0)
+ ACE_TRY
+ {
+ CORBA::Boolean not_exist =
+ this->get_proxy ()->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (not_exist == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Peer %s, Proxy does not exist\n",
+ this->name_.c_str ()));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Peer %s, Proxy exists\n",
+ this->name_.c_str ()));
+ }
+ }
+ ACE_CATCH(CORBA::TRANSIENT, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "Error: ");
+ ACE_DEBUG ((LM_DEBUG,
+ "Peer %s is_equivalent transient exception.",
+ this->name_.c_str ()));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error: ");
+ ACE_DEBUG ((LM_DEBUG,
+ "Peer %s is_equivanent other exception.",
+ this->name_.c_str ()));
+ }
+ ACE_ENDTRY;
+#else
+ ACE_ENV_ARG_NOT_USED;
+#endif /* TAO_HAS_MINIMUM_CORBA */
+}
+
+template <class Peer_Traits>
+void
+TAO_Notify_Tests_Peer_T<Peer_Traits>::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_.in ()));
+
+ ACE_TRY_EX(TRY1)
+ {
+ this->disconnect_from_proxy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(TRY1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Peer %s failed to disconnect from proxy.",
+ this->name_.c_str ()));
+ }
+ ACE_ENDTRY;
+
+ ACE_TRY_EX(TRY2)
+ {
+ this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(TRY2);
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Peer %s failed to deactivate.",
+ this->name_.c_str ()));
+ }
+ ACE_ENDTRY;
+}
+
+template <class Peer_Traits>
+PortableServer::POA_ptr
+TAO_Notify_Tests_Peer_T<Peer_Traits>::_default_POA (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+{
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
+}
+
+template <class Peer_Traits>
+void
+TAO_Notify_Tests_Peer_T<Peer_Traits>::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ PortableServer::POA_var poa = this->_default_POA ();
+
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa->deactivate_object (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+#endif /* TAO_Notify_Tests_Peer_T_CPP */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Peer_T.h b/TAO/orbsvcs/tests/Notify/lib/Peer_T.h
new file mode 100644
index 00000000000..0356c52d844
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Peer_T.h
@@ -0,0 +1,121 @@
+/* -*- C++ -*- */
+/**
+ * @file Peer_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PEER_T_H
+#define TAO_Notify_Tests_PEER_T_H
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Peer.h"
+#include "tao/PortableServer/Servant_Base.h"
+
+/**
+ * @class TAO_Notify_Tests_Peer_T
+ *
+ * @brief Base implementation for all Supplier and Consumer Classes.
+ *
+ */
+template <class Peer_Traits>
+class TAO_Notify_Tests_Peer_T : public TAO_Notify_Tests_Peer, public Peer_Traits::SKELETON
+{
+ typedef ACE_TYPENAME Peer_Traits::Admin_Traits Admin_Traits;
+ typedef ACE_TYPENAME Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef ACE_TYPENAME Peer_Traits::Proxy_Traits Proxy_Traits;
+
+ typedef ACE_TYPENAME Peer_Traits::PTR Peer_Traits_PTR;
+
+ typedef ACE_TYPENAME Proxy_Traits::INTERFACE Proxy_Traits_INTERFACE;
+ typedef ACE_TYPENAME Proxy_Traits::PTR Proxy_Traits_PTR;
+ typedef ACE_TYPENAME Proxy_Traits::ID Proxy_Traits_ID;
+
+ typedef ACE_TYPENAME Admin_Traits::PTR Admin_Traits_PTR;
+
+ typedef ACE_TYPENAME Admin_Ext_Traits::INTERFACE Admin_Ext_Traits_INTERFACE;
+ typedef ACE_TYPENAME Admin_Ext_Traits::PTR Admin_Ext_Traits_PTR;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Peer_T (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_Peer_T ();
+
+ // Activates this servant with the POA supplied in init.
+ // Connects to given proxy.
+ void connect (Proxy_Traits_PTR proxy, Proxy_Traits_ID proxy_id ACE_ENV_ARG_DECL);
+
+ // Activates this servant with the POA supplied in init.
+ // Creates a new proxy supplier and connects to it.
+ void connect (Admin_Traits_PTR admin_ptr ACE_ENV_ARG_DECL);
+
+ /// Connect using options parsed and set initial QoS.
+ virtual void connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ // Disconnect from the Peer.
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Set Qos
+ void set_qos (CosNotification::QoSProperties& qos ACE_ENV_ARG_DECL);
+
+ /// Dump status
+ void status (ACE_ENV_SINGLE_ARG_DECL);
+
+ // Accessor for <proxy_>.
+ Proxy_Traits_PTR get_proxy (void);
+
+ /// Deactivate the object.
+ void deactivate (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = ServantBase operations
+ virtual PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+protected:
+ /// Activate this object in the default POA.
+ virtual Peer_Traits_PTR activate (ACE_ENV_SINGLE_ARG_DECL);
+
+ ///= To be implemented by specializations.
+
+ /// Connect to Peer.
+ virtual void connect_to_peer (Proxy_Traits_PTR proxy_ptr, Peer_Traits_PTR peer_ptr ACE_ENV_ARG_DECL) = 0;
+
+ /// Obtain Proxy.
+ virtual Proxy_Traits_PTR obtain_proxy (Admin_Traits_PTR admin_ptr ACE_ENV_ARG_DECL) = 0;
+
+ /// Obtain Proxy with QoS.
+ virtual Proxy_Traits_PTR obtain_proxy (Admin_Ext_Traits_PTR admin_ptr
+ , CosNotification::QoSProperties& qos
+ ACE_ENV_ARG_DECL) = 0;
+
+ /// Disconnect from proxy.
+ virtual void disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL) = 0;
+
+ // = Data Members
+
+ /// The proxy that we are connected to.
+ ACE_TYPENAME Proxy_Traits::VAR proxy_;
+
+ /// This <proxy_> id.
+ ACE_TYPENAME Proxy_Traits::ID proxy_id_;
+};
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Peer_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Peer_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PEER_T_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
new file mode 100644
index 00000000000..a718deb73bf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
@@ -0,0 +1,273 @@
+// $Id$
+
+#include "Periodic_Consumer.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Task.h"
+#include "tao/debug.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "StructuredEvent.h"
+#include "Task_Stats.h"
+#include "Task_Callback.h"
+#include "LookupManager.h"
+#include "Priority_Mapping.h"
+
+ACE_RCSID (RT_Notify,
+ TAO_Notify_Tests_Periodic_Consumer,
+ "$Id$")
+
+int WARMUP_COUNT = 10;
+
+TAO_Notify_Tests_Periodic_Consumer::TAO_Notify_Tests_Periodic_Consumer (void)
+ : count_ (-2)
+ , warmup_countdown_ (WARMUP_COUNT)
+ , max_count_ (-1)
+ , load_ (0)
+ , client_ (0)
+ , check_priority_ (0)
+ , stop_received_ (0)
+{
+}
+
+TAO_Notify_Tests_Periodic_Consumer::~TAO_Notify_Tests_Periodic_Consumer ()
+{
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer::task_callback (TAO_Notify_Tests_Task_Callback* client)
+{
+ this->client_ = client;
+}
+
+int
+TAO_Notify_Tests_Periodic_Consumer::init_state (ACE_Arg_Shifter& arg_shifter)
+{
+ // First, let the base class look for options.
+ if (TAO_Notify_Tests_StructuredPushConsumer::init_state (arg_shifter) == -1)
+ return -1;
+
+ const ACE_TCHAR *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-MaxCount")))
+ {
+ this->max_count_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+
+ if (max_count_ == 0)
+ {
+ if (this->client_)
+ this->client_->done (this);
+ }
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Check_Priority") == 0)
+ {
+ this->check_priority_ = 1;
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ break;
+ }
+ } /* while */
+
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer::handle_start_event (const CosNotification::PropertySeq& prop_seq)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)Consumer %s received inital (-1)th event \n", this->name_.c_str ()));
+
+ for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
+ {
+ if (ACE_OS::strcmp (prop_seq[i].name.in (), "BaseTime") == 0)
+ {
+ TimeBase::TimeT base_time;
+ ACE_hrtime_t base_time_hrtime;
+
+ prop_seq[i].value >>= base_time;
+
+ ORBSVCS_Time::TimeT_to_hrtime (base_time_hrtime, base_time);
+ stats_.base_time (base_time_hrtime);
+ }
+ // if max_count has not been already specified, get it from the supplier.
+ else if (this->max_count_ == -1 &&
+ ACE_OS::strcmp (prop_seq[i].name.in (), "MaxCount") == 0)
+ {
+ prop_seq[i].value >>= this->max_count_;
+ }
+ else if (ACE_OS::strcmp (prop_seq[i].name.in (), "Load") == 0)
+ {
+ prop_seq[i].value >>= this->load_;
+ }
+ }
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Maxcount = %d, Load = %d\n",
+ this->max_count_, this->load_));
+ }
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer::check_priority (const CosNotification::PropertySeq& prop_seq)
+{
+ // Check if the event carries a Priority.
+ int event_has_priority_set = 0;
+ CORBA::Short event_priority = 0;
+
+ for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
+ {
+ if (ACE_OS::strcmp (prop_seq[i].name.in (), CosNotification::Priority) == 0)
+ {
+ prop_seq[i].value >>= event_priority;
+
+ event_has_priority_set = 1;
+ break;
+ }
+ }
+
+ if (event_has_priority_set == 1)
+ {
+ // Confirm that the current thread is at the priority set in the event
+ ACE_hthread_t current;
+ ACE_Thread::self (current);
+
+ int priority;
+ if (ACE_Thread::getprio (current, priority) == -1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - ")
+ ACE_TEXT (" ACE_Thread::get_prio\n")));
+
+ return ;
+ }
+
+ CORBA::Short native_priority = CORBA::Short (priority);
+
+ TAO_Notify_Tests_Priority_Mapping* priority_mapping;
+ LOOKUP_MANAGER->resolve (priority_mapping);
+
+ CORBA::Short corba_priority;
+
+ priority_mapping->to_CORBA (native_priority, corba_priority);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Periodic Consumer expected priority = %d, received priority = %d/%d (native/corba)\n",
+ event_priority, native_priority, corba_priority));
+
+ if (corba_priority != event_priority)
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: Periodic Consumer expected priority = %d, received priority = %d\n",
+ event_priority, corba_priority));
+ }
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer::push_structured_event (const CosNotification::StructuredEvent & notification ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_,
+ CORBA::INTERNAL ());
+ ACE_CHECK;
+
+ const CosNotification::PropertySeq& prop_seq =
+ notification.header.variable_header;
+
+ if (this->count_ == -2)
+ {
+ if (--warmup_countdown_ == 0)
+ this->count_ = -1;
+
+ return;
+ }
+ else if (this->count_ == -1)
+ {
+ this->handle_start_event (prop_seq);
+
+ if (this->max_count_ > 0)
+ this->stats_.init (this->max_count_);
+
+ this->count_ = 0;
+ return;
+ }
+
+ if (this->check_priority_)
+ {
+ this->check_priority (prop_seq);
+ }
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)Consumer %s received %d event type (%s,%s) \n", this->name_.c_str (), this->count_,
+ notification.header.fixed_header.event_type.domain_name.in(),
+ notification.header.fixed_header.event_type.type_name.in()));
+ }
+
+ for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
+ {
+ if (ACE_OS::strcmp (prop_seq[i].name.in (), "Stop") == 0)
+ {
+ this->stop_received_ = 1;
+ }
+ }
+
+ TimeBase::TimeT send_time, now;
+ ACE_hrtime_t send_time_hrtime;
+
+ notification.remainder_of_body >>= send_time;
+
+ ORBSVCS_Time::TimeT_to_hrtime (send_time_hrtime, send_time);
+
+ now = ACE_OS::gethrtime ();
+
+ stats_.sample (send_time_hrtime, now);
+
+ // Eat CPU
+ static CORBA::ULong prime_number = 9619;
+
+ (void)ACE::gcd (prime_number, prime_number/2 -1);
+
+ for (CORBA::ULong load = this->load_; load != 0; --load)
+ ACE::is_prime (prime_number,
+ 2,
+ prime_number / 2);
+
+ // ---
+
+ if (++this->count_ >= this->max_count_ || this->stop_received_ == 1)
+ {
+ stats_.end_time (ACE_OS::gethrtime ());
+
+ if (this->client_)
+ this->client_->done (this);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t)Consumer %s done \n", this->name_.c_str ()));
+ }
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer::dump_stats (ACE_TCHAR* msg, int dump_samples)
+{
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "%s.dat", this->name_.c_str ());
+
+ ACE_CString fname (buf);
+
+ ACE_OS::sprintf (buf,
+ "%s# Consumer Name = %s, Proxy ID = %d Load = %u\n",
+ msg,
+ this->name_.c_str (), this->proxy_id_, this->load_);
+
+ stats_.dump_samples (fname.c_str (), buf, dump_samples);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
new file mode 100644
index 00000000000..943d189c411
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
@@ -0,0 +1,102 @@
+/* -*- C++ -*- */
+/**
+ * @file Periodic_Consumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PERIODIC_CONSUMER_H
+#define TAO_Notify_Tests_PERIODIC_CONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Task_Stats.h"
+#include "Notify_StructuredPushConsumer.h"
+#include "ace/Arg_Shifter.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+class ACE_Barrier;
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+class TAO_Notify_Tests_Task_Callback;
+
+/**
+ * @class TAO_Notify_Tests_Periodic_Consumer
+ *
+ * @brief Receives Structured events periodically.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Periodic_Consumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Periodic_Consumer (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Periodic_Consumer ();
+
+ /// set the helper callback
+ void task_callback(TAO_Notify_Tests_Task_Callback* client);
+
+ /// Init the state of this object.
+ virtual int init_state (ACE_Arg_Shifter& arg_shifter);
+
+ /// dump stats
+ void dump_stats (ACE_TCHAR* msg, int dump_samples);
+
+protected:
+
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+ void handle_start_event (const CosNotification::PropertySeq& prop_seq);
+ void check_priority (const CosNotification::PropertySeq& prop_seq);
+
+ /// = Data members.
+ /// Serialize state.
+ TAO_SYNCH_MUTEX lock_;
+
+ /// count of events received.
+ int count_;
+
+ /// We need to count down these initial events.
+ int warmup_countdown_;
+
+ /// max events expected.
+ /// Sometimes max count may not be the number of events that the supplier will send.
+ /// A filter might not allow some events to through. we can tell the consumer what to expect.
+ int max_count_;
+
+ /// The Load
+ CORBA::ULong load_;
+
+ /// Stats house keeping
+ Task_Stats stats_;
+
+ /// Client
+ TAO_Notify_Tests_Task_Callback* client_;
+
+ /// Flag to indicate if we want to check the expected priority.
+ int check_priority_;
+
+ /// This Flag is set if we received an event asking us to "Stop".
+ int stop_received_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PERIODIC_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.cpp
new file mode 100644
index 00000000000..cfda2e788f8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.cpp
@@ -0,0 +1,273 @@
+// $Id$
+
+#include "Periodic_Consumer_Command.h"
+
+ACE_RCSID (lib,
+ TAO_Periodic_Consumer_Command,
+ "$Id$")
+
+#include "LookupManager.h"
+#include "Name.h"
+#include "Periodic_Consumer.h"
+#include "Relay_Consumer.h"
+#include "Direct_Consumer.h"
+#include "Activation_Manager.h"
+#include "Options_Parser.h"
+#include "orbsvcs/NotifyExtC.h"
+
+TAO_Notify_Tests_Periodic_Consumer_Command::TAO_Notify_Tests_Periodic_Consumer_Command (void)
+{
+}
+
+TAO_Notify_Tests_Periodic_Consumer_Command::~TAO_Notify_Tests_Periodic_Consumer_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_Periodic_Consumer_Command::get_name (void)
+{
+ return TAO_Notify_Tests_Periodic_Consumer_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_Periodic_Consumer_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::periodic_consumer_command;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ if (arg_shifter.is_anything_left ())
+ {
+ /// -Create consumer_name admin_name -POA [POA_name] consumer_specific_options
+ if (arg_shifter.cur_arg_strncasecmp ("-Create") == 0)
+ {
+ this->command_ = CREATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ int is_relay = 0;
+ int is_direct = 0;
+ ACE_CString relay_destination;
+
+ if (arg_shifter.cur_arg_strncasecmp ("-Relay") == 0)
+ {
+ is_relay = 1;
+
+ arg_shifter.consume_arg ();
+
+ relay_destination = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Direct") == 0)
+ {
+ is_direct = 1;
+
+ arg_shifter.consume_arg ();
+ }
+
+ TAO_Notify_Tests_Periodic_Consumer* consumer = 0;
+
+ // create the consumer
+ if (is_relay == 1)
+ consumer = new TAO_Notify_Tests_Relay_Consumer (relay_destination);
+ else if (is_direct == 1)
+ consumer = new TAO_Notify_Tests_Direct_Consumer ();
+ else
+ consumer = new TAO_Notify_Tests_Periodic_Consumer ();
+
+ consumer->set_name (this->name_);
+
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ act_mgr->_register (consumer, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ consumer->init_state (arg_shifter);
+
+ } /* -Create */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Subscription") == 0) // -Subscription admin_name +added_type1 +-added_type2 ... -added_type3 -added_type4..
+ {
+ this->command_ = SUBSCRIPTION;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser options_parser;
+ options_parser.execute (this->added_, this->removed_, arg_shifter);
+ } /* Subscription */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Disconnect") == 0) //
+ {
+ this->command_ = DISCONNECT;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ } /* disconnect */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Deactivate") == 0) //
+ {
+ this->command_ = DEACTIVATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ } /* deactivate */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Status") == 0) //
+ {
+ this->command_ = DUMP_STATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ } /* -Dump */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Set_QoS") == 0) // -Set_QoS ec_name [Qos Options]
+ {
+ this->command_ = SET_QOS;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser qos_parser;
+ qos_parser.execute (this->qos_, arg_shifter);
+ }
+ }
+}
+
+TAO_Notify_Tests_Periodic_Consumer*
+TAO_Notify_Tests_Periodic_Consumer_Command::consumer (void)
+{
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ // Locate the consumer
+ TAO_Notify_Tests_Periodic_Consumer* consumer = 0;
+
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ act_mgr->resolve (consumer, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ if (consumer == 0)
+ ACE_DEBUG ((LM_DEBUG, "Consumer %s not found by Lookup Manager\n", this->name_.c_str ()));
+
+ return consumer;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::handle_set_qos (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->consumer ()->set_qos (this->qos_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::handle_create (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Consumer* consumer = this->consumer ();
+
+ if (consumer == 0)
+ return;
+
+ consumer->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Consumer %s is connected\n", this->name_.c_str ()));
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::handle_subscriptions (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Consumer* consumer= this->consumer ();
+ if (consumer == 0)
+ return;
+
+ consumer->subscription_change (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::handle_disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Consumer* consumer= this->consumer ();
+ if (consumer == 0)
+ return;
+
+ consumer->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::handle_deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Consumer* consumer = this->consumer ();
+ if (consumer == 0)
+ return;
+
+ consumer->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::handle_status (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Consumer* consumer = this->consumer ();
+
+ if (consumer == 0)
+ return;
+
+ consumer->status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Consumer_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == CREATE)
+ {
+ this->handle_create (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SUBSCRIPTION)
+ {
+ this->handle_subscriptions (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DISCONNECT)
+ {
+ this->handle_disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DEACTIVATE)
+ {
+ this->handle_deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DUMP_STATE)
+ {
+ this->handle_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SET_QOS)
+ {
+ this->handle_set_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.h
new file mode 100644
index 00000000000..d258c7e2e8a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer_Command.h
@@ -0,0 +1,95 @@
+/* -*- C++ -*- */
+/**
+ * @file Periodic_Consumer_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PERIODICCONSUMER_COMMAND_H
+#define TAO_Notify_Tests_PERIODICCONSUMER_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "Command.h"
+
+class TAO_Notify_Tests_Periodic_Consumer;
+
+/**
+ * @class TAO_Notify_Tests_Periodic_Consumer_Command
+ *
+ * @brief Options for Periodic Consumers.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Periodic_Consumer_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Periodic_Consumer_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Periodic_Consumer_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Name of object
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+ ///= Data Members
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ CREATE,
+ DESTROY,
+ SET_QOS,
+ SET_ADMIN,
+ SUBSCRIPTION,
+ DISCONNECT,
+ DEACTIVATE,
+ DUMP_STATE
+ };
+
+ /// My name.
+ ACE_CString name_;
+
+ /// QoS
+ CosNotification::QoSProperties qos_;
+
+ // Subscription change
+ CosNotification::EventTypeSeq added_;
+ CosNotification::EventTypeSeq removed_;
+
+ ///= Methods
+ // Retreive the consumer.
+ TAO_Notify_Tests_Periodic_Consumer* consumer (void);
+
+ ///= Handlers
+ void handle_create (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_subscriptions (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_deactivate (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_status (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_set_qos (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PERIODICCONSUMER_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp
new file mode 100644
index 00000000000..b2aea30f498
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp
@@ -0,0 +1,358 @@
+// $Id$
+
+#include "Periodic_Supplier.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Barrier.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "StructuredEvent.h"
+#include "Task_Stats.h"
+#include "Task_Callback.h"
+#include "LookupManager.h"
+#include "Priority_Mapping.h"
+
+ACE_RCSID (RT_Notify,
+ TAO_Notify_Tests_Periodic_Supplier,
+ "$Id$")
+
+TAO_Notify_Tests_Periodic_Supplier::TAO_Notify_Tests_Periodic_Supplier (void)
+ : barrier_ (0),
+ priority_ (0),
+ period_ (0),
+ total_deadlines_missed_ (0),
+ run_time_ (0),
+ exec_time_ (0),
+ phase_ (0),
+ iter_ (0),
+ load_ (0),
+ client_ (0)
+{
+}
+
+TAO_Notify_Tests_Periodic_Supplier::~TAO_Notify_Tests_Periodic_Supplier ()
+{
+}
+
+
+void
+TAO_Notify_Tests_Periodic_Supplier::task_callback(TAO_Notify_Tests_Task_Callback* client)
+{
+ this->client_ = client;
+}
+
+int
+TAO_Notify_Tests_Periodic_Supplier::init_state (ACE_Arg_Shifter& arg_shifter)
+{
+ // First, let the base class look for options.
+ if (TAO_Notify_Tests_StructuredPushSupplier::init_state (arg_shifter) == -1)
+ return -1;
+
+ const ACE_TCHAR *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-EventType")))
+ {
+ this->event_.type ("*", current_arg) ;
+ zeroth_event.type ("*", current_arg) ;
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-FilterLongData") == 0) // -FilterLongData name value
+ {
+ arg_shifter.consume_arg ();
+
+ ACE_CString name = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ CORBA::Long value = (CORBA::Long)ACE_OS::atoi (arg_shifter.get_current ());
+
+ arg_shifter.consume_arg ();
+
+ CORBA::Any buffer;
+ buffer <<= (CORBA::Long) value;
+
+ this->event_.filter (name.c_str (), buffer);
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-Priority")))
+ {
+ priority_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+
+ CORBA::Any buffer;
+ buffer <<= (CORBA::Short) this->priority_;
+ this->event_.qos (CosNotification::Priority, buffer);
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-Period")))
+ {
+ period_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-ExecTime")))
+ {
+ exec_time_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-Phase")))
+ {
+ phase_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-Iter")))
+ {
+ iter_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+
+ if (stats_.init (iter_) == -1)
+ return -1;
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-Load")))
+ {
+ load_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-RunTime"))) // in seconds
+ {
+ run_time_ = ACE_OS::atoi (current_arg);
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "parse Task unknown option %s\n",
+ arg_shifter.get_current ()));
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "event type %s, priority %d, period %duS, exec_time %duS, phase %duS, iter %d, load %d\n",
+ event_.type(), priority_, period_, exec_time_, phase_, iter_, load_));
+ break;
+ }
+ }
+ return 0;
+}
+
+int
+TAO_Notify_Tests_Periodic_Supplier::activate_task (ACE_Barrier* barrier)
+{
+ barrier_ = barrier;
+
+ long flags = THR_NEW_LWP | THR_JOINABLE;
+
+ // Resolve the ORB
+ CORBA::ORB_var orb;
+ LOOKUP_MANAGER->resolve (orb);
+
+ flags |=
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+
+ TAO_Notify_Tests_Priority_Mapping* priority_mapping;
+ LOOKUP_MANAGER->resolve (priority_mapping);
+
+ CORBA::Short native_prio;
+
+ priority_mapping->to_native (this->priority_, native_prio);
+
+ // Become an active object.
+ if (this->ACE_Task <ACE_SYNCH>::activate (flags,
+ 1,
+ 0,
+ native_prio) == -1)
+ {
+ if (ACE_OS::last_error () == EPERM)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Insufficient privilege to activate ACE_Task.\n")),
+ -1);
+ else
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT ("(%t) Task activation at priority %d failed, ")
+ ACE_TEXT ("exiting!\n%a"),
+ this->priority_,
+ -1));
+ }
+
+ ACE_DEBUG ((LM_ERROR, "Activated Periodic Supplier Thread at priority %d\n", this->priority_));
+
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier::send_warmup_events (ACE_ENV_SINGLE_ARG_DECL)
+{
+ int WARMUP_COUNT = 10;
+
+ for (int i = 0; i < WARMUP_COUNT ; ++i)
+ {
+ this->send_event (this->event_.event () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier::send_prologue (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // populate event.
+ // send the base time and max count.
+ TimeBase::TimeT base_time;
+ ORBSVCS_Time::hrtime_to_TimeT (base_time,
+ BASE_TIME::instance ()->base_time_);
+
+ CORBA::Any buffer;
+ buffer <<= base_time;
+ zeroth_event.opt_header ("BaseTime", buffer);
+
+ buffer <<= this->iter_;
+ zeroth_event.opt_header ("MaxCount", buffer);
+
+ buffer <<= this->load_;
+ zeroth_event.opt_header ("Load", buffer);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Supplier (%s) sending event 0th event\n"));
+
+ this->send_event (zeroth_event.event () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier::handle_svc (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->send_prologue (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t before, after;
+ TimeBase::TimeT time_t;
+
+ CORBA::Any buffer;
+
+ ACE_hrtime_t base_time = BASE_TIME::instance ()->base_time_;
+
+ for (int i = 0; i < iter_ ; ++i)
+ {
+ before = ACE_OS::gethrtime ();
+
+ ORBSVCS_Time::hrtime_to_TimeT (time_t,
+ before);
+
+ buffer <<= time_t;
+
+ this->event_.payload (buffer);
+
+ if (this->run_time_ != 0 &&
+ Task_Stats::diff_sec (base_time, before) > this->run_time_)
+ {
+ // Time up, send a "Stop" event.
+ buffer <<= (CORBA::Long) 1;
+ this->event_.opt_header ("Stop", buffer);
+
+ i = iter_; // Load the iter so that the loop exits.
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Supplier (%s) sending event #%d\n",
+ this->name_.c_str (), i));
+
+ this->send_event (this->event_.event () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ after = ACE_OS::gethrtime ();
+
+ stats_.sample (before, after);
+
+ if (period_ != 0) // blast mode, no sleep.
+ {
+ ACE_UINT32 elapsed_microseconds =
+ Task_Stats::diff_usec (before, after);
+
+ // did we miss any deadlines?
+ int missed =
+ (int)elapsed_microseconds > period_ ? elapsed_microseconds/period_ : 0;
+ this->total_deadlines_missed_ += missed;
+
+ /* Start -- "Immediate run if last call missed deadline" */
+ if (missed > 0) // if we missed
+ continue;
+
+ long sleep_time = period_ - elapsed_microseconds;
+ /* End -- "Immediate run if last call missed deadline" */
+
+ /*
+ * This logic sleeps till the next period.
+ * So, if we missed a deadline we wait.
+ *
+ long sleep_time = (missed + 1)*period_ ;
+ sleep_time -= elapsed_microseconds;
+ */
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%t) sleep time = %d uSec, missed %d deadlines\n", sleep_time, missed));
+
+ ACE_Time_Value t_sleep (0, sleep_time);
+ ACE_OS::sleep (t_sleep);
+ } /* period != 0 */
+
+ } /* for */
+
+ stats_.end_time (ACE_OS::gethrtime ());
+
+ if (this->client_)
+ this->client_->done (this);
+}
+
+int
+TAO_Notify_Tests_Periodic_Supplier::svc (void)
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Thread_Task (%t) - wait\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ // First, send warmup events.
+ this->send_warmup_events (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Next, wait for other threads.
+ this->barrier_->wait ();
+
+ // first thread here inits the Base_Time.
+ stats_.base_time (BASE_TIME::instance ()->base_time_);
+
+ // now wait till the phase_ period expires.
+ ACE_OS::sleep (ACE_Time_Value (0, phase_));
+
+ this->handle_svc (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ue)
+ {
+ ACE_PRINT_EXCEPTION (ue,
+ "Error: Periodic supplier: error sending event. ");
+ }
+ ACE_CATCH (CORBA::SystemException, se)
+ {
+ ACE_PRINT_EXCEPTION (se,
+ "Error: Periodic supplier: error sending event. ");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier::dump_stats (ACE_TCHAR* msg, int dump_samples)
+{
+ char buf[BUFSIZ];
+ ACE_OS::sprintf (buf, "%s.dat", this->name_.c_str ());
+
+ ACE_CString fname (buf);
+
+ ACE_OS::sprintf (buf,"%s# : Supplier Name = %s, Proxy ID = %d, Event Type = %s, priority %d, period %ld, exec_time %ld, phase %ld, iter_ %d , load_ %d, deadlines missed = %d\n",
+ msg, this->name_.c_str (), this->proxy_id_, this->event_.type (), priority_, period_, exec_time_, phase_, iter_, load_, this->total_deadlines_missed_);
+
+ stats_.dump_samples (fname.c_str (), buf, dump_samples);
+}
+
+#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)
+template ACE_Singleton<Base_Time, ACE_Thread_Mutex> *ACE_Singleton<Base_Time, ACE_Thread_Mutex>::singleton_;
+#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h
new file mode 100644
index 00000000000..5bcdf57d34c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h
@@ -0,0 +1,115 @@
+/* -*- C++ -*- */
+/**
+ * @file Periodic_Supplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PERIODIC_SUPPLIER_H
+#define TAO_Notify_Tests_PERIODIC_SUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Notify_StructuredPushSupplier.h"
+#include "Task_Stats.h"
+#include "StructuredEvent.h"
+#include "ace/Task.h"
+#include "ace/Barrier.h"
+#include "ace/Arg_Shifter.h"
+
+class TAO_Notify_Tests_Task_Callback;
+
+/**
+ * @class TAO_Notify_Tests_Periodic_Supplier
+ *
+ * @brief A Periodic Supplier.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Periodic_Supplier : public TAO_Notify_Tests_StructuredPushSupplier, public ACE_Task <ACE_SYNCH>
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Periodic_Supplier (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Periodic_Supplier ();
+
+ /// set the helper callback
+ void task_callback(TAO_Notify_Tests_Task_Callback* client);
+
+ /// Init the state of this object.
+ int init_state (ACE_Arg_Shifter& arg_shifter);
+
+ /// Activate this task, synch on the given barrier.
+ virtual int activate_task (ACE_Barrier* barrier);
+
+ /// task svc
+ virtual int svc (void);
+
+ /// Dump stats.
+ void dump_stats (ACE_TCHAR* msg, int dump_samples);
+
+ /// Get the name of the proxy
+ const char* proxy_name (void);
+
+protected:
+
+ /// svc method.
+ void handle_svc (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Send a few events before the actual measurements.
+ void send_warmup_events (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Send Prologue
+ void send_prologue (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// All tasks synch at this barrier.
+ ACE_Barrier* barrier_;
+
+ /// The event to send.
+ TAO_Notify_Tests_StructuredEvent event_;
+
+ TAO_Notify_Tests_StructuredEvent zeroth_event;
+
+ /// The priority of this task.
+ CORBA::Short priority_;
+
+ /// Period
+ long period_;
+
+ /// Counts the total number of deadlines missed.
+ int total_deadlines_missed_;
+
+ /// RunTime - The Max. time to run the supplier.
+ long run_time_;
+
+ /// Worst case exec. time.
+ unsigned long exec_time_;
+
+ /// Phase
+ long phase_;
+
+ /// Number of times to exec. Job
+ int iter_;
+
+ /// A load factor supplied to each Job.
+ CORBA::ULong load_;
+
+ /// Stats house keeping
+ Task_Stats stats_;
+
+ /// Client
+ TAO_Notify_Tests_Task_Callback* client_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PERIODIC_SUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.cpp
new file mode 100644
index 00000000000..9cdfaccbb51
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.cpp
@@ -0,0 +1,261 @@
+// $Id$
+
+#include "Periodic_Supplier_Command.h"
+
+ACE_RCSID (lib,
+ TAO_Periodic_Supplier_Command,
+ "$Id$")
+
+#include "LookupManager.h"
+#include "Name.h"
+#include "Periodic_Supplier.h"
+#include "Direct_Supplier.h"
+#include "Activation_Manager.h"
+#include "Options_Parser.h"
+#include "orbsvcs/NotifyExtC.h"
+
+TAO_Notify_Tests_Periodic_Supplier_Command::TAO_Notify_Tests_Periodic_Supplier_Command (void)
+{
+}
+
+TAO_Notify_Tests_Periodic_Supplier_Command::~TAO_Notify_Tests_Periodic_Supplier_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_Periodic_Supplier_Command::get_name (void)
+{
+ return TAO_Notify_Tests_Periodic_Supplier_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_Periodic_Supplier_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::periodic_supplier_command;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ if (arg_shifter.is_anything_left ())
+ {
+ /// -Create supplier_name admin_name -POA [POA_name] supplier_specific_options
+ if (arg_shifter.cur_arg_strncasecmp ("-Create") == 0)
+ {
+ this->command_ = CREATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ int is_direct = 0;
+ ACE_CString direct_target;
+
+ if (arg_shifter.cur_arg_strncasecmp ("-Direct") == 0)
+ {
+ is_direct = 1;
+
+ arg_shifter.consume_arg ();
+
+ direct_target = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ }
+
+ TAO_Notify_Tests_Periodic_Supplier* supplier = 0;
+
+ // create the supplier
+ if (is_direct == 1)
+ supplier = new TAO_Notify_Tests_Direct_Supplier (direct_target);
+ else
+ supplier = new TAO_Notify_Tests_Periodic_Supplier ();
+
+ supplier->set_name (this->name_);
+
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ act_mgr->_register (supplier, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ supplier->init_state (arg_shifter);
+ } /* -Create */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Offer") == 0) // -Offer supplier_name +added_type1 +-added_type2 ... -added_type3 -added_type4..
+ {
+ this->command_ = OFFER;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser options_parser;
+ options_parser.execute (this->added_, this->removed_, arg_shifter);
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Disconnect") == 0) //
+ {
+ this->command_ = DISCONNECT;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ } /* disconnect */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Deactivate") == 0) //
+ {
+ this->command_ = DEACTIVATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ } /* deactivate */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Status") == 0) //
+ {
+ this->command_ = DUMP_STATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+ } /* -Dump */
+ else if (arg_shifter.cur_arg_strncasecmp ("-Set_QoS") == 0) // -Set_QoS ec_name [Qos Options]
+ {
+ this->command_ = SET_QOS;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser qos_parser;
+ qos_parser.execute (this->qos_, arg_shifter);
+ }
+ } /* if */
+}
+
+TAO_Notify_Tests_Periodic_Supplier*
+TAO_Notify_Tests_Periodic_Supplier_Command::supplier (void)
+{
+ TAO_Notify_Tests_Activation_Manager* act_mgr = 0;
+ LOOKUP_MANAGER->resolve (act_mgr);
+
+ // Locate the supplier
+ TAO_Notify_Tests_Periodic_Supplier* supplier = 0;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ act_mgr->resolve (supplier, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (supplier == 0)
+ ACE_DEBUG ((LM_DEBUG, "Supplier %s not found by Lookup Manager\n", this->name_.c_str ()));
+
+ return supplier;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::handle_create (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Supplier* supplier = this->supplier ();
+ if (supplier == 0)
+ return;
+
+ supplier->connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Supplier %s is connected\n", this->name_.c_str ()));
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::handle_offers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Supplier* supplier = this->supplier ();
+ if (supplier == 0)
+ return;
+
+ supplier->offer_change (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::handle_disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Supplier* supplier= this->supplier ();
+ if (supplier == 0)
+ return;
+
+ supplier->disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::handle_deactivate (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Supplier* supplier = this->supplier ();
+ if (supplier == 0)
+ return;
+
+ supplier->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::handle_status (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Supplier* supplier = this->supplier ();
+
+ if (supplier == 0)
+ return;
+
+ supplier->status (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::handle_set_qos (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Periodic_Supplier* supplier = this->supplier ();
+
+ if (supplier == 0)
+ return;
+
+ supplier->set_qos (this->qos_ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_Periodic_Supplier_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == CREATE)
+ {
+ this->handle_create (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == OFFER)
+ {
+ this->handle_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DISCONNECT)
+ {
+ this->handle_disconnect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DEACTIVATE)
+ {
+ this->handle_deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DUMP_STATE)
+ {
+ this->handle_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SET_QOS)
+ {
+ this->handle_set_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.h
new file mode 100644
index 00000000000..726d7cd0ddd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier_Command.h
@@ -0,0 +1,95 @@
+/* -*- C++ -*- */
+/**
+ * @file Periodic_Supplier_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PERIODICSUPPLIER_COMMAND_H
+#define TAO_Notify_Tests_PERIODICSUPPLIER_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "Command.h"
+
+class TAO_Notify_Tests_Periodic_Supplier;
+
+/**
+ * @class TAO_Notify_Tests_Periodic_Supplier_Command
+ *
+ * @brief Command for Periodic Suppliers.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Periodic_Supplier_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Periodic_Supplier_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Periodic_Supplier_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Name of object
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ CREATE,
+ DESTROY,
+ SET_QOS,
+ SET_ADMIN,
+ OFFER,
+ DISCONNECT,
+ DEACTIVATE,
+ DUMP_STATE
+ };
+
+ /// My name.
+ ACE_CString name_;
+
+ /// QoS
+ CosNotification::QoSProperties qos_;
+
+ // Offer change
+ CosNotification::EventTypeSeq added_;
+ CosNotification::EventTypeSeq removed_;
+
+ ///= Methods
+ // Retreive the suppliers.
+ TAO_Notify_Tests_Periodic_Supplier* supplier (void);
+
+ ///= Handlers
+ void handle_create (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_offers (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_deactivate (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_status (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_set_qos (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PERIODICSUPPLIER_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.cpp b/TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.cpp
new file mode 100644
index 00000000000..870eef04d59
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.cpp
@@ -0,0 +1,25 @@
+// $Id$
+
+#include "Priority_Mapping.h"
+
+ACE_RCSID(lib, Priority_Mapping, "$Id$")
+
+TAO_Notify_Tests_Priority_Mapping::~TAO_Notify_Tests_Priority_Mapping (void)
+{
+}
+
+CORBA::Boolean
+TAO_Notify_Tests_Priority_Mapping::to_native (CORBA::Short corba_priority,
+ CORBA::Short &native_priority)
+{
+ native_priority = corba_priority;
+ return 1;
+}
+
+CORBA::Boolean
+TAO_Notify_Tests_Priority_Mapping::to_CORBA (CORBA::Short native_priority,
+ CORBA::Short &corba_priority)
+{
+ corba_priority = native_priority;
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.h b/TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.h
new file mode 100644
index 00000000000..5a9389b1fb5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Priority_Mapping.h
@@ -0,0 +1,45 @@
+/* -*- C++ -*- */
+/**
+ * @file Priority_Mapping.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PRIORITY_MAPPING_H
+#define TAO_Notify_Tests_PRIORITY_MAPPING_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#include "tao/Basic_Types.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class TAO_Notify_Tests_Priority_Mapping
+ *
+ * @brief A default Priority mapping. simply returns the same number.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Priority_Mapping
+{
+public:
+ /// The destructor
+ virtual ~TAO_Notify_Tests_Priority_Mapping (void);
+
+ virtual CORBA::Boolean
+ to_native (CORBA::Short corba_priority,
+ CORBA::Short &native_priority);
+ virtual CORBA::Boolean
+ to_CORBA (CORBA::Short native_priority,
+ CORBA::Short &corba_priority);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PRIORITY_MAPPING_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp
new file mode 100644
index 00000000000..4ab288212fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "PushConsumer.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "PushConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(lib, TAO_PushConsumer, "$Id$")
+
+TAO_Notify_Tests_PushConsumer_Traits::TAO_Notify_Tests_PushConsumer_Traits (void)
+ :type_ (CosNotifyChannelAdmin::ANY_EVENT)
+{
+}
+
+/*******************************************************************/
+
+TAO_Notify_Tests_PushConsumer::TAO_Notify_Tests_PushConsumer (void)
+{
+}
+
+TAO_Notify_Tests_PushConsumer::~TAO_Notify_Tests_PushConsumer ()
+{
+}
+
+void
+TAO_Notify_Tests_PushConsumer::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL)
+{
+ proxy_ptr->connect_any_push_consumer (peer_ptr ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_PushConsumer::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "\nPush Consumer disconnecting from supplier.\n"));
+ this->proxy_->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_PushConsumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ bool this_method_used_only_by_notify_service = false;
+ ACE_ASSERT(this_method_used_only_by_notify_service);
+ ACE_UNUSED_ARG(this_method_used_only_by_notify_service);
+}
+
+void
+TAO_Notify_Tests_PushConsumer::push (const CORBA::Any & /*data*/ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ))
+{
+ // NOP
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/PushConsumer.h b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.h
new file mode 100644
index 00000000000..5aae9203447
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.h
@@ -0,0 +1,104 @@
+/* -*- C++ -*- */
+/**
+ * @file PushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PUSHCONSUMER_H
+#define TAO_Notify_Tests_PUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/NotifyExtC.h"
+
+#include "Consumer_T.h"
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_ProxyPushSupplier_Traits
+{
+public:
+ typedef CosNotifyChannelAdmin::ProxyPushSupplier INTERFACE;
+ typedef CosNotifyChannelAdmin::ProxyPushSupplier_ptr PTR;
+ typedef CosNotifyChannelAdmin::ProxyPushSupplier_var VAR;
+ typedef CosNotifyChannelAdmin::ProxyID ID;
+};
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_PushConsumer_Traits
+{
+public:
+ TAO_Notify_Tests_PushConsumer_Traits (void);
+
+ typedef CosNotifyComm::PushConsumer INTERFACE;
+ typedef CosNotifyComm::PushConsumer_ptr PTR;
+ typedef CosNotifyComm::PushConsumer_var VAR;
+ typedef POA_CosNotifyComm::PushConsumer SKELETON;
+
+ typedef TAO_Notify_Tests_ProxyPushSupplier_Traits Proxy_Traits;
+ typedef TAO_Notify_Tests_ConsumerAdmin_Traits Admin_Traits;
+ typedef TAO_Notify_Tests_ConsumerAdmin_Ext_Traits Admin_Ext_Traits;
+
+ const CosNotifyChannelAdmin::ClientType type_;
+};
+
+typedef TAO_Notify_Tests_Consumer_T<TAO_Notify_Tests_PushConsumer_Traits> TAO_Notify_Tests_PushConsumer_Base;
+
+/**
+ * @class TAO_Notify_Tests_PushConsumer
+ *
+ * @brief PushConsumer implementation.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_PushConsumer : public TAO_Notify_Tests_PushConsumer_Base
+{
+ typedef TAO_Notify_Tests_PushConsumer_Traits Peer_Traits;
+ typedef Peer_Traits::Admin_Traits Admin_Traits;
+ typedef Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef Peer_Traits::Proxy_Traits Proxy_Traits;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_PushConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_PushConsumer ();
+
+protected:
+ /// Connect to Peer.
+ virtual void connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL);
+
+ /// Disconnect from proxy.
+ virtual void disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = PushConsumer methods
+ virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Default does nothing.
+ void push (
+ const CORBA::Any & data
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+};
+
+#if defined (__ACE_INLINE__)
+#include "PushConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/PushConsumer.inl b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.inl
new file mode 100644
index 00000000000..e557d6a7eda
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/PushConsumer.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "PushConsumer.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp
new file mode 100644
index 00000000000..f5c3f4d94bd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.cpp
@@ -0,0 +1,55 @@
+// $Id$
+
+#include "PushSupplier.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "PushSupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(lib, TAO_PushSupplier, "$Id$")
+
+TAO_Notify_Tests_PushSupplier_Traits::TAO_Notify_Tests_PushSupplier_Traits (void)
+ :type_ (CosNotifyChannelAdmin::ANY_EVENT)
+{
+}
+
+/*******************************************************************/
+
+TAO_Notify_Tests_PushSupplier::TAO_Notify_Tests_PushSupplier (void)
+{
+}
+
+TAO_Notify_Tests_PushSupplier::~TAO_Notify_Tests_PushSupplier ()
+{
+}
+
+void
+TAO_Notify_Tests_PushSupplier::send_event (const CORBA::Any& any ACE_ENV_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_.in ()));
+
+ this->proxy_->push (any ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_PushSupplier::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL)
+{
+ proxy_ptr->connect_any_push_supplier (peer_ptr
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_PushSupplier::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "\nPush Supplier disconnecting from consumer.\n"));
+ this->proxy_->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_PushSupplier::disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ bool this_method_used_only_by_notify_service = false;
+ ACE_ASSERT(this_method_used_only_by_notify_service);
+ ACE_UNUSED_ARG(this_method_used_only_by_notify_service);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/PushSupplier.h b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.h
new file mode 100644
index 00000000000..edf2753e87d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.h
@@ -0,0 +1,97 @@
+/* -*- C++ -*- */
+/**
+ * @file PushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_PUSHSUPPLIER_H
+#define TAO_Notify_Tests_PUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/NotifyExtC.h"
+
+#include "Supplier_T.h"
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_ProxyPushConsumer_Traits
+{
+public:
+ typedef CosNotifyChannelAdmin::ProxyPushConsumer INTERFACE;
+ typedef CosNotifyChannelAdmin::ProxyPushConsumer_ptr PTR;
+ typedef CosNotifyChannelAdmin::ProxyPushConsumer_var VAR;
+ typedef CosNotifyChannelAdmin::ProxyID ID;
+};
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_PushSupplier_Traits
+{
+public:
+ TAO_Notify_Tests_PushSupplier_Traits (void);
+
+ typedef CosNotifyComm::PushSupplier INTERFACE;
+ typedef CosNotifyComm::PushSupplier_ptr PTR;
+ typedef CosNotifyComm::PushSupplier_var VAR;
+ typedef POA_CosNotifyComm::PushSupplier SKELETON;
+
+ typedef TAO_Notify_Tests_ProxyPushConsumer_Traits Proxy_Traits;
+ typedef TAO_Notify_Tests_SupplierAdmin_Traits Admin_Traits;
+ typedef TAO_Notify_Tests_SupplierAdmin_Ext_Traits Admin_Ext_Traits;
+
+ const CosNotifyChannelAdmin::ClientType type_;
+};
+
+typedef TAO_Notify_Tests_Supplier_T<TAO_Notify_Tests_PushSupplier_Traits> TAO_Notify_Tests_PushSupplier_Base;
+
+/**
+ * @class TAO_Notify_Tests_PushSupplier
+ *
+ * @brief PushSupplier Implementation.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_PushSupplier : public TAO_Notify_Tests_PushSupplier_Base
+{
+ typedef TAO_Notify_Tests_PushSupplier_Traits Peer_Traits;
+ typedef Peer_Traits::Admin_Traits Admin_Traits;
+ typedef Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef Peer_Traits::Proxy_Traits Proxy_Traits;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_PushSupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_PushSupplier ();
+
+ /// Send one event.
+ virtual void send_event (const CORBA::Any & data ACE_ENV_ARG_DECL);
+
+protected:
+ /// Connect to Peer.
+ virtual void connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL);
+
+ /// Disconnect from proxy.
+ virtual void disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = PushSupplier method
+ virtual void disconnect_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+};
+
+#if defined (__ACE_INLINE__)
+#include "PushSupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_PUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/PushSupplier.inl b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.inl
new file mode 100644
index 00000000000..9f9bf75ff2f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/PushSupplier.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "PushSupplier.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/README b/TAO/orbsvcs/tests/Notify/lib/README
new file mode 100644
index 00000000000..3e8a49d1c22
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/README
@@ -0,0 +1,10 @@
+//$Id$
+
+This directory has the library used by the test examples to test the
+Notification Service.
+
+Helper classes TAO_Notify_Tests_StructuredPushConsumer,
+ TAO_Notify_Tests_StructuredPushSupplier,
+ TAO_Notify_Tests_PushConsumer,
+ TAO_Notify_Tests_PushSupplier,
+to help write client consumers and suppliers.
diff --git a/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.cpp b/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.cpp
new file mode 100644
index 00000000000..629639070b5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.cpp
@@ -0,0 +1,44 @@
+// $Id$
+
+#include "Relay_Consumer.h"
+
+ACE_RCSID(Notify, TAO_Notify_Tests_Relay_Consumer, "$Id$")
+
+#include "LookupManager.h"
+
+TAO_Notify_Tests_Relay_Consumer::TAO_Notify_Tests_Relay_Consumer (ACE_CString& destination)
+ : destination_ (destination)
+{
+}
+
+TAO_Notify_Tests_Relay_Consumer::~TAO_Notify_Tests_Relay_Consumer ()
+{
+}
+
+void
+TAO_Notify_Tests_Relay_Consumer::connect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ TAO_Notify_Tests_Direct_Consumer::connect (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Resolve the destination object.
+ LOOKUP_MANAGER->resolve (this->destination_object_, this->destination_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_Relay_Consumer::push_structured_event (const CosNotification::StructuredEvent &notification
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ // The Periodic Consumer will record the run statistics.
+ //TAO_Notify_Tests_Periodic_Consumer::push_structured_event (notification ACE_ENV_ARG_PARAMETER);
+ //ACE_CHECK;
+
+ // Forward the event.
+ if (CORBA::is_nil (this->destination_object_.in ()))
+ ACE_DEBUG ((LM_DEBUG, "(%P,%t) Cannot Relay - Destination object %s is nil", this->destination_.c_str ()));
+ else
+ this->destination_object_->push_structured_event (notification ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.h b/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.h
new file mode 100644
index 00000000000..87fe1ecf44a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.h
@@ -0,0 +1,56 @@
+/* -*- C++ -*- */
+/**
+ * @file Relay_Consumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_RELAY_CONSUMER_H
+#define TAO_Notify_Tests_RELAY_CONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Direct_Consumer.h"
+
+/**
+ * @class TAO_Notify_Tests_Relay_Consumer
+ *
+ * @brief Relay events to a destination consumer.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Relay_Consumer : public TAO_Notify_Tests_Direct_Consumer
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Relay_Consumer (ACE_CString& destination);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Relay_Consumer ();
+
+ /// Connect using options parsed and set initial QoS.
+ virtual void connect (ACE_ENV_SINGLE_ARG_DECL);
+
+ void push_structured_event (const CosNotification::StructuredEvent &/*notification*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+
+protected:
+ /// Destination object.
+ ACE_CString destination_;
+
+ /// This object is resolved in the connect method.
+ CosNotifyComm::StructuredPushConsumer_var destination_object_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_RELAY_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.inl b/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.inl
new file mode 100644
index 00000000000..d38d4639901
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Relay_Consumer.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "Relay_Consumer.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp
new file mode 100644
index 00000000000..e63d3661671
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.cpp
@@ -0,0 +1,57 @@
+// $Id$
+
+#include "SequencePushConsumer.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "SequencePushConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(lib, TAO_SequencePushConsumer, "$Id$")
+
+TAO_Notify_Tests_SequencePushConsumer_Traits::TAO_Notify_Tests_SequencePushConsumer_Traits (void)
+ :type_ (CosNotifyChannelAdmin::SEQUENCE_EVENT)
+{
+}
+
+/*******************************************************************/
+
+TAO_Notify_Tests_SequencePushConsumer::TAO_Notify_Tests_SequencePushConsumer (void)
+{
+}
+
+TAO_Notify_Tests_SequencePushConsumer::~TAO_Notify_Tests_SequencePushConsumer ()
+{
+}
+
+void
+TAO_Notify_Tests_SequencePushConsumer::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL)
+{
+ proxy_ptr->connect_sequence_push_consumer (peer_ptr
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_SequencePushConsumer::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "\nPush Consumer disconnecting from supplier.\n"));
+ this->proxy_->disconnect_sequence_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_SequencePushConsumer::disconnect_sequence_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ bool this_method_used_only_by_notify_service = false;
+ ACE_ASSERT(this_method_used_only_by_notify_service);
+ ACE_UNUSED_ARG(this_method_used_only_by_notify_service);
+}
+
+void
+TAO_Notify_Tests_SequencePushConsumer::push_structured_events
+ (const CosNotification::EventBatch &/*notifications*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ // NOP
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.h b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.h
new file mode 100644
index 00000000000..7e4a4773b27
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.h
@@ -0,0 +1,104 @@
+/* -*- C++ -*- */
+/**
+ * @file SequencePushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_SEQUENCEPUSHCONSUMER_H
+#define TAO_Notify_Tests_SEQUENCEPUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/NotifyExtC.h"
+
+#include "Consumer_T.h"
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_SequenceProxyPushSupplier_Traits
+{
+public:
+ typedef CosNotifyChannelAdmin::SequenceProxyPushSupplier INTERFACE;
+ typedef CosNotifyChannelAdmin::SequenceProxyPushSupplier_ptr PTR;
+ typedef CosNotifyChannelAdmin::SequenceProxyPushSupplier_var VAR;
+ typedef CosNotifyChannelAdmin::ProxyID ID;
+};
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_SequencePushConsumer_Traits
+{
+public:
+ TAO_Notify_Tests_SequencePushConsumer_Traits (void);
+
+ typedef CosNotifyComm::SequencePushConsumer INTERFACE;
+ typedef CosNotifyComm::SequencePushConsumer_ptr PTR;
+ typedef CosNotifyComm::SequencePushConsumer_var VAR;
+ typedef POA_CosNotifyComm::SequencePushConsumer SKELETON;
+
+ typedef TAO_Notify_Tests_SequenceProxyPushSupplier_Traits Proxy_Traits;
+ typedef TAO_Notify_Tests_ConsumerAdmin_Traits Admin_Traits;
+ typedef TAO_Notify_Tests_ConsumerAdmin_Ext_Traits Admin_Ext_Traits;
+
+ const CosNotifyChannelAdmin::ClientType type_;
+};
+
+typedef TAO_Notify_Tests_Consumer_T<TAO_Notify_Tests_SequencePushConsumer_Traits> TAO_Notify_Tests_SequencePushConsumer_Base;
+
+/**
+ * @class TAO_Notify_Tests_SequencePushConsumer
+ *
+ * @brief SequencePushConsumer Implementation.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_SequencePushConsumer : public TAO_Notify_Tests_SequencePushConsumer_Base
+{
+ typedef TAO_Notify_Tests_SequencePushConsumer_Traits Peer_Traits;
+ typedef Peer_Traits::Admin_Traits Admin_Traits;
+ typedef Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef Peer_Traits::Proxy_Traits Proxy_Traits;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_SequencePushConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_SequencePushConsumer ();
+
+protected:
+ /// Connect to Peer.
+ virtual void connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL);
+
+ /// Disconnect from proxy.
+ virtual void disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = SequencePushConsumer methods
+ virtual void disconnect_sequence_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Default does nothing.
+ virtual void push_structured_events (
+ const CosNotification::EventBatch & notifications
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+};
+
+#if defined (__ACE_INLINE__)
+#include "SequencePushConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_SEQUENCEPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.inl b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.inl
new file mode 100644
index 00000000000..d050292323e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushConsumer.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "SequencePushConsumer.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp
new file mode 100644
index 00000000000..76151253271
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.cpp
@@ -0,0 +1,57 @@
+// $Id$
+
+#include "SequencePushSupplier.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "SequencePushSupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(lib, TAO_SequencePushSupplier, "$Id$")
+
+TAO_Notify_Tests_SequencePushSupplier_Traits::TAO_Notify_Tests_SequencePushSupplier_Traits (void)
+ :type_ (CosNotifyChannelAdmin::SEQUENCE_EVENT)
+{
+}
+
+/*******************************************************************/
+
+TAO_Notify_Tests_SequencePushSupplier::TAO_Notify_Tests_SequencePushSupplier (void)
+{
+}
+
+TAO_Notify_Tests_SequencePushSupplier::~TAO_Notify_Tests_SequencePushSupplier ()
+{
+}
+
+void
+TAO_Notify_Tests_SequencePushSupplier::send_events (const CosNotification::EventBatch& events
+ ACE_ENV_ARG_DECL
+ )
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_.in ()));
+
+ this->proxy_->push_structured_events (events ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_SequencePushSupplier::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL)
+{
+ proxy_ptr->connect_sequence_push_supplier (peer_ptr
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_SequencePushSupplier::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "\nPush Supplier disconnecting from consumer.\n"));
+ this->proxy_->disconnect_sequence_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_SequencePushSupplier::disconnect_sequence_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ bool this_method_used_only_by_notify_service = false;
+ ACE_ASSERT(this_method_used_only_by_notify_service);
+ ACE_UNUSED_ARG(this_method_used_only_by_notify_service);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.h b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.h
new file mode 100644
index 00000000000..dad8bd6d0eb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.h
@@ -0,0 +1,98 @@
+/* -*- C++ -*- */
+/**
+ * @file SequencePushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_SEQUENCEPUSHSUPPLIER_H
+#define TAO_Notify_Tests_SEQUENCEPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/NotifyExtC.h"
+
+#include "Supplier_T.h"
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_SequenceProxyPushConsumer_Traits
+{
+public:
+ typedef CosNotifyChannelAdmin::SequenceProxyPushConsumer INTERFACE;
+ typedef CosNotifyChannelAdmin::SequenceProxyPushConsumer_ptr PTR;
+ typedef CosNotifyChannelAdmin::SequenceProxyPushConsumer_var VAR;
+ typedef CosNotifyChannelAdmin::ProxyID ID;
+};
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_SequencePushSupplier_Traits
+{
+public:
+ TAO_Notify_Tests_SequencePushSupplier_Traits (void);
+
+ typedef CosNotifyComm::SequencePushSupplier INTERFACE;
+ typedef CosNotifyComm::SequencePushSupplier_ptr PTR;
+ typedef CosNotifyComm::SequencePushSupplier_var VAR;
+ typedef POA_CosNotifyComm::SequencePushSupplier SKELETON;
+
+ typedef TAO_Notify_Tests_SequenceProxyPushConsumer_Traits Proxy_Traits;
+ typedef TAO_Notify_Tests_SupplierAdmin_Traits Admin_Traits;
+ typedef TAO_Notify_Tests_SupplierAdmin_Ext_Traits Admin_Ext_Traits;
+
+ const CosNotifyChannelAdmin::ClientType type_;
+};
+
+typedef TAO_Notify_Tests_Supplier_T<TAO_Notify_Tests_SequencePushSupplier_Traits> TAO_Notify_Tests_SequencePushSupplier_Base;
+
+/**
+ * @class TAO_Notify_Tests_SequencePushSupplier
+ *
+ * @brief SequencePushSupplier Implementation.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_SequencePushSupplier : public TAO_Notify_Tests_SequencePushSupplier_Base
+{
+ typedef TAO_Notify_Tests_SequencePushSupplier_Traits Peer_Traits;
+ typedef Peer_Traits::Admin_Traits Admin_Traits;
+ typedef Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef Peer_Traits::Proxy_Traits Proxy_Traits;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_SequencePushSupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_SequencePushSupplier ();
+
+ /// Send one event.
+ virtual void send_events (const CosNotification::EventBatch& events
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Connect to Peer.
+ virtual void connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL);
+
+ /// Disconnect from proxy.
+ virtual void disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = SequencePushSupplier method
+ virtual void disconnect_sequence_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+};
+
+#if defined (__ACE_INLINE__)
+#include "SequencePushSupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_SEQUENCEPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.inl b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.inl
new file mode 100644
index 00000000000..507cd0b85c6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SequencePushSupplier.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "SequencePushSupplier.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredEvent.cpp b/TAO/orbsvcs/tests/Notify/lib/StructuredEvent.cpp
new file mode 100644
index 00000000000..6c6a9882916
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredEvent.cpp
@@ -0,0 +1,88 @@
+// $Id$
+
+#include "StructuredEvent.h"
+
+ACE_RCSID(RT_Notify, TAO_Notify_Tests_StructuredEvent, "$Id$")
+
+TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent (void)
+{
+}
+
+TAO_Notify_Tests_StructuredEvent::~TAO_Notify_Tests_StructuredEvent ()
+{
+}
+
+TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent (const char* name)
+{
+ event_.header.fixed_header.event_name = CORBA::string_dup(name);
+}
+
+TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent (const char* domain, const char* type)
+{
+ event_.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain);
+ event_.header.fixed_header.event_type.type_name = CORBA::string_dup(type);
+}
+
+TAO_Notify_Tests_StructuredEvent::TAO_Notify_Tests_StructuredEvent (const char* name, const char* domain, const char* type)
+{
+ event_.header.fixed_header.event_name = CORBA::string_dup(name);
+ event_.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain);
+ event_.header.fixed_header.event_type.type_name = CORBA::string_dup(type);
+}
+
+void
+TAO_Notify_Tests_StructuredEvent::name (const char* name)
+{
+ event_.header.fixed_header.event_name = CORBA::string_dup(name);
+}
+
+void
+TAO_Notify_Tests_StructuredEvent::type (const char* domain, const char* type)
+{
+ event_.header.fixed_header.event_type.domain_name = CORBA::string_dup(domain);
+ event_.header.fixed_header.event_type.type_name = CORBA::string_dup(type);
+}
+
+const char*
+TAO_Notify_Tests_StructuredEvent::type (void)
+{
+ return event_.header.fixed_header.event_type.type_name;
+}
+
+void
+TAO_Notify_Tests_StructuredEvent::opt_header (const char* name, CORBA::Any& value)
+{
+ CosNotification::PropertySeq& opt = event_.header.variable_header;
+ opt.length (opt.length () + 1);
+
+ opt[opt.length () - 1].name = CORBA::string_dup (name);
+ opt[opt.length () - 1].value = value;
+}
+
+void
+TAO_Notify_Tests_StructuredEvent::filter (const char* name, CORBA::Any& value)
+{
+ CosNotification::PropertySeq& filter = event_.filterable_data;
+ filter.length (filter.length () + 1);
+
+ filter[filter.length () - 1].name = CORBA::string_dup (name);
+ filter[filter.length () - 1].value = value;
+}
+
+void
+TAO_Notify_Tests_StructuredEvent::qos (const char* name, CORBA::Any& value)
+{
+ this->opt_header (name, value);
+}
+
+void
+TAO_Notify_Tests_StructuredEvent::payload (CORBA::Any& value)
+{
+ event_.remainder_of_body = value;
+}
+
+CosNotification::StructuredEvent&
+TAO_Notify_Tests_StructuredEvent::event (void)
+{
+ return this->event_;
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredEvent.h b/TAO/orbsvcs/tests/Notify/lib/StructuredEvent.h
new file mode 100644
index 00000000000..dddecec4dc1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredEvent.h
@@ -0,0 +1,67 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredEvent.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_STRUCTUREDEVENT_H
+#define TAO_Notify_Tests_STRUCTUREDEVENT_H
+
+#include /**/ "ace/pre.h"
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotificationC.h"
+
+/**
+ * @class TAO_Notify_Tests_StructuredEvent
+ *
+ * @brief Helper class to populate a CosNotification::StructuredEvent.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_StructuredEvent
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_StructuredEvent (void);
+ TAO_Notify_Tests_StructuredEvent (const char* name);
+ TAO_Notify_Tests_StructuredEvent (const char* domain, const char* type);
+ TAO_Notify_Tests_StructuredEvent (const char* name, const char* domain, const char* type);
+
+ /// Destructor
+ ~TAO_Notify_Tests_StructuredEvent ();
+
+ void name (const char* name);
+ void type (const char* domain, const char* type);
+
+ const char* type (void);
+
+ /// add <name,value> to optional header sequence.
+ void opt_header (const char* name, CORBA::Any& value);
+
+ /// add <name,value> to filterable body sequence.
+ void filter (const char* name, CORBA::Any& value);
+
+ /// add <name,value> to variable header sequence.
+ void qos (const char* name, CORBA::Any& value);
+
+ /// The remainder_of_body
+ void payload (CORBA::Any& value);
+
+ /// access the underlying event.
+ CosNotification::StructuredEvent& event (void);
+
+private:
+ CosNotification::StructuredEvent event_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_STRUCTUREDEVENT_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp
new file mode 100644
index 00000000000..2db62342778
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.cpp
@@ -0,0 +1,57 @@
+// $Id$
+
+#include "StructuredPushConsumer.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "StructuredPushConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(lib, TAO_StructuredPushConsumer, "$Id$")
+
+TAO_Notify_Tests_StructuredPushConsumer_Traits::TAO_Notify_Tests_StructuredPushConsumer_Traits (void)
+ :type_ (CosNotifyChannelAdmin::STRUCTURED_EVENT)
+{
+}
+
+/*******************************************************************/
+
+TAO_Notify_Tests_StructuredPushConsumer::TAO_Notify_Tests_StructuredPushConsumer (void)
+{
+}
+
+TAO_Notify_Tests_StructuredPushConsumer::~TAO_Notify_Tests_StructuredPushConsumer ()
+{
+}
+
+void
+TAO_Notify_Tests_StructuredPushConsumer::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL)
+{
+ proxy_ptr->connect_structured_push_consumer (peer_ptr
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_StructuredPushConsumer::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "\nPush Consumer disconnecting from supplier.\n"));
+ this->proxy_->disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_StructuredPushConsumer::disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ bool this_method_used_only_by_notify_service = false;
+ ACE_ASSERT(this_method_used_only_by_notify_service);
+ ACE_UNUSED_ARG(this_method_used_only_by_notify_service);
+}
+
+void
+TAO_Notify_Tests_StructuredPushConsumer::push_structured_event
+ (const CosNotification::StructuredEvent &/*notification*/
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ // NOP
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.h b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.h
new file mode 100644
index 00000000000..43ee9ffec52
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.h
@@ -0,0 +1,104 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredPushConsumer.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_STRUCTUREDPUSHCONSUMER_H
+#define TAO_Notify_Tests_STRUCTUREDPUSHCONSUMER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/NotifyExtC.h"
+
+#include "Consumer_T.h"
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_StructuredProxyPushSupplier_Traits
+{
+public:
+ typedef CosNotifyChannelAdmin::StructuredProxyPushSupplier INTERFACE;
+ typedef CosNotifyChannelAdmin::StructuredProxyPushSupplier_ptr PTR;
+ typedef CosNotifyChannelAdmin::StructuredProxyPushSupplier_var VAR;
+ typedef CosNotifyChannelAdmin::ProxyID ID;
+};
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_StructuredPushConsumer_Traits
+{
+public:
+ TAO_Notify_Tests_StructuredPushConsumer_Traits (void);
+
+ typedef CosNotifyComm::StructuredPushConsumer INTERFACE;
+ typedef CosNotifyComm::StructuredPushConsumer_ptr PTR;
+ typedef CosNotifyComm::StructuredPushConsumer_var VAR;
+ typedef POA_CosNotifyComm::StructuredPushConsumer SKELETON;
+
+ typedef TAO_Notify_Tests_StructuredProxyPushSupplier_Traits Proxy_Traits;
+ typedef TAO_Notify_Tests_ConsumerAdmin_Traits Admin_Traits;
+ typedef TAO_Notify_Tests_ConsumerAdmin_Ext_Traits Admin_Ext_Traits;
+
+ const CosNotifyChannelAdmin::ClientType type_;
+};
+
+typedef TAO_Notify_Tests_Consumer_T<TAO_Notify_Tests_StructuredPushConsumer_Traits> TAO_Notify_Tests_StructuredPushConsumer_Base;
+
+/**
+ * @class TAO_Notify_Tests_StructuredPushConsumer
+ *
+ * @brief StructuredPushConsumer Implementation.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_StructuredPushConsumer : public TAO_Notify_Tests_StructuredPushConsumer_Base
+{
+ typedef TAO_Notify_Tests_StructuredPushConsumer_Traits Peer_Traits;
+ typedef Peer_Traits::Admin_Traits Admin_Traits;
+ typedef Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef Peer_Traits::Proxy_Traits Proxy_Traits;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_StructuredPushConsumer (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_StructuredPushConsumer ();
+
+protected:
+ /// Connect to Peer.
+ virtual void connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL);
+
+ /// Disconnect from proxy.
+ virtual void disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = StructuredPushConsumer methods
+ virtual void disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ /// Default does nothing.
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+};
+
+#if defined (__ACE_INLINE__)
+#include "StructuredPushConsumer.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_STRUCTUREDPUSHCONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.inl b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.inl
new file mode 100644
index 00000000000..24e952b7ae8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushConsumer.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "StructuredPushConsumer.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp
new file mode 100644
index 00000000000..289058864f1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.cpp
@@ -0,0 +1,58 @@
+// $Id$
+
+#include "StructuredPushSupplier.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "StructuredPushSupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(lib, TAO_StructuredPushSupplier, "$Id$")
+
+TAO_Notify_Tests_StructuredPushSupplier_Traits::TAO_Notify_Tests_StructuredPushSupplier_Traits (void)
+ :type_ (CosNotifyChannelAdmin::STRUCTURED_EVENT)
+{
+}
+
+/*******************************************************************/
+
+TAO_Notify_Tests_StructuredPushSupplier::TAO_Notify_Tests_StructuredPushSupplier (void)
+{
+}
+
+TAO_Notify_Tests_StructuredPushSupplier::~TAO_Notify_Tests_StructuredPushSupplier ()
+{
+}
+
+void
+TAO_Notify_Tests_StructuredPushSupplier::send_event (
+ const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL
+ )
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_.in ()));
+
+ this->proxy_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_StructuredPushSupplier::connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL)
+{
+ proxy_ptr->connect_structured_push_supplier (peer_ptr
+ ACE_ENV_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_StructuredPushSupplier::disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "\nPush Supplier disconnecting from consumer.\n"));
+ this->proxy_->disconnect_structured_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
+}
+
+void
+TAO_Notify_Tests_StructuredPushSupplier::disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ bool this_method_used_only_by_notify_service = false;
+ ACE_ASSERT(this_method_used_only_by_notify_service);
+ ACE_UNUSED_ARG(this_method_used_only_by_notify_service);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.h b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.h
new file mode 100644
index 00000000000..e1c11dc6a54
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.h
@@ -0,0 +1,98 @@
+/* -*- C++ -*- */
+/**
+ * @file StructuredPushSupplier.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_STRUCTUREDPUSHSUPPLIER_H
+#define TAO_Notify_Tests_STRUCTUREDPUSHSUPPLIER_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/NotifyExtC.h"
+
+#include "Supplier_T.h"
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_StructuredProxyPushConsumer_Traits
+{
+public:
+ typedef CosNotifyChannelAdmin::StructuredProxyPushConsumer INTERFACE;
+ typedef CosNotifyChannelAdmin::StructuredProxyPushConsumer_ptr PTR;
+ typedef CosNotifyChannelAdmin::StructuredProxyPushConsumer_var VAR;
+ typedef CosNotifyChannelAdmin::ProxyID ID;
+};
+
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_StructuredPushSupplier_Traits
+{
+public:
+ TAO_Notify_Tests_StructuredPushSupplier_Traits (void);
+
+ typedef CosNotifyComm::StructuredPushSupplier INTERFACE;
+ typedef CosNotifyComm::StructuredPushSupplier_ptr PTR;
+ typedef CosNotifyComm::StructuredPushSupplier_var VAR;
+ typedef POA_CosNotifyComm::StructuredPushSupplier SKELETON;
+
+ typedef TAO_Notify_Tests_StructuredProxyPushConsumer_Traits Proxy_Traits;
+ typedef TAO_Notify_Tests_SupplierAdmin_Traits Admin_Traits;
+ typedef TAO_Notify_Tests_SupplierAdmin_Ext_Traits Admin_Ext_Traits;
+
+ const CosNotifyChannelAdmin::ClientType type_;
+};
+
+typedef TAO_Notify_Tests_Supplier_T<TAO_Notify_Tests_StructuredPushSupplier_Traits> TAO_Notify_Tests_StructuredPushSupplier_Base;
+
+/**
+ * @class TAO_Notify_Tests_StructuredPushSupplier
+ *
+ * @brief StructuredPushSupplier Implementation.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_StructuredPushSupplier : public TAO_Notify_Tests_StructuredPushSupplier_Base
+{
+ typedef TAO_Notify_Tests_StructuredPushSupplier_Traits Peer_Traits;
+ typedef Peer_Traits::Admin_Traits Admin_Traits;
+ typedef Peer_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef Peer_Traits::Proxy_Traits Proxy_Traits;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_StructuredPushSupplier (void);
+
+ /// Destructor
+ virtual ~TAO_Notify_Tests_StructuredPushSupplier ();
+
+ /// Send one event.
+ virtual void send_event (const CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL);
+
+protected:
+ /// Connect to Peer.
+ virtual void connect_to_peer (Proxy_Traits::PTR proxy_ptr, Peer_Traits::PTR peer_ptr ACE_ENV_ARG_DECL);
+
+ /// Disconnect from proxy.
+ virtual void disconnect_from_proxy (ACE_ENV_SINGLE_ARG_DECL);
+
+ // = StructuredPushSupplier method
+ virtual void disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+};
+
+#if defined (__ACE_INLINE__)
+#include "StructuredPushSupplier.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_STRUCTUREDPUSHSUPPLIER_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.inl b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.inl
new file mode 100644
index 00000000000..12cb29daaef
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/StructuredPushSupplier.inl
@@ -0,0 +1,3 @@
+// $Id$
+
+#include "StructuredPushSupplier.h"
diff --git a/TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.cpp b/TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.cpp
new file mode 100644
index 00000000000..5adaa65c92c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.cpp
@@ -0,0 +1,179 @@
+// $Id$
+
+#include "SupplierAdmin_Command.h"
+
+ACE_RCSID(lib, TAO_SupplierAdmin_Command, "$Id$")
+
+#include "LookupManager.h"
+#include "Name.h"
+#include "Options_Parser.h"
+
+TAO_Notify_Tests_SupplierAdmin_Command::TAO_Notify_Tests_SupplierAdmin_Command (void)
+: ifgop_ (CosNotifyChannelAdmin::OR_OP), id_ (0)
+{
+}
+
+TAO_Notify_Tests_SupplierAdmin_Command::~TAO_Notify_Tests_SupplierAdmin_Command ()
+{
+}
+
+const char*
+TAO_Notify_Tests_SupplierAdmin_Command::get_name (void)
+{
+ return TAO_Notify_Tests_SupplierAdmin_Command::name ();
+}
+
+const char*
+TAO_Notify_Tests_SupplierAdmin_Command::name (void)
+{
+ return TAO_Notify_Tests_Name::supplier_admin_command;
+}
+
+void
+TAO_Notify_Tests_SupplierAdmin_Command::init (ACE_Arg_Shifter& arg_shifter)
+{
+ if (arg_shifter.is_anything_left ())
+ {
+ /// -Create sa_name factory_name
+ if (arg_shifter.cur_arg_strncasecmp ("-Create") == 0)
+ {
+ this->command_ = CREATE;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ this->factory_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ if (arg_shifter.cur_arg_strncasecmp ("-AND_OP") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->ifgop_ = CosNotifyChannelAdmin::AND_OP;
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-OR_OP") == 0)
+ {
+ arg_shifter.consume_arg ();
+
+ this->ifgop_ = CosNotifyChannelAdmin::OR_OP;
+ }
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Offer") == 0)
+ // -Subscription admin_name +added_type1 +-added_type2 ... -added_type3 -added_type4..
+ {
+ this->command_ = OFFER;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser options_parser;
+ options_parser.execute (this->added_, this->removed_, arg_shifter);
+ } // Subscription
+ else if (arg_shifter.cur_arg_strncasecmp ("-Set_QoS") == 0) // -Set_QoS ec_name [Qos Options]
+ {
+ this->command_ = SET_QOS;
+
+ arg_shifter.consume_arg ();
+
+ this->name_ = arg_shifter.get_current ();
+
+ arg_shifter.consume_arg ();
+
+ TAO_Notify_Tests_Options_Parser qos_parser;
+ qos_parser.execute (this->qos_, arg_shifter);
+ }
+ } /* if */
+}
+
+void
+TAO_Notify_Tests_SupplierAdmin_Command::handle_create (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::EventChannel_var ec;
+
+ LOOKUP_MANAGER->resolve (ec, this->factory_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // create supplier admin
+ CosNotifyChannelAdmin::SupplierAdmin_var sa =
+ ec->new_for_suppliers (this->ifgop_,
+ this->id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ LOOKUP_MANAGER->_register (sa.in(), this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_SupplierAdmin_Command::handle_offers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::SupplierAdmin_var admin;
+
+ LOOKUP_MANAGER->resolve (admin, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Let the user see what we're subscribed for,
+ ACE_DEBUG ((LM_DEBUG, "Calling SupplierAdmin offer_change : "));
+
+ CORBA::ULong i = 0;
+
+ for (; i < added_.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "+(%s,%s), ", added_[i].domain_name.in (), added_[i].type_name.in ()));
+ }
+ for (i = 0; i < removed_.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "-(%s,%s), ", removed_[i].domain_name.in (), removed_[i].type_name.in ()));
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+
+ admin->offer_change (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_SupplierAdmin_Command::handle_status (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+}
+
+void
+TAO_Notify_Tests_SupplierAdmin_Command::handle_set_qos (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::SupplierAdmin_var admin;
+
+ LOOKUP_MANAGER->resolve (admin, this->name_.c_str () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ admin->set_qos (this->qos_ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_Notify_Tests_SupplierAdmin_Command::execute_i (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->command_ == CREATE)
+ {
+ this->handle_create (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == OFFER)
+ {
+ this->handle_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == SET_QOS)
+ {
+ this->handle_set_qos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ else if (this->command_ == DUMP_STATE)
+ {
+ this->handle_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.h b/TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.h
new file mode 100644
index 00000000000..fbed3172551
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/SupplierAdmin_Command.h
@@ -0,0 +1,89 @@
+/* -*- C++ -*- */
+/**
+ * @file SupplierAdmin_Command.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_SUPPLIERADMIN_COMMAND_H
+#define TAO_Notify_Tests_SUPPLIERADMIN_COMMAND_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/SString.h"
+#include "orbsvcs/CosNotifyChannelAdminC.h"
+#include "Command.h"
+
+/**
+ * @class TAO_Notify_Tests_SupplierAdmin_Command
+ *
+ * @brief Command for Supplier Admins.
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_SupplierAdmin_Command : public TAO_Notify_Tests_Command
+{
+public:
+ /// Constuctor
+ TAO_Notify_Tests_SupplierAdmin_Command (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_SupplierAdmin_Command ();
+
+ /// Parse args and populate options.
+ virtual void init (ACE_Arg_Shifter& arg_shifter);
+
+ /// Execute the command.
+ virtual void execute_i (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Name of object
+ virtual const char* get_name (void);
+ static const char* name (void);
+
+protected:
+
+#ifdef HPUX_11
+ // Remove clash with /usr/include/machine/cpu.h and /usr/include/pa/cpu.h
+#undef COMMAND
+#endif
+ enum COMMAND
+ {
+ CREATE,
+ OFFER,
+ DESTROY,
+ SET_QOS,
+ SET_ADMIN,
+ DUMP_STATE
+ };
+
+ ACE_CString name_;
+
+ ACE_CString factory_;
+
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_;
+
+ CosNotifyChannelAdmin::AdminID id_;
+
+ CosNotification::QoSProperties qos_;
+
+ // Subscription change
+ CosNotification::EventTypeSeq added_;
+ CosNotification::EventTypeSeq removed_;
+
+ /// = Handlers
+ void handle_create (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_offers (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_status (ACE_ENV_SINGLE_ARG_DECL);
+ void handle_set_qos (ACE_ENV_SINGLE_ARG_DECL);
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_SUPPLIERADMIN_COMMAND_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Supplier_T.cpp b/TAO/orbsvcs/tests/Notify/lib/Supplier_T.cpp
new file mode 100644
index 00000000000..3641ca65f32
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Supplier_T.cpp
@@ -0,0 +1,104 @@
+// $Id$
+#ifndef TAO_Notify_Tests_Supplier_T_CPP
+#define TAO_Notify_Tests_Supplier_T_CPP
+
+#include "Supplier_T.h"
+
+ACE_RCSID(Notify, TAO_Notify_Tests_Supplier_T, "$Id$")
+
+template <class Supplier_Traits>
+TAO_Notify_Tests_Supplier_T<Supplier_Traits>::TAO_Notify_Tests_Supplier_T (void)
+{
+}
+
+template <class Supplier_Traits>
+TAO_Notify_Tests_Supplier_T<Supplier_Traits>::~TAO_Notify_Tests_Supplier_T ()
+{
+}
+
+template <class Supplier_Traits> ACE_TYPENAME TAO_Notify_Tests_Supplier_T<Supplier_Traits>::Proxy_Traits_PTR
+TAO_Notify_Tests_Supplier_T<Supplier_Traits>::get_proxy_consumer (void)
+{
+ return this->get_proxy ();
+}
+
+template <class Supplier_Traits> ACE_TYPENAME TAO_Notify_Tests_Supplier_T<Supplier_Traits>::Proxy_Traits_PTR
+TAO_Notify_Tests_Supplier_T<Supplier_Traits>::obtain_proxy (ACE_TYPENAME TAO_Notify_Tests_Supplier_T<Supplier_Traits>::Admin_Traits_PTR admin_ptr ACE_ENV_ARG_DECL)
+{
+ Supplier_Traits traits;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ admin_ptr->obtain_notification_push_consumer (traits.type_
+ , this->proxy_id_
+ ACE_ENV_ARG_PARAMETER
+ );
+
+ ACE_CHECK_RETURN (Proxy_Traits_INTERFACE::_nil ());
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_consumer.in ()));
+
+ return Proxy_Traits_INTERFACE::_narrow (proxy_consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class Supplier_Traits> ACE_TYPENAME TAO_Notify_Tests_Supplier_T<Supplier_Traits>::Proxy_Traits_PTR
+TAO_Notify_Tests_Supplier_T<Supplier_Traits>::obtain_proxy (ACE_TYPENAME TAO_Notify_Tests_Supplier_T<Supplier_Traits>::Admin_Ext_Traits_PTR admin_ptr
+ , CosNotification::QoSProperties& qos
+ ACE_ENV_ARG_DECL)
+{
+ Supplier_Traits traits;
+
+ // create the proxy consumer
+ CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
+ admin_ptr->obtain_notification_push_consumer_with_qos (traits.type_
+ , this->proxy_id_
+ , qos
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (Proxy_Traits_INTERFACE::_nil ());
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_consumer.in ()));
+
+ return Proxy_Traits_INTERFACE::_narrow (proxy_consumer.in ()
+ ACE_ENV_ARG_PARAMETER);
+}
+
+template <class Supplier_Traits> void
+TAO_Notify_Tests_Supplier_T<Supplier_Traits>::offer_change (CosNotification::EventTypeSeq &added, CosNotification::EventTypeSeq& removed ACE_ENV_ARG_DECL)
+{
+ // Let the user see what we're subscribed for,
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Calling Supplier offer change: \n"));
+
+ CORBA::ULong i = 0;
+
+ for (; i < added.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "+(%s,%s), ", added[i].domain_name.in (), added[i].type_name.in ()));
+ }
+ for (i = 0; i < removed.length (); ++i)
+ {
+ ACE_DEBUG ((LM_DEBUG, "-(%s,%s), ", removed[i].domain_name.in (), removed[i].type_name.in ()));
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+
+ /// subscribe
+ ACE_TYPENAME Proxy_Traits::PTR proxy_consumer = this->get_proxy ();
+
+ proxy_consumer->offer_change (added, removed ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+template <class Supplier_Traits> void
+TAO_Notify_Tests_Supplier_T<Supplier_Traits>::subscription_change (
+ const CosNotification::EventTypeSeq & /*added*/,
+ const CosNotification::EventTypeSeq & /*removed*/
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ))
+{
+ // No op.
+}
+#endif /* TAO_Notify_Tests_Supplier_T_CPP */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Supplier_T.h b/TAO/orbsvcs/tests/Notify/lib/Supplier_T.h
new file mode 100644
index 00000000000..54d2faba200
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Supplier_T.h
@@ -0,0 +1,99 @@
+/* -*- C++ -*- */
+/**
+ * @file Supplier_T.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_SUPPLIER_T_H
+#define TAO_Notify_Tests_SUPPLIER_T_H
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "Peer_T.h"
+
+class TAO_Notify_Tests_SupplierAdmin_Traits
+{
+ public:
+ typedef CosNotifyChannelAdmin::SupplierAdmin INTERFACE;
+ typedef CosNotifyChannelAdmin::SupplierAdmin_ptr PTR;
+ typedef CosNotifyChannelAdmin::SupplierAdmin_var VAR;
+};
+
+class TAO_Notify_Tests_SupplierAdmin_Ext_Traits
+{
+ public:
+ typedef NotifyExt::SupplierAdmin INTERFACE;
+ typedef NotifyExt::SupplierAdmin_ptr PTR;
+ typedef NotifyExt::SupplierAdmin_var VAR;
+};
+
+/**
+ * @class TAO_Notify_Tests_Supplier_T
+ *
+ * @brief Base template to implement Suppliers.
+ *
+ */
+template <class Supplier_Traits>
+class TAO_Notify_Tests_Supplier_T : public TAO_Notify_Tests_Peer_T <Supplier_Traits>
+{
+ typedef ACE_TYPENAME Supplier_Traits::Admin_Traits Admin_Traits;
+ typedef ACE_TYPENAME Supplier_Traits::Admin_Ext_Traits Admin_Ext_Traits;
+ typedef ACE_TYPENAME Supplier_Traits::Proxy_Traits Proxy_Traits;
+
+ typedef ACE_TYPENAME Proxy_Traits::INTERFACE Proxy_Traits_INTERFACE;
+ typedef ACE_TYPENAME Proxy_Traits::PTR Proxy_Traits_PTR;
+ typedef ACE_TYPENAME Admin_Traits::PTR Admin_Traits_PTR;
+ typedef ACE_TYPENAME Admin_Ext_Traits::PTR Admin_Ext_Traits_PTR;
+
+public:
+ /// Constuctor
+ TAO_Notify_Tests_Supplier_T (void);
+
+ /// Destructor
+ ~TAO_Notify_Tests_Supplier_T ();
+
+ /// For backward compatibility. use <get_proxy> instead.
+ Proxy_Traits_PTR get_proxy_consumer (void);
+
+ /// Send offer change.
+ void offer_change (CosNotification::EventTypeSeq &added, CosNotification::EventTypeSeq& removed ACE_ENV_ARG_DECL);
+
+protected:
+ /// Obtain Proxy.
+ virtual Proxy_Traits_PTR obtain_proxy (Admin_Traits_PTR admin_ptr ACE_ENV_ARG_DECL);
+
+ /// Obtain Proxy with QoS.
+ virtual Proxy_Traits_PTR obtain_proxy (Admin_Ext_Traits_PTR admin_ptr
+ , CosNotification::QoSProperties& qos
+ ACE_ENV_ARG_DECL);
+
+ // = NotifySubscribe
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosNotifyComm::InvalidEventType
+ ));
+};
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Supplier_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Supplier_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_SUPPLIER_T_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Callback.cpp b/TAO/orbsvcs/tests/Notify/lib/Task_Callback.cpp
new file mode 100644
index 00000000000..aa20cd8a7d3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Task_Callback.cpp
@@ -0,0 +1,7 @@
+//$Id$
+
+#include "Task_Callback.h"
+
+TAO_Notify_Tests_Task_Callback::~TAO_Notify_Tests_Task_Callback (void)
+{
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Callback.h b/TAO/orbsvcs/tests/Notify/lib/Task_Callback.h
new file mode 100644
index 00000000000..97caae326e0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Task_Callback.h
@@ -0,0 +1,40 @@
+/* -*- C++ -*- */
+/**
+ * @file Task_Callback.h
+ *
+ * $Id$
+ *
+ * @author Pradeep Gore <pradeep@oomworks.com>
+ *
+ *
+ */
+
+#ifndef TAO_Notify_Tests_TASK_CALLBACK_H
+#define TAO_Notify_Tests_TASK_CALLBACK_H
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_Notify_Tests_Periodic_Supplier;
+class TAO_Notify_Tests_Periodic_Consumer;
+
+/**
+ * @class TAO_Notify_Tests_Task_Callback
+ *
+ * @brief
+ *
+ */
+class TAO_NOTIFY_TEST_Export TAO_Notify_Tests_Task_Callback
+{
+public:
+ virtual ~TAO_Notify_Tests_Task_Callback (void);
+ virtual void done (TAO_Notify_Tests_Periodic_Supplier* supplier) = 0;
+ virtual void done (TAO_Notify_Tests_Periodic_Consumer* consumer) = 0;
+};
+
+#include /**/ "ace/post.h"
+#endif /* TAO_Notify_Tests_TASK_CALLBACK_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Stats.cpp b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.cpp
new file mode 100644
index 00000000000..3669f3987a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.cpp
@@ -0,0 +1,149 @@
+//$Id$
+
+#include "Task_Stats.h"
+#include "ace/OS.h"
+#include "ace/Log_Msg.h"
+
+#if !defined (__ACE_INLINE__)
+#include "Task_Stats.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_UINT32 Task_Stats::gsf_ = ACE_High_Res_Timer::global_scale_factor ();
+
+Base_Time::Base_Time (void)
+{
+ base_time_ = ACE_OS::gethrtime ();
+}
+
+Task_Stats::Task_Stats (void)
+ : base_time_(0),
+ end_time_ (0),
+ max_samples_ (0),
+ samples_count_ (0),
+ time_inv_ (0),
+ time_exec_ (0),
+ mean_ (0),
+ var_2_ (0)
+{
+}
+
+Task_Stats::~Task_Stats (void)
+{
+ delete[] this->time_inv_;
+ delete[] this->time_exec_;
+}
+
+int
+Task_Stats::init (size_t max_samples)
+{
+ this->max_samples_ = max_samples;
+
+ ACE_NEW_RETURN (this->time_inv_, ACE_UINT64[this->max_samples_], -1);
+ ACE_NEW_RETURN (this->time_exec_, ACE_UINT64[this->max_samples_], -1);
+ return 0;
+}
+
+void
+Task_Stats::base_time (ACE_UINT64 time)
+{
+ base_time_ = time;
+}
+
+void
+Task_Stats::end_time (ACE_UINT64 time)
+{
+ end_time_ = time;
+}
+
+void
+Task_Stats::dump_samples (const ACE_TCHAR *file_name, const ACE_TCHAR *msg, int dump_samples)
+{
+ FILE* output_file = ACE_OS::fopen (file_name, "w");
+
+ // first dump what the caller has to say.
+ ACE_OS::fprintf (output_file, "%s\n",msg);
+
+ // next, compose and dump what we want to say.
+
+ // calc throughput.
+ double seconds = this->diff_sec (base_time_, end_time_);
+
+ char out_msg[BUFSIZ];
+
+ if (seconds == 0 || samples_count_ == 0)
+ {
+ ACE_OS::sprintf (out_msg,
+ "# No samples recorded\n");
+ ACE_OS::fprintf (output_file, "%s",out_msg);
+ ACE_OS::fclose (output_file);
+
+ return;
+ }
+
+ double t_avg = samples_count_ / seconds;
+
+ ACE_OS::sprintf (out_msg,
+ "# Throughput: %.2f (events/second) [%u samples in %.2f seconds]\n",
+ t_avg, samples_count_, seconds);
+ ACE_OS::fprintf (output_file, "%s",out_msg);
+
+ // Calc the mean.
+ size_t i = 0;
+
+ for (i = 0; i != this->samples_count_; ++i)
+ {
+ ACE_UINT32 val_2 = Task_Stats::diff_usec (time_inv_[i], time_exec_[i]);
+
+ // Write the normalized value.
+ // we will need this to calculate the var^2
+ this->time_exec_[i] = val_2;
+
+ this->mean_ += val_2;
+ }
+
+ // calculate the mean.
+ this->mean_ /= this->samples_count_;
+
+ // Calculate the var^2
+
+ for (i = 0; i != this->samples_count_; ++i)
+ {
+ ACE_UINT64 diff = this->time_exec_[i] - this->mean_;
+
+ ACE_UINT64 diff_sq =
+#if defined ACE_LACKS_LONGLONG_T
+ diff * ACE_U64_TO_U32(diff);
+#else /* ! ACE_LACKS_LONGLONG_T */
+ diff * diff;
+#endif /* ! ACE_LACKS_LONGLONG_T */
+
+ this->var_2_ += diff_sq;
+ }
+
+ this->var_2_ /= this->samples_count_;
+
+ ACE_OS::fprintf (output_file, "## Latency: Avg = %u, Var^2 = %u\n"
+ , ACE_CU64_TO_CU32 (this->mean_)
+ , ACE_CU64_TO_CU32 (this->var_2_));
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, " Latency: Avg = %u, Var^2 = %u\n"
+ , ACE_CU64_TO_CU32 (this->mean_)
+ , ACE_CU64_TO_CU32 (this->var_2_)));
+
+ // if we are asked to, dump the samples recorded.
+ if (dump_samples)
+ {
+ ACE_OS::fprintf (output_file, "#Invocation time \t Execution time\n");
+
+ for (i = 0; i != this->samples_count_; ++i)
+ {
+ ACE_UINT32 val_1 = Task_Stats::diff_usec (base_time_, time_inv_[i]);
+
+ ACE_OS::fprintf (output_file, "%u \t %u\n",val_1,
+ ACE_CU64_TO_CU32 (time_exec_[i]));
+ }
+ }
+
+ ACE_OS::fclose (output_file);
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Stats.h b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.h
new file mode 100644
index 00000000000..cc4d7190887
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.h
@@ -0,0 +1,101 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Task_Stats.h
+ *
+ * $Id$
+ *
+ * Utility Stats class that maintains the readings.
+ *
+ * @author Pradeep Gore <pradeep@cs.wustl.edu>
+ */
+//=============================================================================
+#ifndef TASK_STATS_H
+#define TASK_STATS_H
+
+#include "ace/OS_NS_time.h"
+#include "ace/Singleton.h"
+#include "tao/orbconf.h"
+#include "tao/debug.h"
+#include "notify_test_export.h"
+
+/**
+ * @class Base_Time
+ *
+ * @brief maintains readings recorded by tasks.
+ *
+ */
+class TAO_NOTIFY_TEST_Export Base_Time
+{
+ public:
+ Base_Time (void);
+ ACE_hrtime_t base_time_;
+};
+
+typedef ACE_Singleton<Base_Time, TAO_SYNCH_MUTEX> BASE_TIME;
+
+/**
+ * @class Task_Stats
+ *
+ * @brief maintains readings recorded by tasks.
+ *
+ */
+class TAO_NOTIFY_TEST_Export Task_Stats
+{
+ public:
+ /// Constructor
+ Task_Stats (void);
+
+ /// Destructor
+ ~Task_Stats (void);
+
+ /// Useful Global Scale Factor
+ static ACE_UINT32 gsf_;
+
+ /// Init
+ int init (size_t max_samples);
+
+ /// Useful helper to calculate diff in sec.
+ static double diff_sec (ACE_UINT64 before, ACE_UINT64 after);
+
+ /// Useful helper to calculate diff in usec.
+ static ACE_UINT32 diff_usec (ACE_UINT64 before, ACE_UINT64 after);
+
+ /// Set the base time value.
+ void base_time (ACE_UINT64 time);
+
+ /// Set the end time value.
+ void end_time (ACE_UINT64 time);
+
+ /// Record a sample
+ int sample (ACE_UINT64 inv_start_time, ACE_UINT64 inv_end_time);
+
+ void dump_samples (const ACE_TCHAR *file_name, const ACE_TCHAR *msg, int dump_samples);
+
+ protected:
+ /// Base and end times
+ ACE_UINT64 base_time_;
+ ACE_UINT64 end_time_;
+
+ /// The maximum number of samples
+ ACE_UINT32 max_samples_;
+
+ /// The number of samples
+ ACE_UINT32 samples_count_;
+
+ /// The samples : the time of invocation. and the recorded exec. time .
+ ACE_UINT64 *time_inv_;
+ ACE_UINT64 *time_exec_;
+
+ /// The mean of the data set.
+ ACE_UINT64 mean_;
+
+ /// The Var^2 of the data set.
+ ACE_UINT64 var_2_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "Task_Stats.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TASK_STATS_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl
new file mode 100644
index 00000000000..aed41117a3d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/Task_Stats.inl
@@ -0,0 +1,54 @@
+//$Id$
+
+#include "ace/High_Res_Timer.h"
+#include "ace/Log_Msg.h"
+
+ACE_INLINE double
+Task_Stats::diff_sec (ACE_UINT64 before, ACE_UINT64 after)
+{
+ double seconds =
+#if defined ACE_LACKS_LONGLONG_T
+ (after - before) / gsf_;
+#else /* ! ACE_LACKS_LONGLONG_T */
+ static_cast<double> (ACE_UINT64_DBLCAST_ADAPTER((after - before) / gsf_));
+#endif /* ! ACE_LACKS_LONGLONG_T */
+ seconds /= ACE_HR_SCALE_CONVERSION;
+
+ return seconds;
+}
+
+ACE_INLINE ACE_UINT32
+Task_Stats::diff_usec (ACE_UINT64 before, ACE_UINT64 after)
+{
+ // convert to microseconds
+ #if !defined ACE_LACKS_LONGLONG_T
+ ACE_UINT32 elapsed_microseconds = ACE_UINT32((after - before) / gsf_);
+ #else /* ! ACE_LACKS_LONGLONG_T */
+
+ ACE_UINT32 elapsed_microseconds = (after - before) / gsf_;
+
+ #endif /* ! ACE_LACKS_LONGLONG_T */
+
+ #if defined (ACE_WIN32)
+ elapsed_microseconds*=1000; // convert to uSec on Win32
+ #endif /* ACE_WIN32 */
+
+ return elapsed_microseconds;
+}
+
+ACE_INLINE int
+Task_Stats::sample (ACE_UINT64 inv_start_time, ACE_UINT64 inv_end_time)
+{
+ if (this->samples_count_ >= this->max_samples_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Task_Stats::sample ret -1\n"));
+ return -1;
+ }
+
+ this->time_inv_[this->samples_count_] = inv_start_time;
+ this->time_exec_[this->samples_count_] = inv_end_time;
+
+ this->samples_count_++;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/common.cpp b/TAO/orbsvcs/tests/Notify/lib/common.cpp
new file mode 100644
index 00000000000..ff6f0bc6296
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/common.cpp
@@ -0,0 +1,56 @@
+// $Id$
+
+#include "common.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+
+const char*
+Any_String (const CORBA::Any& any)
+{
+ static char out[256] = "";
+ CORBA::Short s;
+ CORBA::UShort us;
+ CORBA::Long l;
+ CORBA::ULong ul;
+ CORBA::ULongLong ull;
+ const char* str;
+
+ if (any >>= s)
+ {
+ ACE_OS::sprintf (out, ACE_INT16_FORMAT_SPECIFIER, s);
+ }
+ else if (any >>= us)
+ {
+ ACE_OS::sprintf (out, ACE_UINT16_FORMAT_SPECIFIER, us);
+ }
+ else if (any >>= l)
+ {
+ ACE_OS::sprintf (out, ACE_INT32_FORMAT_SPECIFIER, l);
+ }
+ else if (any >>= ul)
+ {
+ ACE_OS::sprintf (out, ACE_UINT32_FORMAT_SPECIFIER, ul);
+ }
+ else if (any >>= str)
+ {
+ ACE_OS::strcpy (out, str);
+ }
+ else if (any >>= ull)
+ {
+#if defined (ACE_LACKS_LONGLONG_T)
+ ACE_OS::strcpy (out, ull.as_string (out));
+#else
+ ACE_OS::sprintf (out, ACE_UINT64_FORMAT_SPECIFIER, ull);
+#endif /* ACE_LACKS_LONGLONG_T */
+ }
+ else
+ {
+ ACE_OS::strcpy (out, "Unsupported Any Type");
+ }
+
+ return out;
+}
diff --git a/TAO/orbsvcs/tests/Notify/lib/common.h b/TAO/orbsvcs/tests/Notify/lib/common.h
new file mode 100644
index 00000000000..7704baa6a25
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/common.h
@@ -0,0 +1,36 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/lib
+//
+// = FILENAME
+// common.h
+//
+// = DESCRIPTION
+// A couple of useful functions
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_COMMON_H
+#define TAO_COMMON_H
+
+#include /**/ "ace/pre.h"
+
+#include "notify_test_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+
+
+TAO_NOTIFY_TEST_Export
+const char* Any_String (const CORBA::Any& any);
+
+#include /**/ "ace/post.h"
+#endif /* TAO_COMMON_H */
diff --git a/TAO/orbsvcs/tests/Notify/lib/notify_test_export.h b/TAO/orbsvcs/tests/Notify/lib/notify_test_export.h
new file mode 100644
index 00000000000..867568dfe87
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/lib/notify_test_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_NOTIFY_TEST_EXPORT_H
+#define TAO_NOTIFY_TEST_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_NOTIFY_TEST_HAS_DLL)
+# define TAO_NOTIFY_TEST_HAS_DLL 0
+# endif /* ! TAO_NOTIFY_TEST_HAS_DLL */
+#else
+# if !defined (TAO_NOTIFY_TEST_HAS_DLL)
+# define TAO_NOTIFY_TEST_HAS_DLL 1
+# endif /* ! TAO_NOTIFY_TEST_HAS_DLL */
+#endif
+
+#if defined (TAO_NOTIFY_TEST_HAS_DLL) && (TAO_NOTIFY_TEST_HAS_DLL == 1)
+# if defined (TAO_NOTIFY_TEST_BUILD_DLL)
+# define TAO_NOTIFY_TEST_Export ACE_Proper_Export_Flag
+# define TAO_NOTIFY_TEST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_NOTIFY_TEST_BUILD_DLL */
+# define TAO_NOTIFY_TEST_Export ACE_Proper_Import_Flag
+# define TAO_NOTIFY_TEST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_NOTIFY_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_NOTIFY_TEST_BUILD_DLL */
+#else /* TAO_NOTIFY_TEST_HAS_DLL == 1 */
+# define TAO_NOTIFY_TEST_Export
+# define TAO_NOTIFY_TEST_SINGLETON_DECLARATION(T)
+# define TAO_NOTIFY_TEST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_NOTIFY_TEST_HAS_DLL == 1 */
+
+#endif /* TAO_NOTIFY_TEST_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Filter.mpc b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Filter.mpc
new file mode 100644
index 00000000000..f2020bde1d3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Filter.mpc
@@ -0,0 +1,57 @@
+// $Id$
+
+project(*idl): taoidldefaults, minimum_corba {
+ IDL_Files {
+ go.idl
+ }
+ custom_only = 1
+}
+
+project(*Ntf Perf Struct Supp): notifytest, minimum_corba {
+ after += *idl
+ exename = Structured_Supplier
+ Source_Files {
+ Structured_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Perf Struct Cons): notifytest, minimum_corba {
+ after += *idl
+ exename = Structured_Consumer
+ Source_Files {
+ goC.cpp
+ Notify_Structured_Push_Consumer.cpp
+ Structured_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*Ntf Perf Seq Supp): notifytest, minimum_corba {
+ after += *idl
+ exename = Sequence_Supplier
+ Source_Files {
+ Sequence_Supplier.cpp
+ goS.cpp
+ goC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*notify perf Sequence Consumer): notifytest, minimum_corba {
+ after += *idl
+ exename = Sequence_Consumer
+ Source_Files {
+ goC.cpp
+ Notify_Sequence_Push_Consumer.cpp
+ Sequence_Consumer.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Makefile.am b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Makefile.am
new file mode 100644
index 00000000000..4718b9c9c15
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Makefile.am
@@ -0,0 +1,258 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Filter_Idl.am
+
+if !BUILD_MINIMUM_CORBA
+
+BUILT_SOURCES = \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+CLEANFILES = \
+ go-stamp \
+ goC.cpp \
+ goC.h \
+ goC.inl \
+ goS.cpp \
+ goS.h \
+ goS.inl
+
+goC.cpp goC.h goC.inl goS.cpp goS.h goS.inl: go-stamp
+
+go-stamp: $(srcdir)/go.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/go.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ go.idl
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.Filter_Notify_Perf_Sequence_Consumer.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Consumer
+
+Sequence_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Consumer_SOURCES = \
+ Notify_Sequence_Push_Consumer.cpp \
+ Sequence_Consumer.cpp \
+ goC.cpp \
+ Notify_Sequence_Push_Consumer.h
+
+Sequence_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Filter_Ntf_Perf_Seq_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Sequence_Supplier
+
+Sequence_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Sequence_Supplier_SOURCES = \
+ Sequence_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h \
+ Notify_Structured_Push_Consumer.h
+
+Sequence_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Filter_Ntf_Perf_Struct_Cons.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Consumer
+
+Structured_Consumer_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Consumer_SOURCES = \
+ Notify_Structured_Push_Consumer.cpp \
+ Structured_Consumer.cpp \
+ goC.cpp \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Consumer_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Filter_Ntf_Perf_Struct_Supp.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += Structured_Supplier
+
+Structured_Supplier_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Structured_Supplier_SOURCES = \
+ Structured_Supplier.cpp \
+ goC.cpp \
+ goS.cpp \
+ Notify_Sequence_Push_Consumer.h \
+ Notify_Structured_Push_Consumer.h
+
+Structured_Supplier_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp
new file mode 100644
index 00000000000..4abebdab3f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.cpp
@@ -0,0 +1,92 @@
+// $Id$
+
+#include "Notify_Sequence_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "common.h"
+
+#include "ace/OS_NS_sys_time.h"
+
+Notify_Sequence_Push_Consumer::Notify_Sequence_Push_Consumer (
+ const char* name,
+ unsigned int expected,
+ Notify_Test_Client& client)
+ : name_ (name),
+ expected_ (expected),
+ count_ (0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+Notify_Sequence_Push_Consumer::~Notify_Sequence_Push_Consumer ()
+{
+}
+
+void
+Notify_Sequence_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::SequencePushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::SEQUENCE_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::SequenceProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotification::QoSProperties properties(1);
+ properties.length(1);
+ properties[0].name = CORBA::string_dup(CosNotification::MaximumBatchSize);
+ properties[0].value <<= (CORBA::Long)10;
+
+ proxy_->set_qos(properties);
+ proxy_->connect_sequence_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // give ownership to POA
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Sequence_Push_Consumer::push_structured_events(
+ const CosNotification::EventBatch& events
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if ( this->count_ == 0 )
+ {
+ this->first_ = ACE_OS::gettimeofday();
+ }
+
+ this->count_ += events.length();
+
+ if (this->count_ > this->expected_)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("\nError: Expected %d events. Received %d\n"), expected_, count_));
+ this->client_.consumer_done (this);
+ return;
+ }
+
+ if (this->count_ >= this->expected_)
+ {
+ this->client_.consumer_done (this);
+ ACE_Time_Value totaltime = ( ACE_OS::gettimeofday() - this->first_ );
+ double events_per_ms = static_cast<double>(this->count_) /
+ static_cast<double>(totaltime.msec());
+ ACE_DEBUG((LM_DEBUG, "\nConsumer %s received %d at %.2f events/ms\n", name_.c_str(), this->count_, events_per_ms ));
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h
new file mode 100644
index 00000000000..ccd5af92252
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Sequence_Push_Consumer.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Sequence_Push_Consumer.h
+//
+// = DESCRIPTION
+// A sequence push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+#define TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H
+
+#include "Notify_SequencePushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Sequence_Push_Consumer : public TAO_Notify_Tests_SequencePushConsumer
+{
+public:
+ Notify_Sequence_Push_Consumer (const char* name,
+ unsigned int expected,
+ Notify_Test_Client& client);
+
+ ~Notify_Sequence_Push_Consumer ();
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void push_structured_events(const CosNotification::EventBatch&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ unsigned int expected_;
+ unsigned int count_;
+ Notify_Test_Client& client_;
+ ACE_Time_Value first_;
+};
+
+#endif /* TAO_NOTIFY_SEQUENCE_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp
new file mode 100644
index 00000000000..271bf5fbeeb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.cpp
@@ -0,0 +1,86 @@
+// $Id$
+
+#include "Notify_Structured_Push_Consumer.h"
+#include "Notify_Test_Client.h"
+#include "common.h"
+
+#include "ace/OS_NS_sys_time.h"
+
+Notify_Structured_Push_Consumer::Notify_Structured_Push_Consumer (
+ const char* name,
+ unsigned int expected,
+ Notify_Test_Client& client)
+ : name_ (name),
+ expected_ (expected),
+ count_ (0),
+ client_ (client)
+{
+ this->client_.consumer_start (this);
+}
+
+
+Notify_Structured_Push_Consumer::~Notify_Structured_Push_Consumer ()
+{
+}
+
+
+void
+Notify_Structured_Push_Consumer::_connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_id_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->proxy_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow (
+ proxysupplier.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ proxy_->connect_structured_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+void
+Notify_Structured_Push_Consumer::push_structured_event(
+ const CosNotification::StructuredEvent& /*event*/
+ ACE_ENV_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if ( this->count_ == 0 )
+ {
+ this->first_ = ACE_OS::gettimeofday();
+ }
+
+ if (this->count_ == this->expected_)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("ERROR: too many events received.\n")));
+ }
+
+ //ACE_DEBUG((LM_DEBUG, "-"));
+
+ this->count_++;
+
+ if (this->count_ == this->expected_)
+ {
+ this->client_.consumer_done (this);
+ ACE_Time_Value totaltime = ( ACE_OS::gettimeofday() - this->first_ );
+ double events_per_ms = static_cast<double>(this->count_) /
+ static_cast<double>(totaltime.msec());
+ ACE_DEBUG((LM_DEBUG, "Consumer %s received %d at %.2f events/ms\n", name_.c_str(), this->count_, events_per_ms ));
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h
new file mode 100644
index 00000000000..cd34305133d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Notify_Structured_Push_Consumer.h
@@ -0,0 +1,50 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Notify/Discarding
+//
+// = FILENAME
+// Notify_Structured_Push_Consumer.h
+//
+// = DESCRIPTION
+// A structured push consumer implementation.
+//
+// = AUTHOR
+// Chad Elliott <elliott_c@ociweb.com>
+//
+// ==========================================================================
+#ifndef TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+#define TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H
+
+#include "Notify_StructuredPushConsumer.h"
+
+class Notify_Test_Client;
+
+class Notify_Structured_Push_Consumer : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Notify_Structured_Push_Consumer (
+ const char* name,
+ unsigned int expected,
+ Notify_Test_Client& client);
+ ~Notify_Structured_Push_Consumer ();
+
+ void _connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ void push_structured_event(const CosNotification::StructuredEvent&
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ACE_CString name_;
+ unsigned int expected_;
+ unsigned int count_;
+ Notify_Test_Client& client_;
+ ACE_Time_Value first_;
+};
+
+#endif /* TAO_NOTIFY_STRUCTURED_PUSH_CONSUMER_H */
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/README b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/README
new file mode 100644
index 00000000000..0d326588015
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/README
@@ -0,0 +1,34 @@
+Notification Performance Test
+================================
+
+Description
+-----------
+
+Usage
+-----
+
+The test consists of a Structured_Supplier and Structured_Consumer as well
+as a Sequence_Supplier and Sequence_Consumer. The usage for each as is
+follows:
+
+$ Structured_Supplier -\?
+usage: Structured_Supplier -o <iorfile> -e <# of events>
+
+$ Structured_Consumer -\?
+usage: Structured_Consumer -k <ior> -c <# of consumers> -e <expected events>
+ -f
+
+$ Sequence_Supplier -\?
+usage: Sequence_Supplier -o <iorfile> -e <# of events>
+
+$ Sequence_Consumer -\?
+usage: Sequence_Consumer -k <ior> -c <# of consumers> -e <expected events> -f
+
+
+To run this test, just run the run_test.pl perl script. It will run both
+structured and sequence tests with each of the implemented discard policies.
+
+
+Expected Results
+----------------
+This varies between hardware.
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp
new file mode 100644
index 00000000000..8d284b588a5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Consumer.cpp
@@ -0,0 +1,225 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_Sequence_Push_Consumer.h"
+#include "goC.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_sys_time.h"
+
+#include "Notify_Test_Client.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static const char* ior = "file://supplier.ior";
+static CORBA::Boolean filter = 0;
+static unsigned int consumers = 2;
+static unsigned int batch_size = 10;
+static unsigned int expected = 100; // 100 sets of 10
+
+#define GRAMMAR "TCL"
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:c:e:f");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'c':
+ consumers = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'e':
+ expected = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'f':
+ filter = 1;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-c <# of consumers> "
+ "-e <expected events> "
+ "-f "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ if (filter)
+ {
+ ACE_DEBUG((LM_DEBUG, "\nConsumer filter enabled.\n"));
+
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr =
+ CORBA::string_dup ("type == 'even'");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ for(unsigned int i = 0; i < consumers; i++)
+ {
+ // startup the first consumer
+ char name[64] = "";
+ ACE_OS::sprintf(name, "consumer%u", i);
+ Notify_Sequence_Push_Consumer* consumer;
+ ACE_NEW_THROW_EX (consumer,
+ Notify_Sequence_Push_Consumer (
+ name,
+ expected * batch_size,
+ *client),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ // If we are filtering, we will get half as many as originally
+ // expected
+ if (filter)
+ {
+ expected /= 2;
+ }
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (sig.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_consumers(admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell the supplier to go
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp
new file mode 100644
index 00000000000..7b7df800ca5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Sequence_Supplier.cpp
@@ -0,0 +1,263 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_SequencePushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static TAO_Notify_Tests_SequencePushSupplier* supplier_1 = 0;
+static int max_events = 100; // 100 sets of 10
+static const CORBA::ULong amount = 10;
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'e':
+ max_events = ACE_OS::atoi(get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvents (int id ACE_ENV_ARG_DECL)
+{
+ ACE_UNUSED_ARG(id);
+ CosNotification::EventBatch events (amount);
+
+ events.length (amount);
+
+ for(CORBA::ULong z = 0; z < amount; z++)
+ {
+ const char* type = ( (z & 1) == 1 ? "odd" : "even" );
+ events[z].header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("Orbix 2000 Demos");
+ events[z].header.fixed_header.event_type.type_name =
+ CORBA::string_dup("Sequence Notification Push Demo Event");
+
+ events[z].header.fixed_header.event_name = CORBA::string_dup("test event");
+
+ events[z].filterable_data.length (1);
+ events[z].filterable_data[0].name = CORBA::string_dup("type");
+ events[z].filterable_data[0].value <<= type;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ supplier_1->send_events(events ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ }
+ ACE_ENDTRY;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ // startup the first supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_SequencePushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, " 1 supplier sending %d events...\n", (max_events*amount)));
+ for (int i = 0; i < max_events; ++i)
+ {
+ SendEvents (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", (max_events*amount)));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp
new file mode 100644
index 00000000000..a45be86190f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Consumer.cpp
@@ -0,0 +1,223 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_Structured_Push_Consumer.h"
+#include "goC.h"
+#include "tao/debug.h"
+#include "Notify_Test_Client.h"
+#include "ace/OS_NS_sys_time.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static const char* ior = "file://supplier.ior";
+static CORBA::Boolean filter = 0;
+static unsigned int consumers = 2;
+static unsigned int expected = 1000;
+
+#define GRAMMAR "TCL"
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+
+class Consumer_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Consumer_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:e:c:f");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+
+ case 'c':
+ consumers = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'e':
+ expected = ACE_OS::atoi (get_opts.optarg);
+ break;
+
+ case 'f':
+ filter = 1;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-c <# of consumers> "
+ "-e <expected events> "
+ "-f "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::ConsumerAdmin_ptr
+create_consumeradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ ec->new_for_consumers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ if (filter)
+ {
+ // Filter Section
+ CosNotifyFilter::FilterFactory_var ffact =
+ ec->default_filter_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // One Filter
+ CosNotifyFilter::Filter_var filter =
+ ffact->create_filter (GRAMMAR ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ CosNotifyFilter::ConstraintExpSeq constraint_list (1);
+ constraint_list.length (1);
+
+ constraint_list[0].event_types.length (0);
+ constraint_list[0].constraint_expr =
+ CORBA::string_dup ("type == 'even'");
+
+ filter->add_constraints (constraint_list ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ admin->add_filter (filter.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ // End One Filter
+ }
+
+ return CosNotifyChannelAdmin::ConsumerAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+create_consumers (CosNotifyChannelAdmin::ConsumerAdmin_ptr admin,
+ Notify_Test_Client* client
+ ACE_ENV_ARG_DECL)
+{
+ for(unsigned int i = 0; i < consumers; i++)
+ {
+ // startup the first consumer
+ char name[64] = "";
+ ACE_OS::sprintf(name, "consumer%u", i);
+ Notify_Structured_Push_Consumer* consumer;
+ ACE_NEW_THROW_EX (consumer,
+ Notify_Structured_Push_Consumer (
+ name,
+ expected,
+ *client),
+ CORBA::NO_MEMORY ());
+
+ consumer->init (client->root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ consumer->_connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Consumer_Client client;
+
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ // If we are filtering, we will get half as many as originally
+ // expected
+ if (filter)
+ {
+ expected /= 2;
+ }
+
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_var sig = sig::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (sig.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var admin =
+ create_consumeradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_consumers(admin.in (), &client ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Tell the supplier to go
+ sig->go (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.ORB_run( ACE_ENV_SINGLE_ARG_PARAMETER );
+ ACE_TRY_CHECK;
+ ACE_DEBUG((LM_DEBUG, "Consumer done.\n"));
+
+ sig->done (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Consumer exception: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp
new file mode 100644
index 00000000000..f89028a58c1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/Structured_Supplier.cpp
@@ -0,0 +1,257 @@
+// $Id$
+
+// ******************************************************************
+// Include Section
+// ******************************************************************
+
+#include "ace/Get_Opt.h"
+#include "ace/Auto_Ptr.h"
+
+#include "tao/ORB_Core.h"
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "Notify_StructuredPushSupplier.h"
+#include "goS.h"
+
+#include "Notify_Test_Client.h"
+
+#include "ace/OS_NS_unistd.h"
+
+// ******************************************************************
+// Data Section
+// ******************************************************************
+
+static TAO_Notify_Tests_StructuredPushSupplier* supplier_1 = 0;
+static int max_events = 1000;
+static const char* ior_output_file = "supplier.ior";
+
+// ******************************************************************
+// Subroutine Section
+// ******************************************************************
+class sig_i : public POA_sig
+{
+public:
+ sig_i(CORBA::ORB_ptr orb)
+ : orb_(orb)
+ , started_(false)
+ {
+ }
+
+ void go (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = true;
+ }
+
+ void done (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ {
+ started_ = false;
+ }
+
+ void wait_for_startup()
+ {
+ while (! started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+ void wait_for_completion()
+ {
+ while (started_) {
+ ACE_Time_Value tv(0, 100 * 1000); // 100ms
+ orb_->run(tv);
+ }
+ }
+
+private:
+ CORBA::ORB_ptr orb_;
+ bool started_;
+};
+
+
+class Supplier_Client : public Notify_Test_Client
+{
+public:
+ virtual int parse_args (int argc, char* argv[]);
+};
+
+
+int
+Supplier_Client::parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'e':
+ max_events = ACE_OS::atoi(get_opts.optarg);
+ break;
+
+ case 'o':
+ ior_output_file = get_opts.optarg;
+ break;
+
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> -e <# of events>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+static CosNotifyChannelAdmin::SupplierAdmin_ptr
+create_supplieradmin (CosNotifyChannelAdmin::EventChannel_ptr ec
+ ACE_ENV_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid = 0;
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ ec->new_for_suppliers (CosNotifyChannelAdmin::AND_OP,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (0);
+
+ return CosNotifyChannelAdmin::SupplierAdmin::_duplicate (admin.in ());
+}
+
+
+static void
+SendEvent (int id ACE_ENV_ARG_DECL_NOT_USED)
+{
+ const char* type = ( (id & 1) == 1 ? "odd" : "even" );
+ CosNotification::StructuredEvent event;
+
+ event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup("Orbix 2000 Demos");
+ event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup("Sequence Notification Push Demo Event");
+
+ event.header.fixed_header.event_name = CORBA::string_dup("test event");
+
+
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("type");
+ event.filterable_data[0].value <<= type;
+
+ ACE_TRY_NEW_ENV
+ {
+ supplier_1->send_event(event ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ }
+ ACE_ENDTRY;
+}
+
+static void
+create_suppliers (CosNotifyChannelAdmin::SupplierAdmin_ptr admin,
+ PortableServer::POA_ptr poa
+ ACE_ENV_ARG_DECL)
+{
+ // startup the first supplier
+ ACE_NEW_THROW_EX (supplier_1,
+ TAO_Notify_Tests_StructuredPushSupplier (),
+ CORBA::NO_MEMORY ());
+
+ supplier_1->init (poa ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ supplier_1->connect (admin ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
+// ******************************************************************
+// Main Section
+// ******************************************************************
+
+int main (int argc, char* argv[])
+{
+ ACE_Auto_Ptr< sig_i > sig_impl;
+ int status = 0;
+ ACE_TRY_NEW_ENV
+ {
+ Supplier_Client client;
+ status = client.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (status == 0)
+ {
+ CosNotifyChannelAdmin::EventChannel_var ec =
+ client.create_event_channel ("MyEventChannel", 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_ptr orb = client.orb ();
+
+ sig_impl.reset( new sig_i( orb ) );
+ sig_var sig = sig_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (sig.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for "
+ "writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ CosNotifyChannelAdmin::SupplierAdmin_var admin =
+ create_supplieradmin (ec.in () ACE_ENV_ARG_PARAMETER);
+ if (!CORBA::is_nil (admin.in ()))
+ {
+ create_suppliers(admin.in (), client.root_poa () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ sig_impl->wait_for_startup();
+
+ ACE_DEBUG((LM_DEBUG, "1 supplier sending %d events...\n", max_events));
+ for (int i = 0; i < max_events; ++i)
+ {
+ SendEvent (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG((LM_DEBUG, "\nSupplier sent %d events.\n", max_events));
+
+ sig_impl->wait_for_completion();
+
+ ACE_OS::unlink (ior_output_file);
+
+ ec->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCH (CORBA::Exception, e)
+ {
+ ACE_PRINT_EXCEPTION (e, "Error: Supplier exception: ");
+ status = 1;
+ }
+ ACE_ENDTRY;
+
+ return status;
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl
new file mode 100644
index 00000000000..e24bfd036c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/go.idl
@@ -0,0 +1,10 @@
+// $Id$
+
+interface sig
+{
+ // Tell the server to start
+ oneway void go ();
+
+ // Tell the server the consumer is done
+ oneway void done ();
+};
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf
new file mode 100644
index 00000000000..93af5f9d812
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf
@@ -0,0 +1,6 @@
+## $Id$
+#
+## Load the static Cos Notification Service
+static Notify_Default_Event_Manager_Objects_Factory "-DispatchingThreads 1"
+
+
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml
new file mode 100644
index 00000000000..f398f140957
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/notify.conf.xml
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/performance-tests/Filter/notify.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- # $Id$ -->
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl
new file mode 100755
index 00000000000..7d1e4ff85a7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl
@@ -0,0 +1,211 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../bin";
+use PerlACE::Run_Test;
+
+$ior = PerlACE::LocalFile ("supplier.ior");
+$namingior = PerlACE::LocalFile ("naming.ior");
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
+$status = 0;
+
+$port = PerlACE::uniqueid () + 10001;
+$NS = new PerlACE::Process ("../../../../Naming_Service/Naming_Service",
+ "-ORBEndpoint iiop://localhost:$port " .
+ "-o $namingior");
+$TS = new PerlACE::Process ("../../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService " .
+ "-IORoutput $notifyior -ORBSvcConf " .
+ "$notify_conf");
+$STS = new PerlACE::Process ("Structured_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$STC = new PerlACE::Process ("Structured_Consumer");
+
+$SES = new PerlACE::Process ("Sequence_Supplier",
+ "-ORBInitRef NameService=iioploc://" .
+ "localhost:$port/NameService");
+$SEC = new PerlACE::Process ("Sequence_Consumer");
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+$client_args = "-ORBInitRef NameService=iioploc://localhost:" .
+ "$port/NameService";
+
+$NS->Spawn ();
+if (PerlACE::waitforfile_timed ($namingior, 20) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Spawn ();
+if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+######################################################################
+print "**** Structured Supplier -> 2 Structured Consumers ****\n";
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$STC->Arguments($client_args);
+print $STC->CommandLine ()."\n";
+$client = $STC->SpawnWaitKill (300);
+print "\n";
+if ($client != 0) {
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+
+######################################################################
+print "**** Structured Supplier -> Structured Consumer (filtered) ****\n";
+
+unlink $ior;
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$STC->Arguments($client_args . " -f -c 1");
+$client = $STC->SpawnWaitKill (60);
+print "\n";
+if ($client != 0) {
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+######################################################################
+print "**** Structured Supplier -> Sequence Consumer (filtered) ****\n";
+
+unlink $ior;
+$STS->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$SEC->Arguments($client_args . " -f -c 1");
+$client = $SEC->SpawnWaitKill (60);
+print "\n";
+if ($client != 0) {
+ $STS->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $STS->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+######################################################################
+print "**** Sequence Supplier -> 2 Sequence Consumers ****\n";
+
+unlink $ior;
+$SES->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$SEC->Arguments($client_args);
+$client = $SEC->SpawnWaitKill (60);
+print "\n";
+if ($client != 0) {
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $SES->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+######################################################################
+print "**** Sequence Supplier -> Sequence Consumer (filtered) ****\n";
+
+unlink $ior;
+$SES->Spawn ();
+if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$SEC->Arguments($client_args . " -f -c 1");
+$client = $SEC->SpawnWaitKill (60);
+print "\n";
+if ($client != 0) {
+ $SES->Kill ();
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+$server = $SES->WaitKill(5);
+if ($server != 0) {
+ $TS->Kill ();
+ $NS->Kill ();
+ exit 1;
+}
+
+$TS->Kill ();
+$NS->Kill ();
+
+unlink $ior;
+unlink $notifyior;
+unlink $namingior;
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Makefile.am b/TAO/orbsvcs/tests/Notify/performance-tests/Makefile.am
new file mode 100644
index 00000000000..de02210c1a5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Makefile.am
@@ -0,0 +1,15 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ Filter \
+ RedGreen \
+ Throughput
+
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/Makefile.am b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/Makefile.am
new file mode 100644
index 00000000000..56b72ea0e04
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/Makefile.am
@@ -0,0 +1,71 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.RedGreen_Ntf_Perf_RedGreen.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = RedGreen_Test
+
+RedGreen_Test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+RedGreen_Test_SOURCES = \
+ RedGreen_Test.cpp \
+ main.cpp \
+ RedGreen_Test.h
+
+RedGreen_Test_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/README b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/README
new file mode 100644
index 00000000000..88b6a01e03c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/README
@@ -0,0 +1,65 @@
+RedGreen Test
+
+This test will measure throughput in different configurations of the
+Notify Service.
+
+DESCRIPTION
+-----------
+The Test creates an Event Channel, one consumer admin and supplier
+admin.
+
+It connects 2 types of consumers to the consumer admin:
+A "slow" consumer that has a 1 sec "wait" in its "push" implementation
+and a "normal" consumer that returns immediately without any intensive
+processing in its "push".
+
+A supplier pushes 2 types of events to the channel. A "RED" event and
+a ""GREEN" event in a burst of RED and GREEN events alternatively.
+
+The subscriptions are specified in such a manner that the "slow"
+consumer only receives RED events while the "normal" consumer receives
+the "GREEN" events,
+
+We use a TP reactor with 4 worker threads to allow upcalls to the
+normal consumers servant proceed without having to wait for the slow
+consumer to finish. The default ORB configuration is reactive.
+
+First Run the Notify Service in the reactive mode.
+Each participant in this (supplier and both consumers) are coupled
+together because all calls are sychronous. The 1 sec wait should affect
+throughput of all 3.
+
+Next use 2 Lookup thread and check performance. The throughput
+values should increase for the supplier and normal consumer but same
+for the slow consumer.
+
+Lastly, deploy a thread each at each proxy supplier. The Throughput
+of the normal consumer should increase dramatically.
+This is because its data path is completely decoupled from the "slow consumer".
+
+COMMAND LINE OPTIONS:
+--------------------
+"-burst_size [size]"
+
+RUNNING THE TEST:
+-----------------
+
+Test 1
+------
+
+run $TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -ORBsvcconf reactive.conf
+run RedGreen_Test
+
+
+Test 2
+------
+
+run $TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -Notify_TPReactor 2 -ORBsvcconf lookup.conf
+run RedGreen_Test
+
+
+Test 3
+------
+
+run $TAO_ROOT/orbsvcs/Notify_Service/Notify_Service -Notify_TPReactor 2 -ORBsvcconf listener.conf
+run RedGreen_Test
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen.mpc b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen.mpc
new file mode 100644
index 00000000000..619fd2e21b9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Ntf Perf RedGreen): notifytest {
+ exename = RedGreen_Test
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.cpp
new file mode 100644
index 00000000000..b68b1bcbed4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.cpp
@@ -0,0 +1,772 @@
+// -*- C++ -*- $Id$
+
+#include "RedGreen_Test.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_unistd.h"
+#include "orbsvcs/Time_Utilities.h"
+#include "tao/debug.h"
+
+ACE_RCSID (Notify,
+ RedGreen_Test,
+ "$Id$")
+
+#define NOTIFY_FACTORY_NAME "NotifyEventChannelFactory"
+#define NAMING_SERVICE_NAME "NameService"
+
+#define DOMAIN_GREEN "DOMAIN_GREEN"
+#define DOMAIN_RED "DOMAIN_RED"
+
+#define TYPE_GREEN "TYPE_GREEN"
+#define TYPE_RED "TYPE_RED"
+
+ACE_Atomic_Op <TAO_SYNCH_MUTEX, int> g_result_count = 0;
+ACE_hrtime_t g_throughput_start_;
+
+static bool consumer_is_done = false;
+
+int
+RedGreen_Test::parse_args (int argc,
+ char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ const char *current_arg = 0;
+
+ while (arg_shifter.is_anything_left ())
+ {
+ if ((current_arg = arg_shifter.get_the_parameter ("-burst_size")))
+ {
+ this->burst_size_ = ACE_OS::atoi (current_arg);
+ ACE_DEBUG ((LM_DEBUG,
+ "Burst size = %d\n",
+ burst_size_));
+ // The number of events to send/receive.
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s "
+ "-burst_size [count]\n",
+ argv[0],
+ argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+
+ return 0;
+}
+
+RedGreen_Test::RedGreen_Test (void)
+ : burst_size_ (10),
+ nthreads_ (2)
+{
+ // No-Op.
+ ifgop_ = CosNotifyChannelAdmin::OR_OP;
+}
+
+void
+RedGreen_Test::destroy_ec ()
+{
+ if (!CORBA::is_nil (ec_.in ()))
+ {
+ // Even though we still have a reference, there's no guarantee
+ // the EC is still around. So, trap exceptions.
+ ACE_TRY_NEW_ENV
+ {
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, ex)
+ {
+ // Silently swallow this b/c this could mean the EC is gone
+ // or that the network is hosed. Either way, we're not waiting
+ // around to figure out the problem. Report the incident to the
+ // log and be done with it.
+ ACE_DEBUG ((LM_INFO,
+ "INFO: Got a COMM_FAILURE exception while trying to \n"
+ " invoke `destroy()' on the Event Channel in the \n"
+ " RedGreen destroy_ec. This is likely not a problem.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "in RedGreen destructor; swallowing.\n");
+ }
+ ACE_ENDTRY;
+
+ this->ec_ = CosNotifyChannelAdmin::EventChannel::_nil ();
+ }
+}
+
+
+void
+RedGreen_Test::init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL)
+{
+ this->init_ORB (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->resolve_Notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->create_supplieradmin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->create_consumeradmin (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->create_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->create_suppliers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->send_events (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ while (! consumer_is_done)
+ {
+ ACE_Time_Value tv(0, 10 * 1000);
+ this->orb_->run(tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "Supplier:");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ worker_.thr_mgr ()->wait ();
+}
+
+void
+RedGreen_Test::done (void)
+{
+ dump_results ();
+ worker_.done ();
+}
+
+void
+RedGreen_Test::init_ORB (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL)
+{
+ this->orb_ = CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::Object_ptr poa_object =
+ this->orb_->resolve_initial_references("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (poa_object))
+ {
+ ACE_ERROR ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"));
+ return;
+ }
+ this->root_poa_ =
+ PortableServer::POA::_narrow (poa_object
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ worker_.orb (this->orb_.in ());
+
+ if (worker_.activate (THR_NEW_LWP | THR_JOINABLE,
+ this->nthreads_) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot activate client threads\n"));
+ }
+}
+
+void
+RedGreen_Test::resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Object_var naming_obj =
+ this->orb_->resolve_initial_references (NAMING_SERVICE_NAME
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Need to check return value for errors.
+ if (CORBA::is_nil (naming_obj.in ()))
+ {
+ ACE_THROW (CORBA::UNKNOWN ());
+ }
+
+ this->naming_context_ =
+ CosNaming::NamingContext::_narrow (naming_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test::resolve_Notify_factory (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (NOTIFY_FACTORY_NAME);
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->notify_factory_ =
+ CosNotifyChannelAdmin::EventChannelFactory::_narrow (
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::ChannelID id;
+
+ this->ec_ = notify_factory_->create_channel (this->initial_qos_,
+ this->initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+}
+
+void
+RedGreen_Test::create_supplieradmin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ supplier_admin_ =
+ ec_->new_for_suppliers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+}
+
+void
+RedGreen_Test::create_consumeradmin (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ consumer_admin_ =
+ ec_->new_for_consumers (this->ifgop_,
+ adminid
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+}
+
+void
+RedGreen_Test::create_consumers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_NEW (this->normal_consumer_,
+ RedGreen_Test_StructuredPushConsumer (this));
+ this->normal_consumer_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_NEW (this->slow_consumer_,
+ SlowConsumer (this));
+ this->slow_consumer_->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test::create_suppliers (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_NEW (this->supplier_,
+ RedGreen_Test_StructuredPushSupplier ());
+ this->supplier_->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test::send_events (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Setup the Consumer 1 to receive
+ //event_type : "DOMAIN_GREEN", "DOMAIN_GREEN".
+ CosNotification::EventTypeSeq added_1(1);
+ CosNotification::EventTypeSeq removed_1 (0);
+
+ added_1[0].domain_name = CORBA::string_dup (DOMAIN_GREEN);
+ added_1[0].type_name = CORBA::string_dup (TYPE_GREEN);
+ added_1.length (1);
+ removed_1.length (0);
+
+ this->normal_consumer_->get_proxy_supplier ()->subscription_change (
+ added_1,
+ removed_1
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ // Setup the Consumer 2 to receive event_type : "DOMAIN_RED", "TYPE_RED"
+ CosNotification::EventTypeSeq added_2(1);
+ CosNotification::EventTypeSeq removed_2 (0);
+
+ added_2[0].domain_name = CORBA::string_dup (DOMAIN_RED);
+ added_2[0].type_name = CORBA::string_dup (TYPE_RED);
+ added_2.length (1);
+ removed_2.length (0);
+
+ this->slow_consumer_->get_proxy_supplier ()->subscription_change (
+ added_2,
+ removed_2
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ // Create the events - one of each type
+
+ // Event 2
+ CosNotification::StructuredEvent green_event;
+ green_event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup(DOMAIN_GREEN);
+ green_event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup(TYPE_GREEN);
+ green_event.header.fixed_header.event_name = CORBA::string_dup ("");
+ green_event.header.variable_header.length (0); // put nothing here
+ green_event.filterable_data.length (0);
+ green_event.remainder_of_body <<= (CORBA::Long)10;
+
+ // event 3
+ CosNotification::StructuredEvent red_event;
+ red_event.header.fixed_header.event_type.domain_name =
+ CORBA::string_dup(DOMAIN_RED);
+ red_event.header.fixed_header.event_type.type_name =
+ CORBA::string_dup(TYPE_RED);
+ red_event.header.fixed_header.event_name = CORBA::string_dup("");
+ red_event.header.variable_header.length (0); // put nothing here
+ red_event.filterable_data.length (0);
+ red_event.remainder_of_body <<= (CORBA::Long)10;
+
+ g_throughput_start_ = ACE_OS::gethrtime ();
+
+ // let supplier 1 send all these events
+ for (int i = 0; i < this->burst_size_; ++i)
+ {
+ this->supplier_->send_event (red_event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->supplier_->send_event (green_event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+
+void
+RedGreen_Test::dump_results (void)
+{
+ ACE_Throughput_Stats throughput;
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ char buf[BUFSIZ];
+
+ ACE_OS::sprintf (buf,
+ "Normal Consumer [%02d]",
+ 1);
+ normal_consumer_->dump_stats (buf,
+ gsf);
+ normal_consumer_->accumulate_into (throughput);
+
+ ACE_OS::sprintf (buf,
+ "Slow Consumer [%02d]",
+ 2);
+ slow_consumer_->dump_stats (buf,
+ gsf);
+ slow_consumer_->accumulate_into (throughput);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n"));
+
+ ACE_Throughput_Stats suppliers;
+
+ ACE_OS::sprintf (buf,
+ "Supplier [%02d]",
+ 1);
+
+ this->supplier_->dump_stats (buf,
+ gsf);
+ this->supplier_->accumulate_into (suppliers);
+
+ ACE_DEBUG ((LM_DEBUG, "\nTotals:\n"));
+ throughput.dump_results ("Notify_Consumer/totals", gsf);
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ suppliers.dump_results ("Notify_Supplier/totals", gsf);
+}
+
+// *****************************************************************
+
+RedGreen_Test_StructuredPushConsumer::RedGreen_Test_StructuredPushConsumer (
+ RedGreen_Test* RedGreen_Test
+ )
+ : RedGreen_Test_ (RedGreen_Test),
+ push_count_ (0)
+{
+}
+
+RedGreen_Test_StructuredPushConsumer::~RedGreen_Test_StructuredPushConsumer (
+ void
+ )
+{
+}
+
+void
+RedGreen_Test_StructuredPushConsumer::accumulate_into (
+ ACE_Throughput_Stats &throughput
+ ) const
+{
+ throughput.accumulate (this->throughput_);
+}
+
+void
+RedGreen_Test_StructuredPushConsumer::dump_stats (const char* msg,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (msg,
+ gsf);
+}
+
+void
+RedGreen_Test_StructuredPushConsumer::connect (
+ CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL
+ )
+{
+ // Activate the consumer with the default_POA_.
+ CosNotifyComm::StructuredPushConsumer_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxySupplier_var proxysupplier =
+ consumer_admin->obtain_notification_push_supplier (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_supplier_id_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxysupplier.in ()));
+
+ // narrow
+ this->proxy_supplier_ =
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier::_narrow (
+ proxysupplier.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_supplier_.in ()));
+
+ proxy_supplier_->connect_structured_push_consumer (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test_StructuredPushConsumer::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ this->proxy_supplier_->
+ disconnect_structured_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test_StructuredPushConsumer::offer_change (
+ const CosNotification::EventTypeSeq & /*added*/,
+ const CosNotification::EventTypeSeq & /*removed*/
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ // No-Op.
+}
+
+void
+RedGreen_Test_StructuredPushConsumer::push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ ace_mon,
+ this->lock_);
+ const char* domain_name =
+ notification.header.fixed_header.event_type.domain_name;
+
+ const char* type_name =
+ notification.header.fixed_header.event_type.type_name;
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "Consumer %d event, domain = %s, type = %s\n",
+ this->proxy_supplier_id_,
+ domain_name,
+ type_name));
+
+ TimeBase::TimeT latency_base_recorded;
+ ACE_hrtime_t latency_base;
+
+ notification.filterable_data[0].value >>= latency_base_recorded;
+
+ ORBSVCS_Time::TimeT_to_hrtime (latency_base,
+ latency_base_recorded);
+
+ ++this->push_count_;
+
+ // Grab timestamp again.
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+
+ // Record statistics.
+ this->throughput_.sample (now - g_throughput_start_,
+ now - latency_base);
+
+
+ if (++g_result_count == 2*RedGreen_Test_->burst_size_)
+ {
+ RedGreen_Test_->done ();
+ }
+}
+
+void
+RedGreen_Test_StructuredPushConsumer::disconnect_structured_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // No-Op.
+}
+
+CosNotifyChannelAdmin::StructuredProxyPushSupplier_ptr
+RedGreen_Test_StructuredPushConsumer::get_proxy_supplier (void)
+{
+ return this->proxy_supplier_.in ();
+}
+
+// *****************************************************************
+
+SlowConsumer::SlowConsumer (RedGreen_Test* RedGreen_Test)
+ : RedGreen_Test_StructuredPushConsumer (RedGreen_Test)
+{
+}
+
+void
+SlowConsumer::push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ // Slow it down ...
+ ACE_OS::sleep (1);
+
+ RedGreen_Test_StructuredPushConsumer::push_structured_event (
+ notification
+ ACE_ENV_ARG_PARAMETER
+ );
+}
+
+// *****************************************************************
+
+RedGreen_Test_StructuredPushSupplier::RedGreen_Test_StructuredPushSupplier (
+ void
+ )
+{
+}
+
+RedGreen_Test_StructuredPushSupplier::~RedGreen_Test_StructuredPushSupplier (
+ void
+ )
+{
+}
+
+void
+RedGreen_Test_StructuredPushSupplier::accumulate_into (
+ ACE_Throughput_Stats &throughput
+ ) const
+{
+ throughput.accumulate (this->throughput_);
+}
+
+void
+RedGreen_Test_StructuredPushSupplier::dump_stats (const char* msg,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (msg,
+ gsf);
+}
+
+void
+RedGreen_Test_StructuredPushSupplier::connect (
+ CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL
+ )
+{
+ CosNotifyComm::StructuredPushSupplier_var objref =
+ this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosNotifyChannelAdmin::ProxyConsumer_var proxyconsumer =
+ supplier_admin->obtain_notification_push_consumer (
+ CosNotifyChannelAdmin::STRUCTURED_EVENT,
+ proxy_consumer_id_
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxyconsumer.in ()));
+
+ // narrow
+ this->proxy_consumer_ =
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer::_narrow (
+ proxyconsumer.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (proxy_consumer_.in ()));
+
+ proxy_consumer_->connect_structured_push_supplier (objref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test_StructuredPushSupplier::disconnect (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_ASSERT (!CORBA::is_nil (this->proxy_consumer_.in ()));
+
+ this->proxy_consumer_->disconnect_structured_push_consumer (
+ ACE_ENV_SINGLE_ARG_PARAMETER
+ );
+}
+
+void
+RedGreen_Test_StructuredPushSupplier::subscription_change (
+ const CosNotification::EventTypeSeq & /*added*/,
+ const CosNotification::EventTypeSeq & /*removed */
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType))
+{
+ //No-Op.
+}
+
+void
+RedGreen_Test_StructuredPushSupplier::send_event (
+ CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL
+ )
+{
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("latency_base");
+
+ // Record current time.
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+
+ TimeBase::TimeT latency_base;
+ ORBSVCS_Time::hrtime_to_TimeT (latency_base,
+ start);
+ // any
+ event.filterable_data[0].value <<= latency_base;
+ proxy_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_hrtime_t end = ACE_OS::gethrtime ();
+
+ this->throughput_.sample (end - g_throughput_start_,
+ end - start);
+ ACE_CHECK;
+}
+
+void
+RedGreen_Test_StructuredPushSupplier::disconnect_structured_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // No-Op.
+}
+
+//*****************************************************************
+
+Worker::Worker (void)
+{
+}
+
+void
+Worker::orb (CORBA::ORB_ptr orb)
+{
+ orb_ = CORBA::ORB::_duplicate (orb);
+}
+
+void
+Worker::done (void)
+{
+ consumer_is_done = true;
+}
+
+int
+Worker::svc (void)
+{
+ ACE_TRY_NEW_ENV
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION, "Consumer:");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h
new file mode 100644
index 00000000000..480a55ee0b7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h
@@ -0,0 +1,329 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// RedGreen_Test.h
+//
+// = DESCRIPTION
+// Performance test to show improvement in Notify performance by picking the
+// correcting configuration.
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_RedGreen_Test_CLIENT_H
+#define NOTIFY_RedGreen_Test_CLIENT_H
+
+#include "orbsvcs/CosNotifyChannelAdminS.h"
+#include "orbsvcs/CosNotifyCommC.h"
+#include "orbsvcs/CosNamingC.h"
+#include "ace/Task.h"
+#include "ace/Stats.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sched_Params.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class RedGreen_Test_StructuredPushConsumer;
+class RedGreen_Test_StructuredPushSupplier;
+
+class Worker : public ACE_Task_Base
+{
+ // = TITLE
+ // Run a server thread
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class to run server threads
+ //
+public:
+ Worker (void);
+ // Constructor.
+
+ void orb (CORBA::ORB_ptr orb);
+
+ virtual int svc (void);
+ // The thread entry point.
+
+ // Shutdown ORB
+ void done (void);
+
+private:
+ CORBA::ORB_var orb_;
+ // The orb
+};
+
+class RedGreen_Test
+{
+ // = TITLE
+ // RedGreen_Test
+ // = DESCRIPTION
+ // Shows how consumers RedGreen_Test for events.
+
+ public:
+ // = Initialization
+ RedGreen_Test (void);
+
+ int parse_args (int argc,
+ char *argv[]);
+
+ void dump_results (void);
+
+ void init (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // Initialize the Client.
+
+ void run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the demo.
+
+ void done (void);
+ // Called when all events we are waiting for have occured.
+
+ void destroy_ec (void);
+ // Destroy from the EC
+
+ int burst_size_;
+ Worker worker_;
+ int nthreads_;
+
+ protected:
+ void init_ORB (int argc,
+ char *argv []
+ ACE_ENV_ARG_DECL);
+ // Initializes the ORB.
+
+ void resolve_naming_service (ACE_ENV_SINGLE_ARG_DECL);
+ // Try to get hold of a running naming service.
+
+ void resolve_Notify_factory (ACE_ENV_SINGLE_ARG_DECL);
+ // Try to resolve the Notify factory from the Naming service.
+
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create an EC.
+
+ void create_supplieradmin(ACE_ENV_SINGLE_ARG_DECL);
+ // Create the Supplier Admin.
+
+ void create_consumeradmin (ACE_ENV_SINGLE_ARG_DECL);
+ // Create the Consumer Admin.
+
+ void create_consumers (ACE_ENV_SINGLE_ARG_DECL);
+ // Create and initialize the consumers.
+
+ void create_suppliers (ACE_ENV_SINGLE_ARG_DECL);
+ // create and initialize the suppliers.
+
+ void send_events (ACE_ENV_SINGLE_ARG_DECL);
+ // send the events.
+
+ // = Data Members.
+ PortableServer::POA_var root_poa_;
+ // Reference to the root poa.
+
+ CORBA::ORB_var orb_;
+ // The ORB that we use.
+
+ CosNaming::NamingContext_var naming_context_;
+ // Handle to the name service.
+
+ CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_;
+ // Channel factory.
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_;
+ // The group operator between admin-proxy's.
+
+ CosNotification::QoSProperties initial_qos_;
+ // Initial qos specified to the factory when creating the EC.
+
+ CosNotification::AdminProperties initial_admin_;
+ // Initial admin props specified to the factory when creating the EC.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ RedGreen_Test_StructuredPushConsumer* normal_consumer_;
+ RedGreen_Test_StructuredPushConsumer* slow_consumer_;
+
+ RedGreen_Test_StructuredPushSupplier* supplier_;
+};
+
+/*****************************************************************/
+class RedGreen_Test_StructuredPushConsumer
+ : public POA_CosNotifyComm::StructuredPushConsumer
+{
+ // = TITLE
+ // RedGreen_Test_StructuredPushConsumer
+ //
+ // = DESCRIPTION
+ // Consumer for the RedGreen_Test example.
+ //
+
+ public:
+ // = Initialization and Termination code
+ RedGreen_Test_StructuredPushConsumer (RedGreen_Test* RedGreen_Test);
+ // Constructor.
+
+ void connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin
+ ACE_ENV_ARG_DECL);
+ // Connect the Consumer to the EventChannel.
+ // Creates a new proxy supplier and connects to it.
+
+ virtual void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the supplier.
+
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_ptr get_proxy_supplier (
+ void
+ );
+ // Accessor for the Proxy that we're connected to.
+
+ void accumulate_into (ACE_Throughput_Stats &throughput) const;
+ // Accumulate the throughput statistics into <throughput>
+
+ void dump_stats (const char* msg, ACE_UINT32 gsf);
+ // Accumulate the throughput statistics into <throughput>
+
+protected:
+ // = Data members
+ CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxy_supplier_;
+ // The proxy that we are connected to.
+
+ CosNotifyChannelAdmin::ProxyID proxy_supplier_id_;
+ // The proxy_supplier id.
+
+ RedGreen_Test* RedGreen_Test_;
+ // callback <done>
+
+ TAO_SYNCH_MUTEX lock_;
+ // Protect internal state
+
+ int push_count_;
+
+ ACE_Throughput_Stats throughput_;
+ // Used for reporting stats
+
+ // = Methods
+ virtual ~RedGreen_Test_StructuredPushConsumer (void);
+ // Destructor
+
+ // = NotifyPublish method
+ virtual void offer_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ // = StructuredPushSupplier methods
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+
+ virtual void disconnect_structured_push_consumer (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+/*****************************************************************/
+
+class SlowConsumer : public RedGreen_Test_StructuredPushConsumer
+{
+public:
+ SlowConsumer (RedGreen_Test* RedGreen_Test);
+
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected));
+};
+
+
+/*****************************************************************/
+class RedGreen_Test_StructuredPushSupplier
+ : public POA_CosNotifyComm::StructuredPushSupplier
+{
+ // = TITLE
+ // RedGreen_Test_StructuredPushSupplier
+ //
+ // = DESCRIPTION
+ // Supplier for the RedGreen_Test example.
+ //
+ public:
+ // = Initialization and Termination code
+ RedGreen_Test_StructuredPushSupplier (void);
+ // Constructor.
+
+ void connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin
+ ACE_ENV_ARG_DECL);
+ // Connect the Supplier to the EventChannel.
+ // Creates a new proxy supplier and connects to it.
+
+ void disconnect (ACE_ENV_SINGLE_ARG_DECL);
+ // Disconnect from the supplier.
+
+ virtual void send_event (CosNotification::StructuredEvent& event
+ ACE_ENV_ARG_DECL);
+ // Send one event.
+
+ void accumulate_into (ACE_Throughput_Stats &throughput) const;
+ // Accumulate the throughput statistics into <throughput>
+
+ void dump_stats (const char* msg, ACE_UINT32 gsf);
+ // Accumulate the throughput statistics into <throughput>
+
+protected:
+ // = Data members
+ CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_;
+ // The proxy that we are connected to.
+
+ CosNotifyChannelAdmin::ProxyID proxy_consumer_id_;
+ // This supplier's id.
+
+ ACE_Throughput_Stats throughput_;
+ // Measure the elapsed time spent while sending the events.
+
+ // = Protected Methods
+ virtual ~RedGreen_Test_StructuredPushSupplier ();
+ // Destructor
+
+ // = NotifyRedGreen_Test
+ virtual void subscription_change (
+ const CosNotification::EventTypeSeq & added,
+ const CosNotification::EventTypeSeq & removed
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosNotifyComm::InvalidEventType));
+
+ // = StructuredPushSupplier method
+ virtual void disconnect_structured_push_supplier (
+ ACE_ENV_SINGLE_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException));
+};
+
+/*****************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_RedGreen_Test_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf
new file mode 100644
index 00000000000..6c62c9bb7c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf
@@ -0,0 +1,5 @@
+## $Id$
+static Notify_Default_Event_Manager_Objects_Factory "-AllocateTaskperProxy -DispatchingThreads 1"
+
+
+
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml
new file mode 100644
index 00000000000..686b6f6e4ba
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/performance-tests/RedGreen/listener.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-DispatchingThreads 1"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf
new file mode 100644
index 00000000000..9965c905158
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf
@@ -0,0 +1,2 @@
+## $Id$
+static Notify_Default_Event_Manager_Objects_Factory "-SourceThreads 2" \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf.xml b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf.xml
new file mode 100644
index 00000000000..f72d4165927
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/performance-tests/RedGreen/lookup.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <static id="Notify_Default_Event_Manager_Objects_Factory" params="-AllocateTaskperProxy -SourceThreads 2"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp
new file mode 100644
index 00000000000..25f07f3583e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/main.cpp
@@ -0,0 +1,34 @@
+// -*- C++ -*-
+// $Id$
+
+#include "RedGreen_Test.h"
+
+int
+main (int argc, char *argv [])
+{
+ ACE_High_Res_Timer::calibrate ();
+
+ RedGreen_Test client;
+
+ client.parse_args (argc, argv);
+
+ ACE_TRY_NEW_ENV
+ {
+ client.init (argc, argv
+ ACE_ENV_ARG_PARAMETER); //Init the Client
+ ACE_TRY_CHECK;
+
+ client.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client.destroy_ec ();
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf
new file mode 100644
index 00000000000..d4399938cec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf
@@ -0,0 +1,3 @@
+## $Id$
+static Notify_Default_Event_Manager_Objects_Factory ""
+
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf.xml b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf.xml
new file mode 100644
index 00000000000..b8b7e4f8e71
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/performance-tests/RedGreen/reactive.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <static id="Notify_Default_Event_Manager_Objects_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/run_test.pl
new file mode 100755
index 00000000000..c745855334a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/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 lib "../../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$notifyior = PerlACE::LocalFile ("notify.ior");
+$namingior = PerlACE::LocalFile ("naming.ior");
+$status = 0;
+
+unlink $notifyior;
+unlink $namingior;
+
+$Naming = new PerlACE::Process ("../../../../Naming_Service/Naming_Service",
+ "-o $namingior");
+
+$test = new PerlACE::Process ("RedGreen_Test",
+ "-ORBInitRef NameService=file://$namingior");
+
+@test_configs =
+ (
+ "reactive.conf",
+ "lookup.conf",
+ "listener.conf",
+ );
+
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($namingior, $startup_timeout) == -1)
+ {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+ }
+
+for $config (@test_configs)
+ {
+ print STDERR "\nTesting Notification Service with config file = $config ....\n\n";
+
+ $Notification =
+ new PerlACE::Process ("../../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=file://$namingior " .
+ "-IORoutput $notifyior " .
+ "-ORBSvcConf $config");
+
+ $Notification->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($notifyior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+ $test->Spawn ();
+
+ $status = $test->WaitKill ($experiment_timeout);
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $name returned $status\n";
+ break;
+ }
+
+ $Notification->Kill ();
+ }
+
+$Naming->Kill ();
+
+unlink $namingior;
+unlink $notifyior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf
new file mode 100644
index 00000000000..71ec9c42ce6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf
@@ -0,0 +1 @@
+static Resource_Factory "-ORBReactorMaskSignals 0"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf.xml b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf.xml
new file mode 100644
index 00000000000..0673554e968
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf.xml
@@ -0,0 +1,5 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Notify/performance-tests/RedGreen/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <static id="Resource_Factory" params="-ORBReactorMaskSignals 0"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Makefile.am b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Makefile.am
new file mode 100644
index 00000000000..3b6efe85d86
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Makefile.am
@@ -0,0 +1,73 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.Throughput_Ntf_Perf_Throughput.am
+
+if BUILD_CORBA_MESSAGING
+if !BUILD_ACE_FOR_TAO
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = Throughput
+
+Throughput_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -I$(TAO_ROOT)/orbsvcs/tests/Notify/lib \
+ -DTAO_HAS_TYPED_EVENT_CHANNEL
+
+Throughput_SOURCES = \
+ Throughput.cpp \
+ Throughput.h
+
+Throughput_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Strategies.la \
+ $(TAO_BUILDDIR)/orbsvcs/tests/Notify/lib/libTAO_NotifyTests.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IFR_Client.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicInterface.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_ETCL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/README b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/README
new file mode 100644
index 00000000000..3b27b5e847e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/README
@@ -0,0 +1,20 @@
+
+ Notify Throughput
+
+Test to measure Notify's throughput
+
+Command line options:
+--------------------
+-collocated_ec,
+-consumers [count],
+-suppliers [count],
+-burst_size [size],
+-burst_count [count],
+-burst_pause [time(uS)],
+-payload [size],
+-EC [Channel Name],
+-ExpectedCount [count]
+
+e.g.
+./Throughput -ORBInitRef NameService=file:///naming.ior -consumers 1 -suppliers 1 -burst_size 1000 -burst_count 1 -payload 16384
+
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp
new file mode 100644
index 00000000000..020b750ffa5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.cpp
@@ -0,0 +1,656 @@
+// $Id$
+
+#include "Throughput.h"
+
+#include "ace/Arg_Shifter.h"
+#include "ace/Get_Opt.h"
+#include "ace/Synch.h"
+#include "ace/OS.h"
+#include "ace/Dynamic_Service.h"
+#include "tao/Strategies/advanced_resource.h"
+#include "tao/Messaging/Messaging.h"
+#include "orbsvcs/Notify/Service.h"
+#include "orbsvcs/Time_Utilities.h"
+
+ACE_RCSID (Notify_Tests,
+ Throughput,
+ "$Id$")
+
+/***************************************************************************/
+
+Throughput_StructuredPushConsumer::Throughput_StructuredPushConsumer (
+ Notify_Throughput *test_client
+ )
+ : test_client_ (test_client),
+ push_count_ (0)
+{
+}
+
+void
+Throughput_StructuredPushConsumer::accumulate_into (
+ ACE_Throughput_Stats &throughput
+ ) const
+{
+ throughput.accumulate (this->throughput_);
+}
+
+void
+Throughput_StructuredPushConsumer::dump_stats (const char* msg,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (msg, gsf);
+}
+
+void
+Throughput_StructuredPushConsumer::push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL_NOT_USED
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosEventComm::Disconnected))
+{
+ // Extract payload.
+ const char* msg;
+ CORBA::Boolean ok = (notification.remainder_of_body >>= msg);
+
+ if (!ok)
+ ACE_DEBUG ((LM_DEBUG, "(%t) Error extracting message body\n"));
+
+ TimeBase::TimeT Throughput_base_recorded;
+ ACE_hrtime_t Throughput_base;
+
+ notification.filterable_data[0].value >>= Throughput_base_recorded;
+
+ ORBSVCS_Time::TimeT_to_hrtime (Throughput_base,
+ Throughput_base_recorded);
+
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_);
+
+ if (this->push_count_ == 0)
+ {
+ this->throughput_start_ = ACE_OS::gethrtime ();
+ }
+
+ ++this->push_count_;
+
+ // Grab timestamp again.
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+
+ // Record statistics.
+ this->throughput_.sample (now - this->throughput_start_,
+ now - Throughput_base);
+
+ if (this->push_count_%1000 == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P)(%t) event count = %d\n",
+ this->push_count_));
+ }
+
+ if (push_count_ == test_client_->perconsumer_count_)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t)expected count reached\n"));
+ test_client_->peer_done ();
+ }
+}
+
+/***************************************************************************/
+
+Throughput_StructuredPushSupplier::Throughput_StructuredPushSupplier (
+ Notify_Throughput* test_client
+ )
+ :test_client_ (test_client),
+ push_count_ (0)
+{
+}
+
+Throughput_StructuredPushSupplier::~Throughput_StructuredPushSupplier ()
+{
+}
+
+void
+Throughput_StructuredPushSupplier::accumulate_into (
+ ACE_Throughput_Stats &throughput
+ ) const
+{
+ throughput.accumulate (this->throughput_);
+}
+
+void
+Throughput_StructuredPushSupplier::dump_stats (const char* msg,
+ ACE_UINT32 gsf)
+{
+ this->throughput_.dump_results (msg, gsf);
+}
+
+int
+Throughput_StructuredPushSupplier::svc (void)
+{
+ // Initialize a time value to pace the test.
+ ACE_Time_Value tv (0, test_client_->burst_pause_);
+
+ // Operations.
+ CosNotification::StructuredEvent event;
+
+ // EventHeader
+
+ // FixedEventHeader
+ // EventType
+ // string
+ event.header.fixed_header.event_type.domain_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_type.type_name = CORBA::string_dup("*");
+ // string
+ event.header.fixed_header.event_name = CORBA::string_dup("myevent");
+
+ // OptionalHeaderFields
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ CosNotification::PropertySeq& qos = event.header.variable_header;
+ qos.length (0); // put nothing here
+
+ // FilterableEventBody
+ // PropertySeq
+ // sequence<Property>: string name, any value
+ event.filterable_data.length (1);
+ event.filterable_data[0].name = CORBA::string_dup("Throughput_base");
+
+ event.remainder_of_body <<= test_client_->payload_;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ this->throughput_start_ = ACE_OS::gethrtime ();
+
+ for (int i = 0; i < test_client_->burst_count_; ++i)
+ {
+ for (int j = 0; j < test_client_->burst_size_; ++j)
+ {
+ // Record current time.
+ ACE_hrtime_t start = ACE_OS::gethrtime ();
+ TimeBase::TimeT Throughput_base;
+ ORBSVCS_Time::hrtime_to_TimeT (Throughput_base,
+ start);
+ // Any.
+ event.filterable_data[0].value <<= Throughput_base;
+
+ this->proxy_->push_structured_event (event
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_hrtime_t end = ACE_OS::gethrtime ();
+ this->throughput_.sample (end - this->throughput_start_,
+ end - start);
+ }
+
+ ACE_OS::sleep (tv);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "(%P) (%t) Supplier done\n"));
+ test_client_->peer_done ();
+ return 0;
+}
+
+/***************************************************************************/
+Notify_Throughput::Notify_Throughput (void)
+ : collocated_ec_ (0),
+ burst_count_ (1),
+ burst_pause_ (10000),
+ burst_size_ (1000),
+ payload_size_ (1024),
+ payload_ (0),
+ consumer_count_ (1),
+ supplier_count_ (1),
+ perconsumer_count_ (burst_size_*burst_count_*supplier_count_),
+ consumers_ (0),
+ suppliers_ (0),
+ nthreads_ (1),
+ peer_done_count_ (consumer_count_ + supplier_count_),
+ condition_ (lock_)
+{
+}
+
+Notify_Throughput::~Notify_Throughput ()
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ this->orb_->shutdown (0
+ ACE_ENV_ARG_PARAMETER);
+
+ delete payload_;
+}
+
+int
+Notify_Throughput::init (int argc, char* argv [] ACE_ENV_ARG_DECL)
+{
+ // Initialize base class.
+ Notify_Test_Client::init_ORB (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+#if (TAO_HAS_CORBA_MESSAGING == 1)
+ CORBA::Object_var manager_object =
+ orb_->resolve_initial_references ("ORBPolicyManager"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::PolicyManager_var policy_manager =
+ CORBA::PolicyManager::_narrow (manager_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CORBA::Any sync_scope;
+ sync_scope <<= Messaging::SYNC_WITH_TARGET;
+
+ CORBA::PolicyList policy_list (1);
+ policy_list.length (1);
+ policy_list[0] =
+ orb_->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE,
+ sync_scope
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ policy_manager->set_policy_overrides (policy_list,
+ CORBA::SET_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "CORBA Messaging disabled in this configuration,"
+ " test may not be optimally configured\n"));
+#endif /* TAO_HAS_MESSAGING */
+
+ worker_.orb (this->orb_.in ());
+
+ if (worker_.activate (THR_NEW_LWP | THR_JOINABLE,
+ this->nthreads_) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot activate client threads\n"));
+ }
+
+ // Create all participents ...
+ this->create_EC (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ CosNotifyChannelAdmin::AdminID adminid;
+
+ supplier_admin_ =
+ ec_->new_for_suppliers (this->ifgop_, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (supplier_admin_.in ()));
+
+ consumer_admin_ =
+ ec_->new_for_consumers (this->ifgop_, adminid ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ ACE_ASSERT (!CORBA::is_nil (consumer_admin_.in ()));
+
+ ACE_NEW_RETURN (consumers_,
+ Throughput_StructuredPushConsumer*[this->consumer_count_],
+ -1);
+ ACE_NEW_RETURN (suppliers_,
+ Throughput_StructuredPushSupplier*[this->supplier_count_],
+ -1);
+
+ // ----
+
+ int i = 0;
+
+ for (i = 0; i < this->consumer_count_; ++i)
+ {
+ ACE_NEW_RETURN (consumers_[i],
+ Throughput_StructuredPushConsumer (this),
+ -1);
+ consumers_[i]->init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ consumers_[i]->connect (this->consumer_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ for (i = 0; i < this->supplier_count_; ++i)
+ {
+ ACE_NEW_RETURN (suppliers_[i],
+ Throughput_StructuredPushSupplier (this),
+ -1);
+ suppliers_[i]->TAO_Notify_Tests_StructuredPushSupplier::init (
+ root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER
+ );
+ ACE_CHECK_RETURN (-1);
+ suppliers_[i]->connect (this->supplier_admin_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+ return 0;
+}
+
+int
+Notify_Throughput::parse_args(int argc, char *argv[])
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ const ACE_TCHAR* current_arg = 0;
+ while (arg_shifter.is_anything_left ())
+ {
+ if (arg_shifter.cur_arg_strncasecmp ("-collocated_ec") == 0)
+ {
+ this->collocated_ec_ = 1;
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-consumers")))
+ {
+ this->consumer_count_ = ACE_OS::atoi (current_arg);
+ // The number of events to send/receive.
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-suppliers")))
+ {
+ this->supplier_count_ = ACE_OS::atoi (current_arg);
+ // The number of events to send/receive.
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-burst_size")))
+ {
+ this->burst_size_ = ACE_OS::atoi (current_arg);
+ // The number of events to send/receive.
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-burst_count")))
+ {
+ this->burst_count_ = ACE_OS::atoi (current_arg);
+ //
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-burst_pause")))
+ {
+ this->burst_pause_ = ACE_OS::atoi (current_arg);
+ //
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-payload")))
+ {
+ this->payload_size_ = ACE_OS::atoi (current_arg);
+ ACE_NEW_RETURN (this->payload_,
+ char [this->payload_size_],
+ -1);
+ //
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg = arg_shifter.get_the_parameter ("-EC")))
+ {
+ this->ec_name_ = current_arg;
+ //
+ arg_shifter.consume_arg ();
+ }
+ else if ((current_arg =
+ arg_shifter.get_the_parameter ("-ExpectedCount")))
+ {
+ this->perconsumer_count_ = ACE_OS::atoi (current_arg);
+ //
+ arg_shifter.consume_arg ();
+ }
+ else if (arg_shifter.cur_arg_strncasecmp ("-?") == 0)
+ {
+ ACE_DEBUG((LM_DEBUG,
+ "usage: %s "
+ "-collocated_ec, "
+ "-consumers [count], "
+ "-suppliers [count], "
+ "-burst_size [size], "
+ "-burst_count [count], "
+ "-burst_pause [time(uS)], "
+ "-payload [size]"
+ "-EC [Channel Name]"
+ "-ExpectedCount [count]\n",
+ argv[0], argv[0]));
+
+ arg_shifter.consume_arg ();
+
+ return -1;
+ }
+ else
+ {
+ arg_shifter.ignore_arg ();
+ }
+ }
+ // Recalculate.
+ peer_done_count_ = consumer_count_ + supplier_count_;
+ return 0;
+}
+
+void
+Notify_Throughput::create_EC (ACE_ENV_SINGLE_ARG_DECL)
+{
+ if (this->collocated_ec_ == 1)
+ {
+ TAO_Notify_Service* notify_service = ACE_Dynamic_Service<TAO_Notify_Service>::instance (TAO_NOTIFICATION_SERVICE_NAME);
+
+ if (notify_service == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Service not found! check conf. file\n"));
+ return;
+ }
+
+ // Activate the factory
+ this->notify_factory_ =
+ notify_service->create (this->root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_ASSERT (!CORBA::is_nil (this->notify_factory_.in ()));
+ }
+ else
+ {
+ this->resolve_naming_service (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->resolve_Notify_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // A channel name was specified, use that to resolve the service.
+ if (this->ec_name_.length () != 0)
+ {
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup (ec_name_.c_str ());
+
+ CORBA::Object_var obj =
+ this->naming_context_->resolve (name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->ec_ =
+ CosNotifyChannelAdmin::EventChannel::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+else
+ {
+ CosNotifyChannelAdmin::ChannelID id;
+
+ ec_ = notify_factory_->create_channel (initial_qos_,
+ initial_admin_,
+ id
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ ACE_ASSERT (!CORBA::is_nil (ec_.in ()));
+}
+
+void
+Notify_Throughput::run_test (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ ACE_DEBUG ((LM_DEBUG, "collocated_ec_ %d ,"
+ "burst_count_ %d, "
+ "burst_pause_ %d, "
+ "burst_size_ %d, "
+ "payload_size_ %d, "
+ "consumer_count_ %d, "
+ "supplier_count_ %d "
+ "expected count %d\n",
+ collocated_ec_,
+ burst_count_ ,
+ burst_pause_ ,
+ burst_size_ ,
+ payload_size_,
+ consumer_count_ ,
+ supplier_count_ ,
+ perconsumer_count_));
+
+ for (int i = 0; i < this->supplier_count_; ++i)
+ {
+ suppliers_[i]->
+ TAO_Notify_Tests_StructuredPushSupplier::init (root_poa_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (suppliers_[i]->ACE_Task_Base::activate (THR_NEW_LWP | THR_JOINABLE) != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot activate client threads\n"));
+ }
+ }
+
+ // Wait till we're signalled done.
+ {
+ ACE_DEBUG ((LM_DEBUG, "(%t)Waiting for shutdown signal in main..\n"));
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, lock_);
+
+ while (this->peer_done_count_ != 0)
+ {
+ condition_.wait ();
+ }
+ }
+
+ if (this->ec_name_.length () == 0) // we are not using a global EC
+ {
+ // Destroy the ec.
+ this->ec_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+
+ // Signal the workers.
+ this->worker_.done_ = 1;
+}
+
+void
+Notify_Throughput::peer_done (void)
+{
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, lock_);
+
+ if (--this->peer_done_count_ == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "calling shutdown\n"));
+ condition_.broadcast ();
+ }
+}
+
+void
+Notify_Throughput::dump_results (void)
+{
+ ACE_Throughput_Stats throughput;
+ ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor ();
+ char buf[BUFSIZ];
+
+ for (int j = 0; j < this->consumer_count_; ++j)
+ {
+ ACE_OS::sprintf (buf, "Consumer [%02d]", j);
+
+ this->consumers_[j]->dump_stats (buf, gsf);
+ this->consumers_[j]->accumulate_into (throughput);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+
+ ACE_Throughput_Stats suppliers;
+
+ for (int i = 0; i < this->supplier_count_; ++i)
+ {
+ ACE_OS::sprintf (buf, "Supplier [%02d]", i);
+
+ this->suppliers_[i]->dump_stats (buf, gsf);
+ this->suppliers_[i]->accumulate_into (suppliers);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "\nTotals:\n"));
+ throughput.dump_results ("Notify_Consumer/totals", gsf);
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ suppliers.dump_results ("Notify_Supplier/totals", gsf);
+}
+
+/***************************************************************************/
+
+int
+main (int argc, char* argv[])
+{
+ ACE_High_Res_Timer::calibrate ();
+
+ Notify_Throughput events;
+
+ if (events.parse_args (argc, argv) == -1)
+ {
+ return 1;
+ }
+
+ ACE_TRY_NEW_ENV
+ {
+ events.init (argc, argv
+ ACE_ENV_ARG_PARAMETER); //Init the Client
+ ACE_TRY_CHECK;
+
+ events.run_test (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Waiting for threads to exit...\n"));
+ ACE_Thread_Manager::instance ()->wait ();
+ events.dump_results();
+
+ ACE_DEBUG ((LM_DEBUG, "ending main...\n"));
+
+ }
+ ACE_CATCH (CORBA::Exception, se)
+ {
+ ACE_PRINT_EXCEPTION (se, "Error: ");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+
+// ****************************************************************
+
+Worker::Worker (void)
+:done_ (0)
+{
+}
+
+void
+Worker::orb (CORBA::ORB_ptr orb)
+{
+ orb_ = CORBA::ORB::_duplicate (orb);
+}
+
+int
+Worker::svc (void)
+{
+ ACE_Time_Value tv(5);
+
+ do
+ {
+ this->orb_->run (tv);
+ }while (!this->done_);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P) (%t) done\n"));
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h
new file mode 100644
index 00000000000..802054bd6cf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.h
@@ -0,0 +1,228 @@
+/* -*- C++ -*- */
+// $Id$
+// ==========================================================================
+//
+// = FILENAME
+// Throughput.h
+//
+// = DESCRIPTION
+//
+// = AUTHOR
+// Pradeep Gore <pradeep@cs.wustl.edu>
+//
+// ==========================================================================
+
+#ifndef NOTIFY_Throughput_H
+#define NOTIFY_Throughput_H
+
+#include "Notify_Test_Client.h"
+#include "Notify_StructuredPushConsumer.h"
+#include "Notify_StructuredPushSupplier.h"
+#include "ace/Task.h"
+#include "ace/Stats.h"
+#include "ace/High_Res_Timer.h"
+#include "ace/Sched_Params.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+class Worker : public ACE_Task_Base
+{
+ // = TITLE
+ // Run a server thread
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class to run server threads
+ //
+public:
+ Worker (void);
+ // ctor
+
+ void orb (CORBA::ORB_ptr orb);
+
+ virtual int svc (void);
+ // The thread entry point.
+
+ int done_;
+
+private:
+ CORBA::ORB_var orb_;
+ // The orb
+};
+
+/***************************************************************************/
+
+class Notify_Throughput;
+
+class Throughput_StructuredPushConsumer
+ : public TAO_Notify_Tests_StructuredPushConsumer
+{
+public:
+ Throughput_StructuredPushConsumer (Notify_Throughput *test_client);
+ // Contructor.
+
+ // = StructuredPushSupplier methods
+ virtual void push_structured_event (
+ const CosNotification::StructuredEvent & notification
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException,
+ CosEventComm::Disconnected
+ ));
+
+ void accumulate_into (ACE_Throughput_Stats &throughput) const;
+ // Accumulate the throughput statistics into <throughput>
+
+ void dump_stats (const char* msg, ACE_UINT32 gsf);
+ // Accumulate the throughput statistics into <throughput>
+
+protected:
+ Notify_Throughput * test_client_;
+
+ TAO_SYNCH_MUTEX lock_;
+ // Protect internal state
+
+ ACE_hrtime_t throughput_start_;
+ // The timestamp for the first message received
+
+ ACE_Throughput_Stats throughput_;
+ // Used for reporting stats
+
+ int push_count_;
+ // The number of push() calls
+};
+
+/***************************************************************************/
+
+class Throughput_StructuredPushSupplier
+ : public TAO_Notify_Tests_StructuredPushSupplier,
+ public ACE_Task_Base
+{
+public:
+ Throughput_StructuredPushSupplier (Notify_Throughput * test_client);
+ // Constructor.
+
+ virtual ~Throughput_StructuredPushSupplier ();
+ // Destructor.
+
+ // = The ACE_Task_Base methods....
+ virtual int svc (void);
+
+ void accumulate_into (ACE_Throughput_Stats &throughput) const;
+ // Accumulate the throughput statistics into <throughput>
+
+ void dump_stats (const char* msg, ACE_UINT32 gsf);
+ // Accumulate the throughput statistics into <throughput>
+
+protected:
+ Notify_Throughput* test_client_;
+
+ int push_count_;
+ // Count the number of push() calls
+
+ ACE_hrtime_t throughput_start_;
+ // The time for the first event sent
+
+ ACE_Throughput_Stats throughput_;
+ // Measure the elapsed time spent while sending the events.
+};
+
+/***************************************************************************/
+
+class Notify_Throughput : public Notify_Test_Client
+{
+public:
+ // Initialization and termination code
+ Notify_Throughput (void);
+ virtual ~Notify_Throughput ();
+
+ int parse_args(int argc, char *argv[]) ;
+
+ int init (int argc, char *argv [] ACE_ENV_ARG_DECL);
+ // initialization.
+
+ void run_test (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the test.
+
+ void peer_done (void);
+ // Peers call this when done.
+
+ void dump_results (void);
+ // check if we got the expected results.
+
+ Worker worker_;
+protected:
+ void create_EC (ACE_ENV_SINGLE_ARG_DECL);
+ // Create participants.
+
+ CORBA::Boolean collocated_ec_;
+ // is the ec collocated.
+
+ int burst_count_;
+ // How many bursts we will send from each supplier.
+
+ int burst_pause_;
+ // The time between each event burst, in microseconds.
+
+ int burst_size_;
+ // Number of events to send per supplier in every burst
+
+ int payload_size_;
+ // data size to transmit.
+
+ char *payload_;
+ // the payload.
+
+ int consumer_count_;
+ // Consumer count
+
+ int supplier_count_;
+ // Supplier count
+
+ int perconsumer_count_;
+ // Number of events received that each consumer expects to see.
+
+ ACE_CString ec_name_;
+ // The name of the EC to resolve.
+
+ CosNotifyChannelAdmin::EventChannel_var ec_;
+ // The one channel that we create using the factory.
+
+ CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_;
+ // The consumer admin used by consumers.
+
+ CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_;
+ // The supplier admin used by suppliers.
+
+ Throughput_StructuredPushConsumer** consumers_;
+ // Consumers
+
+ Throughput_StructuredPushSupplier** suppliers_;
+ // Suppliers
+
+ int nthreads_;
+
+ // = Helpers to signal done.
+ int peer_done_count_;
+ // how many peers are done.
+
+ TAO_SYNCH_MUTEX lock_;
+ // The lock to serialize access to members.
+
+ TAO_SYNCH_CONDITION condition_;
+ // exit wait condition
+private:
+ friend class Throughput_StructuredPushSupplier;
+ friend class Throughput_StructuredPushConsumer;
+};
+
+/***************************************************************************/
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* NOTIFY_TESTS_EventS_H */
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.mpc b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.mpc
new file mode 100644
index 00000000000..b16923c43da
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/Throughput/Throughput.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Ntf Perf Throughput): notifytest, strategies, messaging, minimum_corba {
+ exename = Throughput
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf
new file mode 100644
index 00000000000..81477a4a545
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_0/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf
new file mode 100644
index 00000000000..9a4ca3d23f7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_10/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 10 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf
new file mode 100644
index 00000000000..5a3ca3273ec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_15/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 15 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf
new file mode 100644
index 00000000000..353afa04682
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_20/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 20 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf
new file mode 100644
index 00000000000..9a8d150acab
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_25/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 25 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf
new file mode 100644
index 00000000000..011249c3b88
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_30/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 30 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf
new file mode 100644
index 00000000000..26514354e70
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_35/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 35 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf
new file mode 100644
index 00000000000..213334fb39e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_40/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 40 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf
new file mode 100644
index 00000000000..70eaaf4a6b5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_45/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 45 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf
new file mode 100644
index 00000000000..fa3586d0188
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_5/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 5 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf
new file mode 100644
index 00000000000..f44743cf7c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/Load_50/supplier.conf
@@ -0,0 +1,31 @@
+## $Id$
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 0 -Iter 50000 -Load 50 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/README b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/README
new file mode 100644
index 00000000000..ddf54440055
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/README
@@ -0,0 +1,37 @@
+## $Id$
+
+1 Path : Load vs Throughput experiment with period=0
+====================================================
+
+In this test we setup a Path (In a Path, a single supplier sends
+events to a consumer and only that consumer) at High Priority.
+
+The consumer performs CPU work according to the load supplied to it.
+
+We increase the load and measure the throughput recorded.
+
+
+Running the experiment:
+======================
+
+Run the "run_all.pl" script in this directory to run the test using RT-Notification.
+as "run_all.pl --rt"
+
+If you want to generate results using the CosNotification, run as
+"run_all.pl --cos"
+
+To generate the data for both cases run as "run_all.pl --all"
+
+The RT-Notification results are generated in the Load_X/rt_output directory.
+The CosNotification results are generated in the Load_X/cos_output directory.
+
+e.g., Load_0/rt_output/c_high.dat would contain the statistics
+recorded for the consumer when the Load is 0.
+
+
+Expected Results:
+================
+
+As the load increases the throughput for the consumer should fall.
+This helps us determine the load at which the system is operating at
+full capacity.
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf
new file mode 100644
index 00000000000..07249b105c8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/consumer.conf
@@ -0,0 +1,31 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
+#
+##--------- Consumer , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1 -POA poa_1"
+static Command_Builder "PeriodicConsumer -Subscription c_high +H"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/cos_notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/cos_notify.conf
new file mode 100644
index 00000000000..0515ecbd0db
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/cos_notify.conf
@@ -0,0 +1,2 @@
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_CosNotification_Serv:_make_TAO_CosNotify_Service () ""
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/rt_notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/rt_notify.conf
new file mode 100644
index 00000000000..a747c353448
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/rt_notify.conf
@@ -0,0 +1,3 @@
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_all.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_all.pl
new file mode 100755
index 00000000000..8f1a38c778e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_all.pl
@@ -0,0 +1,58 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Long;
+
+GetOptions ("rt" => \$rt,
+ "cos" => \$cos,
+ "all" => \$all);
+
+@list=("Load_0", "Load_5", "Load_10","Load_15","Load_20","Load_25","Load_30","Load_35","Load_40","Load_45","Load_50");
+
+for $file (@list)
+{
+ # default to rt
+ if (!$all && !$rt && !$cos)
+ {
+ $rt = 1;
+ }
+
+ if (-d $file)
+ {
+ if ($all || $rt)
+ {
+ print STDERR "Running $file test with RT Notification\n";
+
+ $cmd = "run_test.pl -n rt_notify.conf -s $file/supplier.conf -c consumer.conf -o $file/rt_output";
+
+ $status = system ("perl $cmd");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $file test returned $status\n";
+ }
+ }
+
+
+ if ($all || $cos)
+ {
+ print STDERR "Running $file test with COS Notification\n";
+
+ $cmd = "run_test.pl -n cos_notify.conf -s $file/supplier.conf -c consumer.conf -o $file/cos_output";
+
+ $status = system ("perl $cmd");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $file test returned $status\n";
+ }
+ }
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl
new file mode 100755
index 00000000000..faa104133ca
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl
@@ -0,0 +1,167 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
+ exit 0;
+}
+
+$experiment_timeout = 240;
+$startup_timeout = 120;
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $supplier_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}
+
+if ($opt_c)
+{
+ $consumer_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
+
+#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+
+$Supplier = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
+
+#$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf -ORBDebugLevel 1";
+
+$Consumer = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
+
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$Notification->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $supplier_ior;
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->Spawn ();
+
+if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+unlink $consumer_ior;
+
+$Supplier->Wait ();
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($opt_o)
+ {
+ $results_directory = PerlACE::LocalFile ($opt_o);
+
+ if (! -e $results_directory)
+ {
+ mkdir $results_directory, 0777;
+ }
+
+ print STDERR "Saving results to $results_directory\n";
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ move ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf
new file mode 100644
index 00000000000..92db23547f9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_0/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 0 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 0 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 4000 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats -Samples"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf
new file mode 100644
index 00000000000..38ac8442cec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_10/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 10 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 10 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 10 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf
new file mode 100644
index 00000000000..f7656f36930
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_15/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 15 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 15 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 15 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf
new file mode 100644
index 00000000000..14074a2f482
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_20/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 20 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 20 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 20 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf
new file mode 100644
index 00000000000..b4954b4fd87
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_25/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 25 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 25 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 25 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf
new file mode 100644
index 00000000000..034fad03e3c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_30/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf
new file mode 100644
index 00000000000..69dfaecb51a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_35/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 35 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 35 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 35 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf
new file mode 100644
index 00000000000..f84fd889d57
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_40/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 40 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 40 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 40 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf
new file mode 100644
index 00000000000..37d1090a90f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_45/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 45 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 45 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 45 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf
new file mode 100644
index 00000000000..1403c8b429e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_5/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 5 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 5 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 5 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf
new file mode 100644
index 00000000000..d6d1c14e7d8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/Load_50/supplier.conf
@@ -0,0 +1,38 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s1 connected to sa1. -----
+static Command_Builder "PeriodicSupplier -Create s_low -Admin sa1 -EventType L -Priority 1 -Period 10000 -Iter 50000 -Load 50 -RunTime 15"
+#
+### --- Create Supplier s2 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_med -Admin sa1 -EventType M -Priority 2 -Period 10000 -Iter 50000 -Load 50 -RunTime 15"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 50 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/README b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/README
new file mode 100644
index 00000000000..55e2003fc75
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/README
@@ -0,0 +1,41 @@
+## $Id$
+
+3 Paths : Load vs Throughput experiment with period=10ms
+========================================================
+
+In this test we setup 3 Paths (In a Path, a single supplier sends
+events to a consumer and only that consumer) at High, Medium and Low Priority.
+
+Each Supplier tries to send an event every 10ms (100Hz).
+Each consumer performs CPU work according to the load supplied to it.
+
+We increase the load and measure the throughput recorded.
+
+
+Running the experiment:
+======================
+
+Run the "run_all.pl" script in this directory to run the test using RT-Notification.
+as "run_all.pl --rt"
+
+If you want to generate results using the CosNotification, run as
+"run_all.pl --cos"
+
+To generate the data for both cases run as "run_all.pl --all"
+
+The RT-Notification results are generated in the Load_X/rt_output directory.
+The CosNotification results are generated in the Load_X/cos_output directory.
+
+e.g., Load_0/rt_output/c_high.dat would contain the statistics
+recorded for the consumer when the Load is 0.
+
+
+Expected Results:
+================
+
+RT-Notification : As the load increases the throughput for the consumers should fall
+however the high priority path should be least affected followed by
+the medium and then the low priority.
+
+CosNotification : As the CosNotification is unable to communicate
+priorities, the throughput of all 3 paths will fall in tandem.
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf
new file mode 100644
index 00000000000..5639b258ca4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/consumer.conf
@@ -0,0 +1,43 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 4 -Lane 0 1 0 -Lane 1 1 0 -Lane 2 1 0 -Lane 3 1 0"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
+#
+##--------- Consumer 1 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_low -Admin ca1 -POA poa_1"
+static Command_Builder "PeriodicConsumer -Subscription c_low +L"
+#
+##--------- Consumer 2 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_med -Admin ca1 -POA poa_1"
+static Command_Builder "PeriodicConsumer -Subscription c_med +M"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1 -POA poa_1"
+static Command_Builder "PeriodicConsumer -Subscription c_high +H"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+#
+# Use the -Samples option if you want to dump each sample recorded.
+#static Command_Builder "Application -DumpStats -Samples"
+#
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/cos_notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/cos_notify.conf
new file mode 100644
index 00000000000..0515ecbd0db
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/cos_notify.conf
@@ -0,0 +1,2 @@
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_CosNotification_Serv:_make_TAO_CosNotify_Service () ""
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/rt_notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/rt_notify.conf
new file mode 100644
index 00000000000..a747c353448
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/rt_notify.conf
@@ -0,0 +1,3 @@
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_all.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_all.pl
new file mode 100755
index 00000000000..8f1a38c778e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_all.pl
@@ -0,0 +1,58 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Long;
+
+GetOptions ("rt" => \$rt,
+ "cos" => \$cos,
+ "all" => \$all);
+
+@list=("Load_0", "Load_5", "Load_10","Load_15","Load_20","Load_25","Load_30","Load_35","Load_40","Load_45","Load_50");
+
+for $file (@list)
+{
+ # default to rt
+ if (!$all && !$rt && !$cos)
+ {
+ $rt = 1;
+ }
+
+ if (-d $file)
+ {
+ if ($all || $rt)
+ {
+ print STDERR "Running $file test with RT Notification\n";
+
+ $cmd = "run_test.pl -n rt_notify.conf -s $file/supplier.conf -c consumer.conf -o $file/rt_output";
+
+ $status = system ("perl $cmd");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $file test returned $status\n";
+ }
+ }
+
+
+ if ($all || $cos)
+ {
+ print STDERR "Running $file test with COS Notification\n";
+
+ $cmd = "run_test.pl -n cos_notify.conf -s $file/supplier.conf -c consumer.conf -o $file/cos_output";
+
+ $status = system ("perl $cmd");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $file test returned $status\n";
+ }
+ }
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl
new file mode 100755
index 00000000000..d23c002277c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl
@@ -0,0 +1,165 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
+ exit 0;
+}
+
+$experiment_timeout = 120;
+$startup_timeout = 120;
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $supplier_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}
+
+if ($opt_c)
+{
+ $consumer_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
+
+#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+
+$Supplier = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
+
+$Consumer = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
+
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$Notification->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $supplier_ior;
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->Spawn ();
+
+if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+unlink $consumer_ior;
+
+$Supplier->Wait ();
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($opt_o)
+ {
+ $results_directory = PerlACE::LocalFile ($opt_o);
+
+ if (! -e $results_directory)
+ {
+ mkdir $results_directory, 0777;
+ }
+
+ print STDERR "Saving results to $results_directory\n";
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ move ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf
new file mode 100644
index 00000000000..0f95a246f56
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/consumer.conf
@@ -0,0 +1,24 @@
+## $Id$
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+##---- Load the Factories------
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Direct"
+#
+##------- Run---------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/run_test.pl
new file mode 100755
index 00000000000..01ccf03a55d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+
+$experiment_timeout = 600;
+$startup_timeout = 600;
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$consumer_ior = PerlACE::LocalFile ("consumer.ior");
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$consumer_ior -ORBSvcConf $supplier_conf -Skip_Priority_Levels_Check";
+
+$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf -Skip_Priority_Levels_Check";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->Spawn ();
+
+if (PerlACE::waitforfile_timed ($consumer_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the consumer to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Supplier returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+
+$Consumer->Wait ();
+unlink $consumer_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($#ARGV > -1)
+ {
+ $results_directory = $ARGV[0];
+ print STDERR "Saving results to $results_directory\n";
+
+ mkdir $results_directory, 0777;
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf
new file mode 100644
index 00000000000..fef4d975c5d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/supplier.conf
@@ -0,0 +1,25 @@
+## $Id$
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+#
+##---- Load the Factories------
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+### --- Create Supplier connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high -EventType H -Priority 2 -Period 0 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf
new file mode 100644
index 00000000000..d7b6d405f92
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/consumer.conf
@@ -0,0 +1,27 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Direct -POA poa_1"
+#
+##------- Run---------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/run_test.pl
new file mode 100755
index 00000000000..d9eb350d2e9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/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;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+
+$experiment_timeout = 600;
+$startup_timeout = 600;
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$consumer_ior = PerlACE::LocalFile ("consumer.ior");
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$consumer_ior -ORBSvcConf $supplier_conf";
+
+$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->Spawn ();
+
+if (PerlACE::waitforfile_timed ($consumer_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the consumer to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Supplier returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+
+$Consumer->Wait ();
+unlink $consumer_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($#ARGV > -1)
+ {
+ $results_directory = $ARGV[0];
+ print STDERR "Saving results to $results_directory\n";
+
+ mkdir $results_directory, 0777;
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf
new file mode 100644
index 00000000000..3b7a027668c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/supplier.conf
@@ -0,0 +1,25 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+### --- Create Supplier connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high -EventType H -Priority 1 -Period 0 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf
new file mode 100644
index 00000000000..8bfc893a7a9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/consumer.conf
@@ -0,0 +1,26 @@
+## $Id$
+##
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+##---- Load the Factories------
+#
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Direct"
+#
+##------- Run---------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf
new file mode 100644
index 00000000000..de27feabe08
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/relay.conf
@@ -0,0 +1,27 @@
+## $Id$
+##
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+##---- Load the Factories------
+#
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high_relay -Relay c_high"
+#
+##------- Run---------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl
new file mode 100755
index 00000000000..ef4585df832
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl
@@ -0,0 +1,117 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$consumer_ior = PerlACE::LocalFile ("consumer.ior");
+$relay_ior = PerlACE::LocalFile ("relay.ior");
+
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$relay_conf = PerlACE::LocalFile ("relay.conf");
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$relay_ior -ORBSvcConf $supplier_conf -Skip_Priority_Levels_Check";
+
+$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf -Skip_Priority_Levels_Check";
+
+$Relay = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Relay_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $relay_ior -IORinput file://$consumer_ior -ORBSvcConf $relay_conf -Skip_Priority_Levels_Check";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->Spawn ();
+
+if (PerlACE::waitforfile_timed ($consumer_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the consumer to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $relay_ior;
+$Relay->Arguments ($Relay_Args);
+$args = $Relay->Arguments ();
+print STDERR "Running Relay with arguments: $args\n";
+$status = $Relay->Spawn ();
+
+if (PerlACE::waitforfile_timed ($relay_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the Relay to start\n";
+ $Consumer->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Supplier returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Supplier->Kill ();
+$Consumer->Kill ();
+$Relay->Kill ();
+
+unlink $consumer_ior;
+unlink $relay_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($#ARGV > -1)
+ {
+ $results_directory = $ARGV[0];
+ print STDERR "Saving results to $results_directory\n";
+
+ mkdir $results_directory, 0777;
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf
new file mode 100644
index 00000000000..2cdad84a16a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/supplier.conf
@@ -0,0 +1,25 @@
+## $Id$
+##
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+##---- Load the Factories------
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high_relay -EventType H -Priority 2 -Period 0 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf
new file mode 100644
index 00000000000..d7b6d405f92
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/consumer.conf
@@ -0,0 +1,27 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Direct -POA poa_1"
+#
+##------- Run---------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf
new file mode 100644
index 00000000000..15313407835
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/relay.conf
@@ -0,0 +1,28 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high_relay -Relay c_high -POA poa_1"
+#
+##------- Run---------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl
new file mode 100755
index 00000000000..3fc76f501a0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl
@@ -0,0 +1,117 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+
+$experiment_timeout = 60;
+$startup_timeout = 60;
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$consumer_ior = PerlACE::LocalFile ("consumer.ior");
+$relay_ior = PerlACE::LocalFile ("relay.ior");
+
+$supplier_conf = PerlACE::LocalFile ("supplier.conf");
+$consumer_conf = PerlACE::LocalFile ("consumer.conf");
+$relay_conf = PerlACE::LocalFile ("relay.conf");
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$relay_ior -ORBSvcConf $supplier_conf";
+
+$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf";
+
+$Relay = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Relay_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $relay_ior -IORinput file://$consumer_ior -ORBSvcConf $relay_conf";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->Spawn ();
+
+if (PerlACE::waitforfile_timed ($consumer_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the consumer to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $relay_ior;
+$Relay->Arguments ($Relay_Args);
+$args = $Relay->Arguments ();
+print STDERR "Running Relay with arguments: $args\n";
+$status = $Relay->Spawn ();
+
+if (PerlACE::waitforfile_timed ($relay_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the Relay to start\n";
+ $Consumer->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Supplier returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Supplier->Kill ();
+$Consumer->Kill ();
+$Relay->Kill ();
+
+unlink $consumer_ior;
+unlink $relay_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($#ARGV > -1)
+ {
+ $results_directory = $ARGV[0];
+ print STDERR "Saving results to $results_directory\n";
+
+ mkdir $results_directory, 0777;
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf
new file mode 100644
index 00000000000..e9c9452944a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/supplier.conf
@@ -0,0 +1,26 @@
+## $Id$
+## This file has the following configuration:
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Direct c_high_relay -EventType H -Priority 1 -Period 0 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf
new file mode 100644
index 00000000000..26063b38c14
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/colocated.conf
@@ -0,0 +1,48 @@
+#$Id$
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+dynamic TAO_Notify_Service Service_Object * TAO_CosNotification_Serv:_make_TAO_CosNotify_Service () ""
+#
+##---- Load the Factories------
+#
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory COLLOCATED"
+#
+###
+### Configure Supplier and Consumer for the High Priority Path
+###
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_high ec1 -AND_OP"
+#
+### --- Create Supplier s_high connected to sa_high -----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa_high -EventType H -Priority 2 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca_high ec1 -AND_OP"
+#
+##--------- Consumer 1 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Admin ca_high"
+static Command_Builder "PeriodicConsumer -Subscription c_high +H"
+#
+##--------- Run -------------
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/run_test.pl
new file mode 100755
index 00000000000..3e171a8e216
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/run_test.pl
@@ -0,0 +1,69 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 600;
+$startup_timeout = 60;
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$collocated_conf = PerlACE::LocalFile ("colocated.conf");
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Collocated = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Collocated_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $collocated_conf -Skip_Priority_Levels_Check";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Collocated->Arguments ($Collocated_Args);
+$args = $Collocated->Arguments ();
+print STDERR "Running Collocated with arguments: $args\n";
+$status = $Collocated->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Collocated returned $status\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($#ARGV > -1)
+ {
+ $results_directory = $ARGV[0];
+ print STDERR "Saving results to $results_directory\n";
+
+ mkdir $results_directory, 0777;
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf
new file mode 100644
index 00000000000..18976ea0ad2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/colocated.conf
@@ -0,0 +1,55 @@
+#$Id$
+#
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+#
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
+#
+##---- Load the Factories------
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory COLLOCATED"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+###
+### Configure Supplier and Consumer for the High Priority Path
+###
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_high ec1 -AND_OP"
+#
+### --- Create Supplier s_high connected to sa_high -----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa_high -EventType H -Priority 1 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca_high ec1 -AND_OP"
+#
+##--------- Consumer 1 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Admin ca_high -POA poa_1"
+static Command_Builder "PeriodicConsumer -Subscription c_high +H"
+#
+##--------- Run -------------
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/run_test.pl
new file mode 100755
index 00000000000..c24ea4c7cbe
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/run_test.pl
@@ -0,0 +1,69 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+
+$experiment_timeout = 600;
+$startup_timeout = 60;
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+$collocated_conf = PerlACE::LocalFile ("colocated.conf");
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Collocated = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Collocated_Args = "-ORBInitRef NameService=file://$naming_ior -ORBSvcConf $collocated_conf";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+$Collocated->Arguments ($Collocated_Args);
+$args = $Collocated->Arguments ();
+print STDERR "Running Collocated with arguments: $args\n";
+$status = $Collocated->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Collocated returned $status\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($#ARGV > -1)
+ {
+ $results_directory = $ARGV[0];
+ print STDERR "Saving results to $results_directory\n";
+
+ mkdir $results_directory, 0777;
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf
new file mode 100644
index 00000000000..4bedda340f5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/consumer.conf
@@ -0,0 +1,28 @@
+## $Id$
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+##---- Load the Factories------
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
+#
+##--------- Consumer , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1"
+static Command_Builder "PeriodicConsumer -Subscription c_high +H"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/notify.conf
new file mode 100644
index 00000000000..61456d1a199
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/notify.conf
@@ -0,0 +1,2 @@
+dynamic TAO_Notify_Service Service_Object * TAO_CosNotification_Serv:_make_TAO_CosNotify_Service () ""
+
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl
new file mode 100755
index 00000000000..4240b4f2c2a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl
@@ -0,0 +1,167 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
+ exit 0;
+}
+
+$experiment_timeout = 120;
+$startup_timeout = 120;
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $supplier_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}
+
+if ($opt_c)
+{
+ $consumer_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../../../../Notify_Service/Notify_Service");
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+
+$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf -Skip_Priority_Levels_Check";
+
+$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -Skip_Priority_Levels_Check";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$Notification->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $supplier_ior;
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->Spawn ();
+
+if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+unlink $consumer_ior;
+
+$Supplier->Kill ();
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($opt_o)
+ {
+ $results_directory = PerlACE::LocalFile ($opt_o);
+
+ if (! -e $results_directory)
+ {
+ mkdir $results_directory, 0777;
+ }
+
+ print STDERR "Saving results to $results_directory\n";
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf
new file mode 100644
index 00000000000..7a59c06f755
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/supplier.conf
@@ -0,0 +1,33 @@
+## $Id$
+##
+#
+# Note that this test is not portable because it does not use RTCORBA.
+# All priority values are for Linux
+#
+##---- Load the Factories------
+dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 2 -Period 0 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf
new file mode 100644
index 00000000000..9b515bcb52c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/consumer.conf
@@ -0,0 +1,31 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
+#
+##--------- Consumer 3 , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Admin ca1 -POA poa_1"
+static Command_Builder "PeriodicConsumer -Subscription c_high +H"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/notify.conf
new file mode 100644
index 00000000000..a747c353448
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/notify.conf
@@ -0,0 +1,3 @@
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl
new file mode 100755
index 00000000000..2e9bbf4d9fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl
@@ -0,0 +1,170 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
+ exit 0;
+}
+
+$experiment_timeout = 120;
+$startup_timeout = 120;
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $supplier_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}
+
+if ($opt_c)
+{
+ $consumer_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$supplier_ior = PerlACE::LocalFile ("supplier.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../../../../Notify_Service/Notify_Service");
+
+#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+
+$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
+
+$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+
+$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
+#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$Notification->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $supplier_ior;
+$Supplier->Arguments ($Supplier_Args);
+$args = $Supplier->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$Supplier->Spawn ();
+
+if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the supplier to start\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $consumer_ior;
+$Consumer->Arguments ($Consumer_Args);
+$args = $Consumer->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$status = $Consumer->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Consumer returned $status\n";
+ $Supplier->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+unlink $consumer_ior;
+
+$Supplier->Kill ();
+unlink $supplier_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($opt_o)
+ {
+ $results_directory = PerlACE::LocalFile ($opt_o);
+
+ if (! -e $results_directory)
+ {
+ mkdir $results_directory, 0777;
+ }
+
+ print STDERR "Saving results to $results_directory\n";
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+
+ @list=glob("*.conf");
+ for $file (@list)
+ {
+ copy ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf
new file mode 100644
index 00000000000..81836c43a5c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/supplier.conf
@@ -0,0 +1,32 @@
+## $Id$
+##
+#
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa1 ec1 -AND_OP"
+#
+### --- Create Supplier s3 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa1 -EventType H -Priority 1 -Period 0 -Iter 50000 -Load 0 -RunTime 15"
+#
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/README b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/README
new file mode 100644
index 00000000000..1bdb2e76d15
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/README
@@ -0,0 +1,33 @@
+//$Id$
+
+Max Throughput of various configurations:
+=========================================
+
+To calculate the Maximum throughput possible, a supplier thread sends
+events in a burst to a consumer.
+
+This test runs the following configurations*:
+
+1. 2 Hops : A supplier sends events directly to a consumer.
+2. 3 Hops : A supplier sends events to a relay consumer
+ onto the final consummer.
+3. Notify : A supplier sends events via Cos Notification to a consumer.
+
+4. Collocated: A supplier sends events via a collocated
+ RT Notification to a consumer.
+
+[* Note that the payload is identical in all configurations.
+Also beware that the priority values in these tests are for Linux.
+These cannot be made portable as they do not use RTCORBA.]
+
+The RTCORBA enabled versions of these tests are:
+
+2_Hops_RTCORBA
+3_Hops_RTCORBA
+Notify_RTCORBA
+Colocated_RTCORBA
+
+Running the tests:
+=================
+
+Simply execute "perl run_all.pl" in this directory.
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/run_all.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/run_all.pl
new file mode 100755
index 00000000000..412bd93717b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/run_all.pl
@@ -0,0 +1,34 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+@list= ("2_Hops","2_Hops_RTCORBA","3_Hops","3_Hops_RTCORBA","Colocated","Colocated_RTCORBA","Notify","Notify_RTCORBA");
+
+for $file (@list)
+{
+ if (-d $file)
+ {
+ print STDERR "Running $file test\n";
+
+ $cmd = "run_test.pl";
+
+ chdir $file or die "Could not chdir to $file";
+
+ $status = system ("perl $cmd");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $file test returned $status\n";
+ }
+
+ chdir "../";
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf
new file mode 100644
index 00000000000..92cead2565b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_1/other_paths.conf
@@ -0,0 +1,42 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP"
+#
+### --- Create Supplier 1 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType O -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer Admin -------------
+static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP"
+#
+##--------- Consumer High , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_oth -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth +O"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf
new file mode 100644
index 00000000000..f79dccd419b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_10/other_paths.conf
@@ -0,0 +1,85 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+#static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+#static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP"
+#
+### --- Create Supplier 1 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType o1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType o2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_3 -Admin sa_oth -EventType o3 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_4 -Admin sa_oth -EventType o4 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_5 -Admin sa_oth -EventType o5 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_6 -Admin sa_oth -EventType o6 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_7 -Admin sa_oth -EventType o7 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_8 -Admin sa_oth -EventType o8 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_9 -Admin sa_oth -EventType o9 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_10 -Admin sa_oth -EventType o10 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer Admin -------------
+static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP"
+#
+##--------- Consumer High , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +o1"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +o2"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +o3"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_4 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_4 +o4"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_5 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_5 +o5"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_6 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_6 +o6"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_7 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_7 +o7"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_8 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_8 +o8"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_9 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_9 +o9"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_10 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_10 +o10"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+#static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats -Samples"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf
new file mode 100644
index 00000000000..e6de590526f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_20/other_paths.conf
@@ -0,0 +1,125 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+#static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+#static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP"
+#
+### --- Create Supplier 1 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType o1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType o2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_3 -Admin sa_oth -EventType o3 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_4 -Admin sa_oth -EventType o4 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_5 -Admin sa_oth -EventType o5 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_6 -Admin sa_oth -EventType o6 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_7 -Admin sa_oth -EventType o7 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_8 -Admin sa_oth -EventType o8 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_9 -Admin sa_oth -EventType o9 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_10 -Admin sa_oth -EventType o10 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_11 -Admin sa_oth -EventType o11 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_12 -Admin sa_oth -EventType o12 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_13 -Admin sa_oth -EventType o13 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_14 -Admin sa_oth -EventType o14 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_15 -Admin sa_oth -EventType o15 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_16 -Admin sa_oth -EventType o16 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_17 -Admin sa_oth -EventType o17 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_18 -Admin sa_oth -EventType o18 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_19 -Admin sa_oth -EventType o19 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_20 -Admin sa_oth -EventType o20 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer Admin -------------
+static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP"
+#
+##--------- Consumer High , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +o1"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +o2"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +o3"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_4 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_4 +o4"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_5 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_5 +o5"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_6 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_6 +o6"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_7 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_7 +o7"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_8 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_8 +o8"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_9 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_9 +o9"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_10 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_10 +o10"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_11 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_11 +o11"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_12 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_12 +o12"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_13 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_13 +o13"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_14 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_14 +o14"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_15 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_15 +o15"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_16 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_16 +o16"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_17 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_17 +o17"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_18 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_18 +o18"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_19 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_19 +o19"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_20 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_20 +o20"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+#static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats -Samples"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf
new file mode 100644
index 00000000000..4d53387c72f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_3/other_paths.conf
@@ -0,0 +1,57 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+#static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+#static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP"
+#
+### --- Create Supplier 1 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType O1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType O2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_3 -Admin sa_oth -EventType O3 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer Admin -------------
+static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP"
+#
+##--------- Consumer High , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +O1"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +O2"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +O3"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+#static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats -Samples"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf
new file mode 100644
index 00000000000..b3eed2c65d4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/Paths_5/other_paths.conf
@@ -0,0 +1,65 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+#
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+#
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+#
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+#
+##------- Create Event Channel ---------------
+#static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+#static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0"
+#
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_oth ec1 -AND_OP"
+#
+### --- Create Supplier 1 connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_oth_1 -Admin sa_oth -EventType O1 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_2 -Admin sa_oth -EventType O2 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_3 -Admin sa_oth -EventType O3 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_4 -Admin sa_oth -EventType O4 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+static Command_Builder "PeriodicSupplier -Create s_oth_5 -Admin sa_oth -EventType O5 -Priority 1 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+#
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_oth -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 1 1 0"
+#
+##--------- Consumer Admin -------------
+static Command_Builder "ConsumerAdmin -Create ca_oth ec1 -AND_OP"
+#
+##--------- Consumer High , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_oth_1 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_1 +O1"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_2 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_2 +O2"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_3 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_3 +O3"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_4 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_4 +O4"
+#
+static Command_Builder "PeriodicConsumer -Create c_oth_5 -Admin ca_oth -POA poa_oth"
+static Command_Builder "PeriodicConsumer -Subscription c_oth_5 +O5"
+#
+##------- Run---------
+static Command_Builder "Application -SignalPeer"
+#static Command_Builder "Application -WaitToStart"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats -Samples"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/README b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/README
new file mode 100644
index 00000000000..fdae31ca91a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/README
@@ -0,0 +1,37 @@
+# $Id$
+
+Number of Paths vs Throughput of High Priority Path with period = 10ms
+and Load = 30
+=======================================================================
+
+In this experiment we have 1 high priority path and several low
+priority paths sending events over the Notification Service.
+
+We increase the number of low priority paths as 1, 5, 10 and 20 and
+measure the throughput.
+
+Running the experiment:
+======================
+
+Run the "run_all.pl" script in this directory to run the test using RT-Notification.
+as "run_all.pl --rt"
+
+If you want to generate results using the CosNotification, run as
+"run_all.pl --cos"
+
+To generate the data for both cases run as "run_all.pl --all"
+
+The RT-Notification results are generated in the Paths_X/rt_output directory.
+The CosNotification results are generated in the Paths_X/cos_output directory.
+
+e.g., Paths_5/rt_output/c_oth_1.dat would contain the statistics
+recorded for consumer #1 of the set of 5 paths.
+
+
+Expected Results:
+================
+
+For RT-Notification: The Throughput of the high priority task should remain at 100Hz. while
+the remaining paths should share the remainder of the capacity.
+
+For CosNotification: The throughput of *all* the paths is shared. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/cos_notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/cos_notify.conf
new file mode 100644
index 00000000000..0515ecbd0db
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/cos_notify.conf
@@ -0,0 +1,2 @@
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_CosNotification_Serv:_make_TAO_CosNotify_Service () ""
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/high_path.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/high_path.conf
new file mode 100644
index 00000000000..093a1f720c7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/high_path.conf
@@ -0,0 +1,49 @@
+## $Id$
+##---- Load the Factories------
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+
+dynamic TAO_Notify_Tests_RT_Application_Command_Factory Service_Object * TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_Application_Command_Factory () ""
+##dynamic TAO_Notify_Tests_Application_Command_Factory Service_Object * TAO_NotifyTests:_make_TAO_Notify_Tests_Application_Command_Factory () ""
+
+dynamic TAO_Notify_Tests_EventChannel_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_EventChannel_Command_Factory () ""
+
+dynamic TAO_Notify_Tests_SupplierAdmin_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_SupplierAdmin_Command_Factory () ""
+
+dynamic TAO_Notify_Tests_Periodic_Supplier_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Supplier_Command_Factory () ""
+
+dynamic TAO_Notify_Tests_ConsumerAdmin_Command_Factory Service_Object *TAO_NotifyTests:_make_TAO_Notify_Tests_ConsumerAdmin_Command_Factory () ""
+
+dynamic TAO_Notify_Tests_Periodic_Consumer_Command_Factory Service_Object* TAO_NotifyTests:_make_TAO_Notify_Tests_Periodic_Consumer_Command_Factory () ""
+
+dynamic TAO_Notify_Tests_RT_POA_Command_Factory Service_Object* TAO_RT_NotifyTests:_make_TAO_Notify_Tests_RT_POA_Command_Factory () ""
+
+##------- Init the Application Object ----------
+static Command_Builder "Application -Init"
+
+##------- Create Event Channel ---------------
+static Command_Builder "EventChannel -Create ec1 NotifyEventChannelFactory"
+static Command_Builder "EventChannel -Set_QoS ec1 -Lanes 3 -Lane 0 1 0 -Lane 1 1 0 -Lane 3 1 0"
+
+### --- Create Supplier Admin 1 ----
+static Command_Builder "SupplierAdmin -Create sa_high ec1 -AND_OP"
+
+### --- Create Supplier High connected to sa1 ----
+static Command_Builder "PeriodicSupplier -Create s_high -Admin sa_high -EventType H -Priority 3 -Period 10000 -Iter 50000 -Load 30 -RunTime 15"
+
+##----------- Create an RT POA to host local consumer objects-----------
+static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -Lanes 2 -Lane 0 1 0 -Lane 3 1 0"
+
+##--------- Consumer Admin 1 -------------
+static Command_Builder "ConsumerAdmin -Create ca_high ec1 -AND_OP"
+
+##--------- Consumer High , connected to CA 1 --------
+static Command_Builder "PeriodicConsumer -Create c_high -Admin ca_high -POA poa_1"
+static Command_Builder "PeriodicConsumer -Subscription c_high +H"
+
+##--------- Run -------------
+static Command_Builder "Application -WaitToStart"
+#static Command_Builder "Application -SignalPeer"
+static Command_Builder "Application -Run"
+static Command_Builder "Application -WaitForEvents"
+static Command_Builder "Application -DumpStats -Samples"
+static Command_Builder "Application -Shutdown"
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/rt_notify.conf b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/rt_notify.conf
new file mode 100644
index 00000000000..a747c353448
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/rt_notify.conf
@@ -0,0 +1,3 @@
+dynamic TAO_RT_ORB_Loader Service_Object *TAO_RTCORBA:_make_TAO_RT_ORB_Loader () "-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy PROCESS -ORBPriorityMapping continuous"
+dynamic TAO_Notify_Factory Service_Object * TAO_CosNotification_Serv:_make_TAO_Notify_Default_Factory () ""
+dynamic TAO_Notify_Service Service_Object * TAO_RT_Notification:_make_TAO_RT_Notify_Service () ""
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_all.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_all.pl
new file mode 100755
index 00000000000..58a38971c4d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_all.pl
@@ -0,0 +1,58 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Long;
+
+GetOptions ("rt" => \$rt,
+ "cos" => \$cos,
+ "all" => \$all);
+
+@list=("Paths_1", "Paths_3","Paths_5","Paths_10","Paths_20");
+
+for $file (@list)
+{
+ # default to rt
+ if (!$all && !$rt && !$cos)
+ {
+ $rt = 1;
+ }
+
+ if (-d $file)
+ {
+ if ($all || $rt)
+ {
+ print STDERR "Running $file test with RT Notification\n";
+
+ $cmd = "run_test.pl -n rt_notify.conf -s high_path.conf -c $file/other_paths.conf -o $file/rt_output";
+
+ $status = system ("perl $cmd");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $file test returned $status\n";
+ }
+ }
+
+
+ if ($all || $cos)
+ {
+ print STDERR "Running $file test with COS Notification\n";
+
+ $cmd = "run_test.pl -n cos_notify.conf -s high_path.conf -c $file/other_paths.conf -o $file/cos_output";
+
+ $status = system ("perl $cmd");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $file test returned $status\n";
+ }
+ }
+ }
+}
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl
new file mode 100755
index 00000000000..494971e3f9b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl
@@ -0,0 +1,109 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h\n";
+ exit 0;
+}
+
+$experiment_timeout = 120;
+$startup_timeout = 120;
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $high_path_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+}
+
+if ($opt_c)
+{
+ $other_paths_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$high_path_ior = PerlACE::LocalFile ("high_path.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+
+$High_path = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$High_path_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $high_path_ior -ORBSvcConf $high_path_conf";
+
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ exit 1;
+}
+
+unlink $high_path_ior;
+$High_path->Arguments ($High_path_Args);
+$args = $High_path->Arguments ();
+print STDERR "Running High_path with arguments: $args\n";
+$status = $High_path->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Other_paths returned $status\n";
+ $High_path->Kill ();
+
+ exit 1;
+ }
+
+if ($opt_o)
+ {
+ $results_directory = PerlACE::LocalFile ($opt_o);
+
+ if (! -e $results_directory)
+ {
+ mkdir $results_directory, 0777;
+ }
+
+ print STDERR "Saving results to $results_directory\n";
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ move ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl
new file mode 100755
index 00000000000..7d7537fe0f2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl
@@ -0,0 +1,98 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h\n";
+ exit 0;
+}
+
+$experiment_timeout = 600;
+$startup_timeout = 120;
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $high_path_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+}
+
+if ($opt_c)
+{
+ $other_paths_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$high_path_ior = PerlACE::LocalFile ("high_path.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
+
+#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$status = $Notification->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Other_paths returned $status\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl
new file mode 100755
index 00000000000..4fabf89d8e5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl
@@ -0,0 +1,111 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h\n";
+ exit 0;
+}
+
+$experiment_timeout = 120;
+$startup_timeout = 120;
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $high_path_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+}
+
+if ($opt_c)
+{
+ $other_paths_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$high_path_ior = PerlACE::LocalFile ("high_path.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+$Other_paths = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$Other_paths_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$high_path_ior -ORBSvcConf $other_paths_conf";
+
+#$Other_paths_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$high_path_ior -ORBSvcConf $other_paths_conf -ORBDebugLevel 1";
+
+if (PerlACE::waitforfile_timed ($high_path_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the high_path to start\n";
+
+ exit 1;
+}
+
+unlink $other_paths_ior;
+$Other_paths->Arguments ($Other_paths_Args);
+$args = $Other_paths->Arguments ();
+print STDERR "Running Other_paths with arguments: $args\n";
+$status = $Other_paths->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Other_paths returned $status\n";
+
+ exit 1;
+ }
+
+unlink $other_paths_ior;
+
+if ($opt_o)
+ {
+ $results_directory = PerlACE::LocalFile ($opt_o);
+
+ if (! -e $results_directory)
+ {
+ mkdir $results_directory, 0777;
+ }
+
+ print STDERR "Saving results to $results_directory\n";
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ move ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl
new file mode 100755
index 00000000000..c2024550025
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl
@@ -0,0 +1,167 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../../bin";
+use PerlACE::Run_Test;
+use File::Copy;
+use Getopt::Std;
+
+# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
+getopts ("n:s:c:o:h");
+
+if ($opt_h)
+{
+ print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h -d\n";
+ exit 0;
+}
+
+$experiment_timeout = 300;
+$startup_timeout = 300;
+$debug = "";
+
+if ($opt_d)
+{
+ $debug = "-ORBDebugLevel 1"
+}
+
+if ($opt_n)
+{
+ $notify_conf = PerlACE::LocalFile ($opt_n);
+
+}else
+{
+ $notify_conf = PerlACE::LocalFile ("notify.conf");
+}
+
+if ($opt_s)
+{
+ $high_path_conf = PerlACE::LocalFile ($opt_s);
+
+}else
+{
+ $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+}
+
+if ($opt_c)
+{
+ $other_paths_conf = PerlACE::LocalFile ($opt_c);
+
+}else
+{
+ $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
+}
+
+$notify_ior = PerlACE::LocalFile ("notify.ior");
+
+$naming_ior = PerlACE::LocalFile ("naming.ior");
+
+$high_path_ior = PerlACE::LocalFile ("high_path.ior");
+
+@list=glob("*.dat");
+for $file (@list)
+{
+ unlink $file or die "Could not delete $file";
+}
+
+$status = 0;
+
+$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
+ "-o $naming_ior");
+
+$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
+
+$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf $debug";
+
+$High_path = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$High_path_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $high_path_ior -ORBSvcConf $high_path_conf $debug";
+
+$Other_paths = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+
+$Other_paths_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$high_path_ior -ORBSvcConf $other_paths_conf $debug";
+
+unlink $naming_ior;
+$Naming->Spawn ();
+
+if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the naming service to start\n";
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $notify_ior;
+$Notification->Arguments ($Notify_Args);
+$args = $Notification->Arguments ();
+print STDERR "Running Notification with arguments: $args\n";
+$Notification->Spawn ();
+
+if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $high_path_ior;
+$High_path->Arguments ($High_path_Args);
+$args = $High_path->Arguments ();
+print STDERR "Running High_path with arguments: $args\n";
+$High_path->Spawn ();
+
+if (PerlACE::waitforfile_timed ($high_path_ior, $startup_timeout) == -1) {
+ print STDERR "ERROR: waiting for the high_path to start\n";
+ $High_path->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+}
+
+unlink $other_paths_ior;
+$Other_paths->Arguments ($Other_paths_Args);
+$args = $Other_paths->Arguments ();
+print STDERR "Running Other_paths with arguments: $args\n";
+$status = $Other_paths->SpawnWaitKill ($experiment_timeout);
+
+if ($status != 0)
+ {
+ print STDERR "ERROR: Other_paths returned $status\n";
+ $High_path->Kill ();
+ $Notification->Kill ();
+ $Naming->Kill ();
+ exit 1;
+ }
+
+unlink $other_paths_ior;
+
+$High_path->Wait ();
+unlink $high_path_ior;
+
+$Notification->Kill ();
+unlink $notify_ior;
+
+$Naming->Kill ();
+unlink $naming_ior;
+
+if ($opt_o)
+ {
+ $results_directory = PerlACE::LocalFile ($opt_o);
+
+ if (! -e $results_directory)
+ {
+ mkdir $results_directory, 0777;
+ }
+
+ print STDERR "Saving results to $results_directory\n";
+
+ @list=glob("*.dat");
+ for $file (@list)
+ {
+ move ("$file", "$results_directory/$file");
+ }
+ }
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/README b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/README
new file mode 100644
index 00000000000..916cae33bba
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/README
@@ -0,0 +1,12 @@
+
+This directory contains various experiments for the RT-Notification
+and CosNotification Service.
+
+The experiments are specified in terms of directives to Service
+Objects in a .conf file. The $TAO_ROOT/orbsvcs/tests/Notify/lib
+directory contains the library that specifies various Service Objects
+to configure the experiments.
+
+Running the tests:
+
+simple say "run_all.pl" in this directory to run all the experiments. \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/run_all.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/run_all.pl
new file mode 100755
index 00000000000..07e8de0f78a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/run_all.pl
@@ -0,0 +1,50 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../../../bin";
+use PerlACE::Run_Test;
+use Getopt::Std;
+
+@list= (
+ {
+ dir_name => "1_Path_Period_0_Lanes",
+ cmd => "perl run_all.pl --all",
+ },
+ {
+ dir_name => "3_Path_Period_10ms_Lanes",
+ cmd => "perl run_all.pl --all",
+ },
+ {
+ dir_name => "Paths_vs_Throughput",
+ cmd => "perl run_all.pl --all",
+ },
+ {
+ dir_name => "Max_Throughput",
+ cmd => "perl run_all.pl",
+ },
+ );
+
+for $test (@list)
+{
+ if (-d $test->{dir_name})
+ {
+ print STDERR "Running $test->{dir_name} test\n";
+
+ $cmd = "run_test.pl";
+
+ chdir $test->{dir_name} or die "Could not chdir to $test->{dir_name}";
+
+ $status = system ("$test->{cmd}");
+
+ if ($status != 0)
+ {
+ print STDERR "ERROR: $test->{dir_name} test returned $status\n";
+ }
+
+ chdir "../";
+ }
+}
diff --git a/TAO/orbsvcs/tests/Property/Makefile.am b/TAO/orbsvcs/tests/Property/Makefile.am
new file mode 100644
index 00000000000..689e58209a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/Makefile.am
@@ -0,0 +1,78 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Property_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp \
+ client.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.Property_Server.am
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ server.cpp \
+ server.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Serv.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosProperty.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Property/Property.mpc b/TAO/orbsvcs/tests/Property/Property.mpc
new file mode 100644
index 00000000000..6e8b8e678f8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/Property.mpc
@@ -0,0 +1,15 @@
+// -*- MPC -*-
+// $Id$
+
+project(*server): namingexe, property_serv, utils {
+ Source_Files {
+ server.cpp
+ }
+}
+
+project(*client): namingexe, property, utils {
+ Source_Files {
+ client.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Property/README b/TAO/orbsvcs/tests/Property/README
new file mode 100644
index 00000000000..6ff16d26744
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/README
@@ -0,0 +1,42 @@
+This tests TAO's CosPropertyService implementation.
+
+Please report bugs/comments to <alex@cs.wustl.edu> and
+ <ace-users@cs.wustl.edu>
+
+To compile:
+==========
+
+% make realclean all
+
+
+To run:
+======
+
+% run_test.pl
+
+OR
+
+Run the each of NamingService, Server and Client separately within the
+same host.
+
+
+Naming Service:
+--------------
+
+% $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service [-ORBnameserviceport <portnum>]
+
+Server:
+-----
+
+% server [-ORBnameserviceport <portnum>]
+
+Client:
+------
+% client [-ORBnameserviceport <portnum>]
+
+<portnum> is same everywhere.
+
+
+Expected Result:
+----------------
+If everything goes well, client prints "Test Succeeded".
diff --git a/TAO/orbsvcs/tests/Property/client.cpp b/TAO/orbsvcs/tests/Property/client.cpp
new file mode 100644
index 00000000000..bfc5efa2dd0
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/client.cpp
@@ -0,0 +1,763 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Property
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// Test client for the Property Service.
+//
+// = AUTHORS
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "client.h"
+#include "tao/debug.h"
+
+ACE_RCSID(CosPropertyService, client, "$Id$")
+
+ Client::Client (void)
+{
+}
+
+int
+Client::init (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL)
+{
+ // Init the ORB.
+ manager_.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Initialize the naming services
+ if (my_name_client_.init (manager_.orb()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ // Bind PropertySetDef Object.
+
+ CosNaming::Name propsetdef_name (1);
+ propsetdef_name.length (1);
+ propsetdef_name [0].id = CORBA::string_dup ("PropertySetDef");
+ CORBA::Object_var propsetdef_obj = my_name_client_->resolve (propsetdef_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ this->propsetdef_ = CosPropertyService::PropertySetDef::_narrow (propsetdef_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (this->propsetdef_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Could not resolve propsetdef in Naming server"),
+ -1);
+
+ return 0;
+}
+
+// Testing the methods of the property service.
+
+int
+Client::property_tester (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // = Testing PropertySet & Iterators.
+
+ // Testing define_property () of PropertySet interface.
+ this->test_define_property (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Test the number of properties.
+ this->test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Testing get_all_property_names.
+ this->test_get_all_property_names (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Test get_property_value.
+ this->test_get_property_value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Testing delete property.
+ this->test_delete_property ("no_property" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Testing get_properties.
+ this->test_get_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Testing delete_properties.
+ this->test_delete_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Test the number of properties.
+ this->test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Testing define_properties.
+ this->test_define_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Test the number of properties.
+ this->test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Testing get_all_property_names.
+ this->test_get_all_property_names (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Testing get_all_properties.
+ this->test_get_all_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // = Testing PropertySetDef & Iterators.
+
+ // Testing define_property_with_mode.
+ this->test_define_property_with_mode (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+// Testing define_property.
+
+int
+Client::test_define_property (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any anyval;
+
+ // Prepare a char and "define" that in the PropertySet.
+ CORBA::Char ch = '#';
+ anyval <<= CORBA::Any::from_char (ch);
+ ch = '*';
+ anyval >>= CORBA::Any::to_char (ch);
+
+ this->propsetdef_->define_property ("char_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Prepare a Short and "define" that in the PropertySet.
+ CORBA::Short s = 3;
+ anyval <<= s;
+ s = 7;
+ anyval >>= s;
+
+ propsetdef_->define_property ("short_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Prepare a Long and "define" that in the PropertySet.
+ CORBA::Long l = 931232;
+ anyval <<= l;
+ l = 931233;
+ anyval >>= l;
+ CORBA::Any newany(anyval);
+ propsetdef_->define_property ("long_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Prepare a Float and "define" that in the PropertySet.
+ CORBA::Float f = 3.14F;
+ anyval <<= f;
+ f = 4.14F;
+ anyval >>= f;
+
+ propsetdef_->define_property ("float_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ // Prepare a String and "define" that in the PropertySet.
+ CORBA::String_var strvar (CORBA::string_dup ("Test_String"));
+ anyval <<= strvar.in ();
+ const char * newstr;
+ anyval >>= newstr;
+ propsetdef_->define_property ("string_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+// Testing get_all_property_names of the PropertySet.
+
+int
+Client::test_get_all_property_names (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get the size.
+ CORBA::ULong num_of_properties =
+ propsetdef_->get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Get half on the names and half of on the iterator.
+ CORBA::ULong how_many = num_of_properties / 2;
+
+ // The extra ptr's and out's required to avoind SunnCC's warning
+ // when foo.out () is passed to a funtion.
+ CosPropertyService::PropertyNames_var names_var;
+ CosPropertyService::PropertyNames *names_ptr = 0;
+ CosPropertyService::PropertyNames_out names_out (names_ptr);
+
+ CosPropertyService::PropertyNamesIterator_var iterator_var;
+ CosPropertyService::PropertyNamesIterator_ptr iterator_ptr;
+ CosPropertyService::PropertyNamesIterator_out iterator_out (iterator_ptr);
+
+ propsetdef_->get_all_property_names (how_many,
+ names_out,
+ iterator_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Get the values back to var.
+ names_var = names_out.ptr ();
+ iterator_var = iterator_out.ptr ();
+
+ // Print out the names in the names-sequence.
+ if (TAO_debug_level > 0)
+ {
+ if (names_var.ptr () != 0)
+ {
+ CORBA::ULong len = names_var->length ();
+
+ for (CORBA::ULong ni = 0; ni < len; ni++)
+ ACE_DEBUG ((LM_DEBUG,
+ "%s\n",
+ (const char *) names_var [ni]));
+ }
+
+ // Iterate thru and print out the names in the iterator, if any.
+ if (iterator_var.ptr () != 0)
+ {
+ // Helper variables to stop the SunCC warnings on on foo.out
+ // ().
+ CosPropertyService::PropertyName name_ptr = 0;
+ CosPropertyService::PropertyName_out name_out (name_ptr);
+
+ // Call the function.
+ CORBA::Boolean next_one_result = iterator_var->next_one (name_out ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Get the values back on a _var variable.
+ CosPropertyService::PropertyName_var name_var = name_out.ptr ();
+
+ while (next_one_result == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%s\n", name_var.in ()));
+
+ // Call the function to iterate again.
+ next_one_result = iterator_var->next_one (name_out ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Get the values back on a _var variable.
+ name_var = name_out.ptr ();
+ }
+
+ ACE_CHECK_RETURN (-1);
+ }
+ }
+ return 0;
+}
+
+// Test get_properties. Give a sequence of names and get all their
+// properties.
+
+int
+Client::test_get_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get float_property, string_property and no_property. If return
+ // value is false and type is tc_void then that name is not there in
+ // the PropertySet.
+ CosPropertyService::PropertyNames_var names;
+ CosPropertyService::PropertyNames *names_ptr;
+
+ ACE_NEW_RETURN (names_ptr,
+ CosPropertyService::PropertyNames,
+ -1);
+ names = names_ptr;
+
+ names->length (3);
+ names [0u] = CORBA::string_dup ("float_property");
+ //names [1] = CORBA::string_dup ("string_property");
+ names [1u] = CORBA::string_dup ("long_property");
+ names [2u] = CORBA::string_dup ("char_property");
+ //names [2] = CORBA::string_dup ("no_property");
+
+
+ CosPropertyService::Properties *properties_ptr = 0;
+ CosPropertyService::Properties_out properties_out (properties_ptr);
+
+ // Get the properties.
+ CORBA::Boolean return_val = propsetdef_->get_properties (names.in (),
+ properties_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_UNUSED_ARG (return_val);
+ ACE_CHECK_RETURN (-1);
+
+
+ if (TAO_debug_level > 0)
+ {
+ // Get the value to the _var.
+ CosPropertyService::Properties_var properties = properties_out.ptr ();
+
+ if (properties.ptr () != 0)
+ {
+ // Go thru the properties and print them out, if they are not
+ // _tc_void typed values.
+ CORBA::ULong len = properties->length ();
+
+ for (CORBA::ULong pi = 0; pi < len; pi++)
+ {
+ // Print the name.
+ ACE_DEBUG ((LM_DEBUG,
+ "%s : ",
+ (const char *) properties [pi].property_name.in ()));
+
+ // Print the value.
+ CORBA::Char char_val;
+ CORBA::Long long_val;
+ CORBA::ULong ulong_val;
+ CORBA::Float float_val;
+ CORBA::Double double_val;
+ const char * string_val;
+
+ if (properties [pi].property_value >>=
+ CORBA::Any::to_char (char_val))
+ {
+ ACE_DEBUG ((LM_DEBUG, "%c\n", char_val));
+ }
+ else if (properties [pi].property_value >>= long_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%d\n", long_val));
+ }
+ else if (properties [pi].property_value >>= ulong_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%ld\n", ulong_val));
+ }
+ else if (properties [pi].property_value >>= float_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%f\n", long_val));
+ }
+ else if (properties [pi].property_value >>= double_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%f\n", double_val));
+ }
+ else if (properties [pi].property_value >>= string_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%s\n", string_val));
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+// Testing, get_number_of_properties.
+
+int
+Client::test_get_number_of_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::ULong nproperties = this->propsetdef_->get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "\nNumber of props : %d\n",
+ nproperties));
+ }
+ return 0;
+}
+
+// Test delete_property.
+
+int
+Client::test_delete_property (const char *property_name
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CORBA::String_var property_name_var (property_name);
+
+ this->propsetdef_->delete_property (property_name_var.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::UserException, ex)
+ {
+ // For no property, it is ok to get the user exception.
+ return 0;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ex, "Not an user exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+// Test delete_properties.
+// Make a sequence of property names and delete them from the
+// PropertySet. Deleting char, short, long, float and string
+// properties.
+
+int
+Client::test_delete_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosPropertyService::PropertyNames prop_names;
+ prop_names.length (3);
+ prop_names [0] = CORBA::string_dup ("char_property");
+ prop_names [1] = CORBA::string_dup ("short_property");
+ prop_names [2] = CORBA::string_dup ("long_property");
+ // prop_names [3] = CORBA::string_dup ("no_property");
+ this->propsetdef_->delete_properties (prop_names
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 0);
+
+ return 0;
+}
+
+// Defines a sequnce of properties containing, char, short, long,
+// float in the property set.
+
+int
+Client::test_define_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CosPropertyService::Properties nproperties;
+ nproperties.length (4);
+ CORBA::Any anyval;
+ // Prepare a char and "define" that in the PropertySet.
+ CORBA::Char ch = '#';
+ anyval <<= CORBA::Any::from_char (ch);
+ ch = '*';
+ anyval >>= CORBA::Any::to_char (ch);
+ nproperties[0].property_name = CORBA::string_dup ("char_property");
+ nproperties[0].property_value <<= CORBA::Any::from_char (ch);
+
+ // Prepare a Short and "define" that in the PropertySet.
+ CORBA::Short s = 3;
+ anyval <<= s;
+ s = 7;
+ anyval >>= s;
+ nproperties[1].property_name = CORBA::string_dup ("short_property");
+ nproperties[1].property_value <<= s;
+
+ // Prepare a Long and "define" that in the PropertySet.
+ CORBA::Long l = 931232;
+ anyval <<= l;
+ l = 931233;
+ anyval >>= l;
+ nproperties[2].property_name = CORBA::string_dup ("long_property");
+ nproperties[2].property_value <<= l;
+
+ // Prepare a Float and "define" that in the PropertySet.
+ CORBA::Float f = 3.14F;
+ anyval <<= f;
+ f = 4.14F;
+ anyval >>= f;
+ nproperties[3].property_name = CORBA::string_dup ("float_property");
+ nproperties[3].property_value <<= f;
+
+ // Define this sequence of properties now.
+ this->propsetdef_->define_properties (nproperties ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( -1);
+
+ return 0;
+}
+
+// Test get_all_properties.
+
+int
+Client::test_get_all_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Get the number of current properties.
+ CORBA::ULong num_of_properties =
+ this->propsetdef_->get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( -1);
+ ACE_UNUSED_ARG (num_of_properties);
+
+ // Get half on the properties and half of on the iterator.
+ CORBA::ULong how_many = 1;
+
+ // Helper variables to avoid SunCC warnings.
+ CosPropertyService::Properties *properties_ptr = 0;
+ CosPropertyService::Properties_out properties_out (properties_ptr);
+ CosPropertyService::PropertiesIterator_ptr iterator_ptr = 0;
+ CosPropertyService::PropertiesIterator_out iterator_out (iterator_ptr);
+
+ propsetdef_->get_all_properties (how_many,
+ properties_out,
+ iterator_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( -1);
+
+ // Get these values to the _var's.
+ CosPropertyService::Properties_var properties = properties_out.ptr ();
+ CosPropertyService::PropertiesIterator_var iterator = iterator_out.ptr ();
+
+ // Print out the properties now.
+ if (TAO_debug_level > 0)
+ {
+ if (properties.ptr () != 0)
+ {
+ CORBA::ULong len = properties->length ();
+
+ for (CORBA::ULong pi = 0; pi < len; pi++)
+ {
+ // Print the property_name.
+ ACE_DEBUG ((LM_DEBUG,
+ "%s : ",
+ properties [pi].property_name.in ()));
+
+ // Print the value if type is not tk_void.
+ if (properties [pi].property_value.type () == CORBA::_tc_void)
+ ACE_DEBUG ((LM_DEBUG,"Void\n"));
+
+ if (properties [pi].property_value.type () == CORBA::_tc_float)
+ {
+ CORBA::Float f;
+ properties [pi].property_value >>= f;
+ ACE_DEBUG ((LM_DEBUG,"%f\n", f));
+ }
+
+ if (properties [pi].property_value.type () == CORBA::_tc_string)
+ {
+ const char* str;
+ properties [pi].property_value >>= str;
+ ACE_DEBUG ((LM_DEBUG,"%s\n", str));
+ }
+
+ if (properties [pi].property_value.type () == CORBA::_tc_long)
+ {
+ CORBA::Long l;
+ properties [pi].property_value >>= l;
+ ACE_DEBUG ((LM_DEBUG,"%d\n", l));
+ }
+ }
+ }
+
+ // Pass thru the iterator.
+ if (iterator.ptr () != 0)
+ {
+ // Helper variables to avoid warnings with .out () in SunCC.
+ CosPropertyService::Property* property_ptr = 0;
+ CosPropertyService::Property_out property_out (property_ptr);
+
+ // Call the funtion.
+ CORBA::Boolean next_one_result = iterator->next_one (property_out
+ ACE_ENV_ARG_PARAMETER);
+
+ // Get the value to the _var variable.
+ CosPropertyService::Property_var property = property_out.ptr ();
+
+ while (next_one_result != 0)
+ {
+ ACE_CHECK_RETURN ( -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "%s : ",
+ property->property_name.in ()));
+
+ // Print the property_value.
+ if (property->property_value.type () == CORBA::_tc_char)
+ {
+ CORBA::Char c;
+ property->property_value >>= CORBA::Any::to_char (c);
+ ACE_DEBUG ((LM_DEBUG,"%c\n", c));
+ }
+
+ if (property->property_value.type () == CORBA::_tc_short)
+ {
+ CORBA::Short s;
+ property->property_value >>= s;
+ ACE_DEBUG ((LM_DEBUG,"%d\n", s));
+ }
+
+ if (property->property_value.type () == CORBA::_tc_float)
+ {
+ CORBA::Float f;
+ property->property_value >>= f;
+ ACE_DEBUG ((LM_DEBUG,"%f\n", f));
+ }
+
+ if (property->property_value.type () == CORBA::_tc_string)
+ {
+ const char* str;
+ property->property_value >>= str;
+ ACE_DEBUG ((LM_DEBUG,"%s\n", str));
+ }
+
+ if (property->property_value.type () == CORBA::_tc_long)
+ {
+ CORBA::Long l;
+ property->property_value >>= l;
+ ACE_DEBUG ((LM_DEBUG,"%d\n", l));
+ }
+
+ // Call the function for the next iteraton.
+ next_one_result = iterator->next_one (property_out
+ ACE_ENV_ARG_PARAMETER);
+
+ // Get the value to the _var variable.
+ property = property_out.ptr ();
+ }
+ ACE_CHECK_RETURN ( -1);
+ }
+ }
+ return 0;
+}
+
+// Testing define property with mode.
+// Defines char, short, long and float properties with different modes.
+int
+Client::test_define_property_with_mode (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::Any anyval;
+
+ // Prepare a char and "define" that in the PropertySet.
+ CORBA::Char ch = '#';
+ anyval <<= CORBA::Any::from_char (ch);
+ ch = '*';
+ anyval >>= CORBA::Any::to_char (ch);
+
+ this->propsetdef_->define_property_with_mode ("char_property",
+ anyval,
+ CosPropertyService::normal
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Prepare a Short and "define" that in the PropertySet.
+ CORBA::Short s = 3;
+ anyval <<= s;
+ s = 7;
+ anyval >>= s;
+
+ propsetdef_->define_property_with_mode ("short_property",
+ anyval,
+ CosPropertyService::read_only
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Prepare a Long and "define" that in the PropertySet.
+ CORBA::Long l = 931232;
+ anyval <<= l;
+ l = 931233;
+ anyval >>= l;
+ CORBA::Any newany(anyval);
+ propsetdef_->define_property_with_mode ("long_property",
+ anyval,
+ CosPropertyService::fixed_normal
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( -1);
+
+
+ // Prepare a Float and "define" that in the PropertySet.
+ CORBA::Float f = 3.14F;
+ anyval <<= f;
+ f = 4.14F;
+ anyval >>= f;
+ propsetdef_->define_property_with_mode ("float_property",
+ anyval,
+ CosPropertyService::fixed_readonly
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( -1);
+
+ // Prepare a String and "define" that in the PropertySet.
+ CORBA::String_var strvar (CORBA::string_dup ("Test_String"));
+ anyval <<= strvar.in ();
+ const char* newstr;
+ anyval >>= newstr;
+
+ propsetdef_->define_property ("string_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( -1);
+
+ return 0;
+}
+
+int
+Client::test_get_property_value (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ // Get the ior property.
+ CORBA::Any_ptr any_ptr = this->propsetdef_->get_property_value ("PropertySetDef_IOR"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check whether the IOR is fine.
+ CORBA::Object_var propsetdef_object;
+ (*any_ptr) >>= CORBA::Any::to_object (propsetdef_object.out ());
+
+ CosPropertyService::PropertySetDef_var propsetdef =
+ CosPropertyService::PropertySetDef::_narrow (propsetdef_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (propsetdef.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "invalid object reference\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "get_property_value");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ Client client;
+
+ if (client.init (argc,
+ argv
+ ACE_ENV_ARG_PARAMETER) == -1)
+ return 1;
+ ACE_TRY_CHECK;
+
+ // client.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ int ret = client.property_tester (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (ret != 0)
+ ACE_DEBUG ((LM_DEBUG, "Test failed\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG, "Test succeeded\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "PropertyService Test : client");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Property/client.h b/TAO/orbsvcs/tests/Property/client.h
new file mode 100644
index 00000000000..2d0f0760c99
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/client.h
@@ -0,0 +1,107 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Property
+//
+// = FILENAME
+// client.h
+//
+// = DESCRIPTION
+// Test client for the Property Service.
+//
+// = AUTHORS
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef PROPERTY_CLIENT_H
+#define PROPERTY_CLIENT_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Task.h"
+#include "ace/Thread_Manager.h"
+#include "ace/Get_Opt.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "orbsvcs/Property/CosPropertyService_i.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+
+class Client
+{
+ // = TITLE
+ // Client for A/V Streams demo.
+ //
+ // = DESCRIPTION
+ // Encapsulates client functionality.
+public:
+ Client (void);
+ // Constructor.
+
+ int init (int argc,
+ char **argv
+ ACE_ENV_ARG_DECL);
+ // Initialize the ORB etc, and bind the MMDevices.
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Run the client. This will call StreamCtrl::bind_devs.
+
+ int property_tester (ACE_ENV_SINGLE_ARG_DECL);
+ // Testing the property service methods.
+
+protected:
+ int bind_to_remote_mmdevice (int argc,
+ char *argv[]
+ ACE_ENV_ARG_DECL);
+ // Bind to the remote MMDevice.
+
+ // = Property Testing.
+
+ int test_define_property (ACE_ENV_SINGLE_ARG_DECL);
+ // Testing the define property method.
+
+ int test_get_number_of_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Testing the number of properties, currently in the Property Set.
+
+ int test_get_all_property_names (ACE_ENV_SINGLE_ARG_DECL);
+ //Testing get_all_property_names.
+
+ int test_get_property_value (ACE_ENV_SINGLE_ARG_DECL);
+ // Testing get_property_value.
+
+ int test_get_properties (ACE_ENV_SINGLE_ARG_DECL);
+ //Testing get_properties. Give the names and get their properties.
+
+ int test_get_all_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Testing get_all_properties.
+
+ int test_delete_property (const char *property_name
+ ACE_ENV_ARG_DECL);
+ // Testing delete_property.
+
+ int test_delete_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Testing delete_properties.
+
+ int test_define_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Defining a sequence of properties.
+
+ int test_define_property_with_mode (ACE_ENV_SINGLE_ARG_DECL);
+ // Defines properties with various modes.
+
+ TAO_ORB_Manager manager_;
+ // The ORB manager, handles ORB initialization etc.
+
+ TAO_Naming_Client my_name_client_;
+ // The Naming Client handles Naming Service work
+
+ CosPropertyService::PropertySetDef_var propsetdef_;
+ // To test propertySetDef interface.
+};
+
+#endif /* COSPROPERTYSERVICE_CLIENT_H */
diff --git a/TAO/orbsvcs/tests/Property/main.cpp b/TAO/orbsvcs/tests/Property/main.cpp
new file mode 100644
index 00000000000..d9e9a9f2a3e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/main.cpp
@@ -0,0 +1,586 @@
+// $Id$
+
+// ========================================================================
+//
+// = FILE
+// Program to test the property services.
+//
+// = DESCRIPTION
+// Here all the objects are at one address space. See the
+// client.cpp and server.cpp to see property calls on remote
+// objects.
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+//
+// ========================================================================
+
+#include "orbsvcs/CosPropertyS.h"
+#include "orbsvcs/Property/CosPropertyService_i.h"
+
+ACE_RCSID(CosPropertyService, main, "$Id$")
+
+class TAO_PropertySet_Tester
+{
+ // = TITLE
+ // The testing code for the PropertySet interface are grouped
+ // under the functions of this class.
+ //
+ // = DESCRIPTION
+ // Go thru the functions to understand the usage of the various
+ // methods of the PropertySet interaface.
+public:
+ friend class TAO_PropertyNamesIterator_Tester;
+ // He has to instantiate TAO_NamesIterator class using the instance
+ // of TAO_PropertySet.
+
+ TAO_PropertySet_Tester (void);
+ // Constructor.
+
+ ~TAO_PropertySet_Tester (void);
+ // Destructor.
+
+ int test_define_property (ACE_ENV_SINGLE_ARG_DECL);
+ // Defines a char,a short, a long, a float and a string property.
+
+ int test_get_number_of_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Gets the number of properties currently defined in the PropertySet.
+
+ int test_delete_property (const char *property_name
+ ACE_ENV_ARG_DECL);
+ // Delete a given property.
+
+ int test_is_property_defined (ACE_ENV_SINGLE_ARG_DECL);
+ // Check the following properties are defined or
+ // no. "char_property", "short_property" and a "string_property".
+
+ int test_get_property_value (ACE_ENV_SINGLE_ARG_DECL);
+ // Get the "float_property" and "string_property" and print them
+ // out.
+
+ int test_delete_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Delete char, short,long, and string properties.
+
+ int test_delete_all_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Delete all the properties.
+
+ int test_define_properties (ACE_ENV_SINGLE_ARG_DECL);
+ // Define a sequence of properties. a char, a short, a long, a float
+ // and a string.
+
+private:
+ TAO_PropertySet property_set_;
+ // The PropertySet.
+};
+
+class TAO_PropertyNamesIterator_Tester
+{
+ // = TITLE
+ // The testing code for the PropertyNamesIterator interface are grouped
+ // under the functions of this class.
+ //
+ // = DESCRIPTION
+ // Go thru the functions to understand the usage of the various
+ // methods of the PropertyNamesIterator interaface.
+public:
+ TAO_PropertyNamesIterator_Tester (TAO_PropertySet_Tester &propertyset_tester);
+ // Constructor. To make names iterator from the property set object.
+
+ ~TAO_PropertyNamesIterator_Tester (void);
+ // Destructor.
+
+ int test_next_one (ACE_ENV_SINGLE_ARG_DECL);
+ // Test next one method. Iterate thru all the names in the
+ // PropertySet and print them out.
+
+ int test_reset (ACE_ENV_SINGLE_ARG_DECL);
+ // Test the reset method.
+
+ int test_next_n (size_t n ACE_ENV_ARG_DECL);
+ // Test the next_n method.
+private:
+ TAO_PropertyNamesIterator iterator_;
+ // Our names iterator.
+};
+
+
+// Constructor.
+TAO_PropertySet_Tester::TAO_PropertySet_Tester (void)
+{
+}
+
+// Destructor.
+TAO_PropertySet_Tester::~TAO_PropertySet_Tester (void)
+{
+}
+
+// Defines a char, a short, a long, a float and a string.
+int
+TAO_PropertySet_Tester::test_define_property (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "\nChecking define_property\n"));
+
+ CORBA::Any anyval;
+
+ // Prepare a char and "define" that in the PropertySet.
+ CORBA::Char ch = '#';
+ anyval <<= from_char (ch);
+ ch = '*';
+ anyval >>= to_char (ch);
+ ACE_DEBUG ((LM_DEBUG,
+ "Main : Char ch = %c\n",
+ ch));
+ property_set_.define_property ("char_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+ // Prepare a Short and "define" that in the PropertySet.
+ CORBA::Short s = 3;
+ anyval <<= s;
+ s = 7;
+ anyval >>= s;
+ ACE_DEBUG ((LM_DEBUG,
+ "Main : Short s = %d\n",
+ s));
+ property_set_.define_property ("short_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+
+ // Prepare a Long and "define" that in the PropertySet.
+ CORBA::Long l = 931232;
+ anyval <<= l;
+ l = 931233;
+ anyval >>= l;
+ ACE_DEBUG ((LM_DEBUG,
+ "Main : Long l = %d\n",
+ l));
+ CORBA::Any newany(anyval);
+
+ property_set_.define_property ("long_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+ // Prepare a Float and "define" that in the PropertySet.
+ CORBA::Float f = 3.14;
+ anyval <<= f;
+ f = 4.14;
+ anyval >>= f;
+ ACE_DEBUG ((LM_DEBUG,
+ "Main : Float f = %f\n",
+ f));
+ property_set_.define_property ("float_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+ // Prepare a String and "define" that in the PropertySet.
+ ACE_DEBUG ((LM_DEBUG,
+ "Main: Any holding String\n"));
+ CORBA::String_var strvar (CORBA::string_dup ("Test_String"));
+ anyval <<= strvar.in ();
+ CORBA::String newstr;
+ anyval >>= newstr;
+ ACE_DEBUG ((LM_DEBUG,
+ "Main: String : %s, From any : %s\n",
+ strvar.in (),
+ newstr));
+ property_set_.define_property ("string_property",
+ anyval
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+ return 0;
+}
+
+// Testing, get_number_of_properties.
+int
+TAO_PropertySet_Tester::test_get_number_of_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Main : Number of props : %d\n",
+ property_set_.get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER)));
+ ACE_CHECK_RETURN ( 1);
+
+ return 0;
+}
+
+// Testing the delete_property. Delets property, with the given name,
+// if that exsists.
+int
+TAO_PropertySet_Tester::test_delete_property (const char *property_name
+ ACE_ENV_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG, "\nChecking delete_property\n"));
+ property_set_.delete_property (property_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+ return 0;
+}
+
+// Gets the value of "short_property" and "string_property".
+
+int
+TAO_PropertySet_Tester::test_get_property_value (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "\nChecking get_property_value\n"));
+
+ CORBA::Any_ptr anyptr = property_set_.get_property_value ("short_property"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+ // Get the short value.
+ if (anyptr != 0)
+ {
+ CORBA::Short s;
+ *anyptr >>= s;
+ ACE_DEBUG ((LM_DEBUG,
+ "Short %d\n",
+ s));
+ }
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "Short property not found\n"));
+ // Get the string.
+ anyptr = property_set_.get_property_value ("string_property"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+ if (anyptr != 0)
+ {
+ CORBA::String str;
+ *anyptr >>= str;
+ ACE_DEBUG ((LM_DEBUG,
+ "Str %s\n", str));
+ }
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "string_property not found\n"));
+ return 0;
+}
+
+// Check the following properties are defined or no. "short_property",
+// "string_property" and "char_property".
+
+int
+TAO_PropertySet_Tester::test_is_property_defined (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "\nChecking is_property_defined ()\n"));
+ if (property_set_.is_property_defined ("short_property"
+ ACE_ENV_ARG_PARAMETER) == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "short_property not defined\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "short_property defined\n"));
+ ACE_CHECK_RETURN ( 1);
+ if (property_set_.is_property_defined ("string_property"
+ ACE_ENV_ARG_PARAMETER) == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "string_property not defined\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "string_property defined\n"));
+ ACE_CHECK_RETURN ( 1);
+ if (property_set_.is_property_defined ("char_property"
+ ACE_ENV_ARG_PARAMETER) == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "char_property not defined\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "char_property defined\n"));
+ ACE_CHECK_RETURN ( 1);
+
+ return 0;
+}
+
+// Make a sequence of property names and delete them from the
+// PropertySet. Deleting char, short, long, float and string
+// properties.
+int
+TAO_PropertySet_Tester::test_delete_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "\nChecking delete_properties == Deleting a sequence of Properties\n"));
+ CosPropertyService::PropertyNames prop_names;
+ prop_names.length (4);
+ prop_names [0] = CORBA::string_dup ("char_property");
+ prop_names [1] = CORBA::string_dup ("short_property");
+ prop_names [2] = CORBA::string_dup ("long_property");
+ prop_names [3] = CORBA::string_dup ("float_property");
+ ACE_DEBUG ((LM_DEBUG,
+ "Length of sequence %d, Maxlength : %d\n",
+ prop_names.length (),
+ prop_names.maximum ()));
+ property_set_.delete_properties (prop_names
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 0);
+
+ return 0;
+}
+
+// Defines a sequnce of properties containing, char, short, long,
+// float and string property in the property set.
+int
+TAO_PropertySet_Tester::test_define_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "\nChecking define_properties == Defining sequence of properties\n"));
+ // TAO_TRY
+ // {
+ CosPropertyService::Properties nproperties;
+ nproperties.length (5);
+ CORBA::Any anyval;
+ // Prepare a char and "define" that in the PropertySet.
+ CORBA::Char ch = '#';
+ anyval <<= from_char (ch);
+ ch = '*';
+ anyval >>= to_char (ch);
+ nproperties[0].property_name = CORBA::string_dup ("char_property");
+ nproperties[0].property_value <<= from_char (ch);
+
+ // Prepare a Short and "define" that in the PropertySet.
+ CORBA::Short s = 3;
+ anyval <<= s;
+ s = 7;
+ anyval >>= s;
+ nproperties[1].property_name = CORBA::string_dup ("short_property");
+ nproperties[1].property_value <<= s;
+
+ // Prepare a Long and "define" that in the PropertySet.
+ CORBA::Long l = 931232;
+ anyval <<= l;
+ l = 931233;
+ anyval >>= l;
+ nproperties[2].property_name = CORBA::string_dup ("long_property");
+ nproperties[2].property_value <<= l;
+
+ // Prepare a Float and "define" that in the PropertySet.
+ CORBA::Float f = 3.14;
+ anyval <<= f;
+ f = 4.14;
+ anyval >>= f;
+ nproperties[3].property_name = CORBA::string_dup ("float_property");
+ nproperties[3].property_value <<= f;
+
+ // Prepare a String and "define" that in the PropertySet.
+ CORBA::String_var strvar (CORBA::string_dup ("Test_String"));
+ anyval <<= strvar.in ();
+ nproperties[4].property_name = CORBA::string_dup ("string_property");
+ nproperties[4].property_value <<= strvar.in ();
+
+ // Define this sequence of properties now.
+ property_set_.define_properties (nproperties ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+
+ return 0;
+}
+
+// Delete all the properties.
+int
+TAO_PropertySet_Tester::test_delete_all_properties (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Deleting all the properties
+ ACE_DEBUG ((LM_DEBUG,
+ "\nChecking delete_all_properties\n"));
+ int ret = property_set_.delete_all_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ if (ret == 1)
+ ACE_DEBUG ((LM_DEBUG,
+ "All properties deleted, I guess\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "delete_all_properties failed\n"));
+ return 0;
+}
+
+// Constructor. To make names iterator from the property set object.
+TAO_PropertyNamesIterator_Tester::TAO_PropertyNamesIterator_Tester (TAO_PropertySet_Tester &propertyset_tester)
+ : iterator_ (propertyset_tester.property_set_)
+{
+}
+
+// Destructor.
+TAO_PropertyNamesIterator_Tester::~TAO_PropertyNamesIterator_Tester (void)
+{
+}
+
+// Test next one method. Iterate thru all the names in the
+// PropertySet and print them out.
+int
+TAO_PropertyNamesIterator_Tester::test_next_one (ACE_ENV_SINGLE_ARG_DECL)
+{
+ CORBA::String_var strvar;
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTesting next_one of NamesIterator, Iterating thru names.\n"));
+ // Let us iterate, now.
+ int ret = iterator_.next_one (strvar.out () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ while (ret != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Str : %s\n", strvar.in ()));
+ ret = iterator_.next_one (strvar.out () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ }
+ return 0;
+}
+
+// Reset the names iterator.
+int
+TAO_PropertyNamesIterator_Tester::test_reset (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "Resetting (reset ()) the NamesIterator."));
+ iterator_.reset (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN ( 1);
+ return 0;
+}
+
+// Test the next_n method. Get the next n names and print them all.
+int
+TAO_PropertyNamesIterator_Tester::test_next_n (size_t n
+ ACE_ENV_ARG_DECL)
+{
+ CosPropertyService::PropertyNames_var pnames_var;
+ ACE_DEBUG ((LM_DEBUG,
+ "Checking next_n (), next %d\n",
+ n));
+ int ret = iterator_.next_n (n, pnames_var.out () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (1);
+ if (ret == 0)
+ {
+ // Return if no more items in the iterator.
+ ACE_DEBUG ((LM_DEBUG,
+ "Iterator has no more items\n"));
+ return 0;
+ }
+ for (size_t i = 0; i < pnames_var.in ().length (); i++)
+ ACE_DEBUG ((LM_DEBUG,
+ "str %s \n",
+ (const char *) pnames_var[i]));
+ return 0;
+}
+
+int
+main (int argc, char *argv [])
+{
+ ACE_TRY
+ {
+ CORBA::ORB_var orb_var = CORBA::ORB_init (argc,
+ argv,
+ "internet"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // = Checking PropertySet interface.
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTAO_PropertySet Testing\n"));
+ TAO_PropertySet_Tester propertyset_tester;
+
+ // Checking define_property. define a char, a short,a long, a float
+ // and a string.
+ propertyset_tester.test_define_property (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test the number of properties and print it out.
+ propertyset_tester.test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test delete property. Delete "string_property"
+ propertyset_tester.test_delete_property ("string_property" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test the number of properties and print it out.
+ propertyset_tester.test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test delete_properties. Delete char, short, long and float.
+ propertyset_tester.test_delete_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test the number of properties and print it out.
+ propertyset_tester.test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Define a sequence of properties. char, short, long, float and
+ // string.
+ propertyset_tester.test_define_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test the number of properties and print it out.
+ propertyset_tester.test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Checking get_property_value. get the value of short and string.
+ propertyset_tester.test_get_property_value (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Checking delete_all_properties.
+ propertyset_tester.test_delete_all_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test the number of properties and print it out.
+ propertyset_tester.test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Define a sequence of properties. char, short, long, float and
+ // string.
+ propertyset_tester.test_define_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Test the number of properties and print it out.
+ propertyset_tester.test_get_number_of_properties (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // = Checking the PropertyNamesIterator interface.
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTAO_PropertyNamesIterator Testing\n"));
+
+ // Construct the names iterator from the PropertySet object.
+ TAO_PropertyNamesIterator_Tester names_iterator_tester (propertyset_tester);
+
+ // Checking next_one. Iterate thru the property names.
+ names_iterator_tester.test_next_one (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Checking the reset () method.
+ names_iterator_tester.test_reset (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Iterating again thru the property names.
+ names_iterator_tester.test_next_one (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Reset again.
+ names_iterator_tester.test_reset (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Checking next_n. Prints out all the names it has got.
+ names_iterator_tester.test_next_n (6 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Try next_n without resetting.
+ names_iterator_tester.test_next_n (6 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_ENV_ARG_PARAMETER.print_exception ("System Exception");
+ return -1;
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_ENV_ARG_PARAMETER.print_exception ("User Exception");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Property/run_test.pl b/TAO/orbsvcs/tests/Property/run_test.pl
new file mode 100755
index 00000000000..b71c788c595
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/run_test.pl
@@ -0,0 +1,64 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# amount of delay between running the servers
+
+$sleeptime = 6;
+$status = 0;
+
+# variables for parameters
+
+$nsior = PerlACE::LocalFile ("ns.ior");
+
+unlink $nsior;
+
+$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o $nsior");
+$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior");
+$CL = new PerlACE::Process ("client", "-ORBInitRef NameService=file://$nsior");
+
+print STDERR "Starting Naming_Service\n";
+$NS->Spawn ();
+
+if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill ();
+ exit 1;
+}
+
+print STDERR "Starting Server\n";
+$SV->Spawn ();
+
+sleep $sleeptime;
+
+print STDERR "Starting Client\n";
+
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+$nserver = $NS->TerminateWaitKill (5);
+
+if ($nserver != 0) {
+ print STDERR "ERROR: name server returned $nserver\n";
+ $status = 1;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Property/server.cpp b/TAO/orbsvcs/tests/Property/server.cpp
new file mode 100644
index 00000000000..bcaeae71a5f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/server.cpp
@@ -0,0 +1,121 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/CosPropertyService
+//
+// = FILENAME
+// server.cpp
+//
+// = DESCRIPTION
+// Test server for the CosPropertyService
+//
+// = AUTHORS
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "server.h"
+
+ACE_RCSID(CosPropertyService, server, "$Id$")
+
+// Main program
+
+int
+main (int argc, char ** argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ TAO_ORB_Manager m;
+
+ // Initialize the ORB.
+ m.init_child_poa (argc,
+ argv,
+ "child_poa"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Using naming server.
+ TAO_Naming_Client my_name_client;
+ if (my_name_client.init (m.orb ()) < 0)
+ return 1;
+
+ // Create PropertySetDef object and register.
+ TAO_PropertySetDef *propsetdef_impl;
+ ACE_NEW_RETURN (propsetdef_impl,
+ TAO_PropertySetDef,
+ -1);
+ CosPropertyService::PropertySetDef_var propsetdef =
+ propsetdef_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name propsetdef_name (1);
+ propsetdef_name.length (1);
+ propsetdef_name[0].id = CORBA::string_dup ("PropertySetDef");
+ my_name_client->bind (propsetdef_name,
+ propsetdef.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Any any_val;
+
+ // Make this IOR as one of the properties in there.
+ any_val <<= propsetdef_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var ior = propsetdef_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_ptr ior_ptr = ior.in ();
+ any_val <<= ior_ptr;
+ // any_val.replace (CORBA::_tc_Object,
+ // &ior_ptr,
+ // 1
+ // ACE_ENV_ARG_PARAMETER);
+ // ACE_TRY_CHECK;
+
+ propsetdef_impl->define_property_with_mode ("PropertySetDef_IOR",
+ any_val,
+ CosPropertyService::fixed_readonly
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create PropertySet factory and then register.
+ TAO_PropertySetFactory *propset_factory_impl;
+ ACE_NEW_RETURN (propset_factory_impl,
+ TAO_PropertySetFactory,
+ -1);
+ CosPropertyService::PropertySetFactory_var propset_factory =
+ propset_factory_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name propset_factory_name (1);
+ propset_factory_name.length (1);
+ propset_factory_name[0].id = CORBA::string_dup ("PropertySetFactory");
+ my_name_client->bind (propset_factory_name,
+ propset_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the ORB Event loop.
+ m.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex,
+ "System Exception");
+ return 1;
+ }
+ ACE_CATCH (CORBA::UserException, userex)
+ {
+ ACE_PRINT_EXCEPTION (userex,
+ "User Exception");
+ return 1;
+ }
+ ACE_ENDTRY;
+ ACE_DEBUG ((LM_DEBUG,
+ "\nServer is terminating"));
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Property/server.h b/TAO/orbsvcs/tests/Property/server.h
new file mode 100644
index 00000000000..42d21922d35
--- /dev/null
+++ b/TAO/orbsvcs/tests/Property/server.h
@@ -0,0 +1,27 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/CosPropertyService
+//
+// = FILENAME
+// server.h
+//
+// = DESCRIPTION
+// Test server for the CosPropertyService.
+//
+// = AUTHORS
+// Alexander Babu Arulanthu <alex.cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef COSPROPERTYSERVICE_SERVER_H
+#define COSPROPERTYSERVICE_SERVER_H
+
+#include "tao/Utils/ORB_Manager.h"
+#include "orbsvcs/Property/CosPropertyService_i.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+
+#endif /* COSPROPERTYSERVICE_SERVER_H */
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/Object1_i.cpp b/TAO/orbsvcs/tests/RTCosScheduling/Object1_i.cpp
new file mode 100644
index 00000000000..92ea6cc74f6
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/Object1_i.cpp
@@ -0,0 +1,81 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Object1_i.cpp
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#include "Object1_i.h"
+#include "ace/ACE.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_unistd.h"
+//#include "tao/RTCORBA/RTCORBA.h"
+////##include "ace/Task.h"
+//
+//#if !defined (ACE_LACKS_PRAGMA_ONCE)
+//# pragma once
+//#endif /* ACE_LACKS_PRAGMA_ONCE */
+//
+////#include "ace/CORBA_macros.h"
+////#include "tao/RTCORBA/Priority_Mapping_Manager.h"
+////#include "tao/corba.h"
+////#include "tao/ORB_Core.h"
+//
+
+Object1_impl::Object1_impl()
+{
+}
+
+
+Object1_impl::~Object1_impl()
+{
+}
+
+
+void Object1_impl::method1(const char* activity,
+ CORBA::Long seconds,
+ char* &output
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException, testSched::testSchedException))
+{
+ const int scale_factor = 2000;
+ int work;
+ const int time_size = 35;
+ ACE_TCHAR date_and_time[time_size];
+ char buf[128];
+ char buf2[128];
+
+ ACE_OS::sprintf(buf,
+ "%s\t%s\tBeginning work on the server\n",
+ ACE::timestamp(date_and_time, time_size),
+ activity);
+ ACE_DEBUG((LM_DEBUG,"%s",buf));
+
+ if (ACE_OS::strcmp(activity,"Client1") == 0)
+ {
+ ACE_OS::sleep(5);
+ }
+
+ /// Simulate some work
+ static CORBA::ULong prime_number = 9619;
+ work = scale_factor * seconds;
+ for (; work != 0; work--)
+ {
+ ACE::is_prime (prime_number, 2, prime_number / 2);
+ }
+
+ ACE_OS::sprintf(buf2,
+ "%s\t%s\tFinished work on the server\n",
+ ACE::timestamp(date_and_time, time_size),
+ activity);
+ ACE_DEBUG((LM_DEBUG,"%s",buf2));
+ ACE_OS::strcat(buf,buf2);
+ output = ACE_OS::strdup(buf);
+
+}
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/Object1_i.h b/TAO/orbsvcs/tests/RTCosScheduling/Object1_i.h
new file mode 100644
index 00000000000..ffddfb90fa9
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/Object1_i.h
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file Object1_i.h
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#ifndef Object1_I_H
+#define Object1_I_H
+
+#include "testSchedS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class Object1_i
+ *
+ * @brief This class is used to test the RTCORBA 1.0 Scheduling Service
+ *
+ */
+class Object1_impl : public POA_testSched::Object1
+{
+ public:
+ Object1_impl();
+
+ virtual ~Object1_impl();
+
+ virtual void method1(const char *activity,
+ CORBA::Long seconds,
+ char *&output
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException, testSched::testSchedException));
+};
+
+#endif /* Object1_I_H */
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/README b/TAO/orbsvcs/tests/RTCosScheduling/README
new file mode 100644
index 00000000000..a400d10dc03
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/README
@@ -0,0 +1,270 @@
+README,v 1.0 2003/07/09
+
+This is a test for RTCORBA 1.0 scheduling Service.
+
+Matt Murphy <murphym@cs.uri.edu>
+University of Rhode Island
+
+Scenario:
+--------
+Client nodes connect to a server to make object calls to execute
+on the server. An offline analysis tool has determined appropriate
+priorities for each task on the system. These priorities are stored
+in a configuration file.
+
+The server is started with the appropriate object instantiated that
+will be used by the clients, and the server has created a local
+ServerScheduler object, which sets the RT policies necessary for
+the scheduling service to execute (set through the
+ServerScheduler->create_POA(...) method.). Threads on the server run at
+RTCORBA::maxPriority so the server can immediately intercept incoming requests
+for proper scheduling. The Client creates a local
+ClientScheduler object, which read the configuration file and stores
+the activity/priority relationships for the given node. Clients make
+a schedule_activity("activity_name") call to the ClientScheduler
+object to set the local system priority as specified by the activity name.
+
+When a client makes a CORBA call on an object residing on the server,
+the Client Propagated Priority policy (set in ServerScheduler)
+ensures that the server receives the priority the client runs at. A
+ServerScheduler receive_request() interceptor intercepts the method
+call and locks the thread while there are higher priority tasks executing
+on the server. The ServerScheduler then sets the server thread to
+run using MPCP while the task executes. A ServerScheduler send_reply
+interceptor raises the thread priority back to RTCORBA::maxPriority so it can
+intercept the next incoming request.
+
+
+To compile (on Unix):
+----------
+Ensure that RTCosScheduling is compiled. There should be a
+libTAO_RTCosScheduling.so file in $ACE_ROOT/TAO/orbsvcs/orbsvcs.
+
+If it is not there, from the $ACE_ROOT/TAO/orbsvcs/orbsvcs/ directory, run
+make -f Makefile.RTCosScheduling
+
+To compile the test, just run make in the test directory
+
+
+To run (on Unix):
+-------
+Run the test as root since this test sets the priorities on
+both the client and server.
+Make sure that your LD_LIBRARY_PATH and TAO_ROOT are set appropriately:
+
+# ./run_test.pl
+
+
+Options:
+--------
+Client:
+-B int # amount of work performed before the CORBA call is made
+-R int # amount of work performed on server during the CORBA call
+-A int # amount of work performed after the CORBA call
+-N char* # name of the node
+-X 0|1 # Flag to use realtime (Y=1)
+-C char* # intermediate client output file
+ # (used by the run_test validator)
+-S char* # intermediate server output file
+ # (used by the run_test validator)
+-F char* # name of the configuration file that their
+ # activities/priorities/resources are stored in
+-T char* # name of the activity that the client will run
+
+Server:
+-N char* # The name of the node
+-F char* # The name of the configuration file
+-A char* # the name of the server resource
+-X 1|0 # Flag to use realtime (Y=1)
+
+Tests
+---------
+
+Functionality Tests
+-------------------
+Test1 ensures that the scheduling service works as expected.
+Three clients are started with the following parameters:
+
+Client priority release time remote execution time
+Client1 Low 0 10
+Client2 Medium 0 3
+Client3 High 2 3
+
+Where release time is the amount of work done on the local client before
+the remote method call is made. Each remote method call is made on the
+same server object, so the ServerScheduler must schedule execution of
+each of these three clients so that they use the remote object in the
+appropriate order.
+
+Note that the scheduling service is only tested when both the client and
+the server are using the 1.0 scheduler. (Test1)
+In the functionality tests the clients start up at the same time. Client1
+immediately makes a remote method call to the server. Clients 2 and 3
+make method calls to the server object that arrive while the client 1
+method call is still executing on the server. MPCP guarantees that
+client1's priority is elevated so that it is allowed to finish, so clients
+2 and 3 are placed in a pending queue to await execution. Once client
+1 finishes, the activity in queue with the highest client propagated
+priority (client3) runs. When it is finished, client 2 runs.
+
+When Client1 execution returns from the method call it is blocked in this
+test because it runs at a lower priority than the server execution of
+clients 2 and 3 (this is because this test is designed to run on a single
+node!).
+
+When clients 2 and 3 return from the method call, client 3 finishes execution
+because it has the highest priority, then client2 finishes, finally client 1.
+
+If the scheduling service test failed an error message will appear describing
+the point of failure. Please note that some artificial changes to the client
+and server object code since this test is designed to run on one node.
+Specifically, there is an ACE_OS::sleep(2) in object1_i::method1() that
+executes only when client1 makes the method call. This is because the client1
+method call is running at an elevated MPCP priority, and needs to sleep long
+enough for clients 2 and 3 to execute on the client and make method calls on
+object1. If it did not sleep, the method1() method call would execute to
+completion due the singe node nature of this test. (It is running at an
+elevated priority on the same processor as the clients 2 and 3).
+
+There is also a sleep method in the client code that sleeps for 1 as soon as
+each client starts up. This occurs before schedule activity is called, and is
+in place to allow each client to start up in the event that the default
+priority for new processes is higher than the the priorities set in the config
+file. If the default priority was higher and the clients did not sleep, each
+would not let the successive one start at the appropriate time.
+
+Please note that in designing a test that since this runs on a single node, there
+is no noticeable network delay. There will be a greater network delay on a truly
+distributed system. If the test does not run correctly on you machine, try
+changing the sleep delays to allow all processes to start. If they all start,
+the test should work.
+
+
+Tests 2,3,4 do not execute with both ClientScheduler and a ServerScheduler
+so there is no way to validate that execution is appropriate. In test 2,
+visual inspection of the output shows that tasks are not scheduled on the client
+appropriately. Test 3 does not use server side scheduling, so server execution
+runs at RTCORBA::minPriority. Note that the server prints a debug message to inform
+the user that it did not use RT MPCP scheduling.
+
+
+Exception Tests
+---------------
+Tests 5,6,7,8 ensure that the 1.0 scheduling service handles exceptions
+and other errors.
+These test determine that the proper exceptions are thrown when the
+scheduling service receives improper parameters from either the Client
+or the server.
+
+
+
+Expected Output
+---------------
+
+==== Running RTCORBA 1.0 Scheduling Service test
+==== Note that the first column is the time, it will be different for you
+
+TIME OBJECT LOCATION ACTIVITY
+
+==== Test1 - YES client side scheduling, YES server side scheduling
+ 13:32:35.775474 Client1 Beginning activity at priority 334
+ 13:32:35.775767 Client1 Calling method1 at priority 334
+ 13:32:35.785983 Client1 Beginning work on the server
+ 13:32:36.781443 Client2 Beginning activity at priority 5349
+ 13:32:36.781736 Client2 Calling method1 at priority 5349
+ 13:32:37.052432 Client3 Beginning activity at priority 10699
+ 13:32:37.319242 Client3 Calling method1 at priority 10699
+ 13:32:42.120180 Client1 Finished work on the server
+ 13:32:42.120688 Client3 Beginning work on the server
+ 13:32:42.520590 Client3 Finished work on the server
+ 13:32:42.520708 Client2 Beginning work on the server
+ 13:32:42.920614 Client2 Finished work on the server
+ 13:32:42.921104 Client3 Done with method1 at priority 10699
+ 13:32:43.321033 Client3 Done with test at priority 10699
+ 13:32:43.323357 Client2 Done with method1 at priority 5349
+ 13:32:43.723272 Client2 Done with test at priority 5349
+ 13:32:43.725464 Client1 Done with method1 at priority 334
+ 13:32:44.125410 Client1 Done with test at priority 334
+The scheduling service worked as expected
+
+==== Test2 - NO client side scheduling, YES server side scheduling
+ 13:32:47.306196 Client1 Client Beginning Activity
+ 13:32:47.306383 Client1 Client Calling method1
+ 13:32:47.313107 Client1 Beginning work on the server
+ 13:32:48.306283 Client2 Client Beginning Activity
+ 13:32:48.306468 Client2 Client Calling method1
+ 13:32:48.313031 Client3 Client Beginning Activity
+ 13:32:48.314012 Client2 Beginning work on the server
+ 13:32:48.951789 Client3 Client Calling method1
+ 13:32:48.958000 Client3 Beginning work on the server
+ 13:32:49.331351 Client2 Finished work on the server
+ 13:32:49.331830 Client2 Client Done with method1
+ 13:32:49.786784 Client3 Finished work on the server
+ 13:32:49.787294 Client3 Client Done with method1
+ 13:32:53.647493 Client1 Finished work on the server
+ 13:32:53.648023 Client1 Client Done with method1
+
+==== Test3 - YES client side scheduling, NO server side scheduling
+ 13:32:59.233825 Client1 Beginning activity at priority 334
+ 13:32:59.234116 Client1 Calling method1 at priority 334
+Object not found in config file, RT ServerScheduler not used!
+ 13:32:59.271519 Client1 Beginning work on the server
+ 13:33:00.240454 Client2 Beginning activity at priority 5349
+ 13:33:00.240748 Client2 Calling method1 at priority 5349
+ 13:33:00.511453 Client3 Beginning activity at priority 10699
+ 13:33:00.778302 Client3 Calling method1 at priority 10699
+Object not found in config file, RT ServerScheduler not used!
+ 13:33:00.785727 Client2 Beginning work on the server
+Object not found in config file, RT ServerScheduler not used!
+ 13:33:00.788335 Client3 Beginning work on the server
+ 13:33:01.188213 Client3 Finished work on the server
+ 13:33:01.188896 Client3 Done with method1 at priority 10699
+ 13:33:01.588847 Client3 Done with test at priority 10699
+ 13:33:01.988080 Client2 Finished work on the server
+ 13:33:01.988614 Client2 Done with method1 at priority 5349
+ 13:33:02.388587 Client2 Done with test at priority 5349
+ 13:33:05.606466 Client1 Finished work on the server
+ 13:33:05.606997 Client1 Done with method1 at priority 334
+ 13:33:06.006881 Client1 Done with test at priority 334
+
+==== Test4 - NO client side scheduling, NO server side scheduling
+ 13:33:09.188034 Client1 Client Beginning Activity
+ 13:33:09.188223 Client1 Client Calling method1
+ 13:33:09.195621 Client1 Beginning work on the server
+ 13:33:10.189090 Client2 Client Beginning Activity
+ 13:33:10.189276 Client2 Client Calling method1
+ 13:33:10.192857 Client3 Client Beginning Activity
+ 13:33:10.459655 Client3 Client Calling method1
+ 13:33:10.465746 Client2 Beginning work on the server
+ 13:33:10.865946 Client2 Finished work on the server
+ 13:33:10.866442 Client2 Client Done with method1
+ 13:33:11.268218 Client3 Beginning work on the server
+ 13:33:11.668138 Client3 Finished work on the server
+ 13:33:11.668611 Client3 Client Done with method1
+ 13:33:15.530260 Client1 Finished work on the server
+ 13:33:15.530785 Client1 Client Done with method1
+
+==== Testing exceptions
+
+==== Test5 - Testing ClientScheduler exception for invalid activity name
+Should receive an RTCosScheduling::UnknownName exception
+(13374|16386) EXCEPTION, Invalid activity name
+
+user exception, ID 'IDL:RTCosScheduling/UnknownName:1.0'
+
+==== Test6 - Testing client exception when invalid config file specified
+Program should abort because no valid file was given
+Could not find the config file INVALID_FILE.cfg, aborting
+Invalid Filename given, aborting!
+
+==== Test7 - Testing server exception when invalid Object Name specified
+==== (Object name not in config file)
+Should receive an RTCosScheduling::UnknownName exception
+(13378|16384) EXCEPTION, Unknown object passed to schedule_object
+
+user exception, ID 'IDL:RTCosScheduling/UnknownName:1.0'
+
+==== Test8 - Testing server exception when invalid config file specified
+Server Should abort because an invalid config filename was given
+Could not find the config file INVALID_FILE.cfg, aborting
+ERROR: server returned 1
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/RTCosScheduling.mpc b/TAO/orbsvcs/tests/RTCosScheduling/RTCosScheduling.mpc
new file mode 100644
index 00000000000..08b932cb774
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/RTCosScheduling.mpc
@@ -0,0 +1,48 @@
+// -*- MPC -*-
+// $Id$
+
+project(RTCosScheduling_Server): rtcosscheduling, rt_server, orbsvcsexe, interceptors {
+ after += commonlib
+ libs += testSched_Common
+ libpaths += .
+ exename = server
+
+ Source_Files {
+ Object1_i.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(RTCosScheduling_Client): rtcosscheduling, rt_client, orbsvcsexe {
+ after += commonlib
+ after += RTCosScheduling_Server
+ libs += testSched_Common
+ libpaths += .
+ exename = client
+
+ Source_Files {
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(commonlib): rtcosscheduling, orbsvcslib {
+ requires += interceptors
+ sharedname = testSched_Common
+ idlflags += -Wb,export_macro=testSched_Export \
+ -Wb,export_include=testSched_export.h
+
+ dynamicflags += TESTSCHED_BUILD_DLL
+ tagchecks += testSched_Common
+
+ IDL_Files {
+ testSched.idl
+ }
+ Source_Files {
+ testSchedC.cpp
+ testSchedS.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/client.cpp b/TAO/orbsvcs/tests/RTCosScheduling/client.cpp
new file mode 100644
index 00000000000..c89d3699c52
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/client.cpp
@@ -0,0 +1,433 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file client.cpp
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+
+#include "testSchedC.h"
+#include <orbsvcs/RTCosScheduling/RTCosScheduling_ClientScheduler_i.h>
+#include "ace/Get_Opt.h"
+#include "tao/debug.h"
+#include "tao/Version.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/Task.h"
+#include "tao/ORB_Core.h"
+
+
+/// In the test, these are the default values that specify
+/// how long (in seconds) the test methods should run before going
+/// to the server, while on the server, and after returning from
+/// the server
+CORBA::Long before_ = 1;
+CORBA::Long remote_ = 1;
+CORBA::Long after_ = 1;
+u_int use_realtime_ = 1;
+
+/// This is the name of the node that the client executes on.
+char *node_ = NULL;
+
+/// the name of the config file holding the scheduling information
+char *file_ = NULL;
+
+/// the name of the activity to run (the name of the string passed in
+/// schedule_activity(activity_)
+char * activity_ = NULL;
+
+/// The name of the output file
+char *client_output_file_ = NULL;
+
+CORBA::String_var serv_output_;
+
+char date_and_time[35];
+char client_output_[2048];
+char buf[100];
+
+
+/// For the timestampe
+const int time_size = 35;
+ACE_TCHAR day_and_time[time_size];
+
+void do_work(const CORBA::Long value);
+
+ACE_RCSID(
+ tests,
+ client,
+ "client.cpp,v 1.0 2003/08/07 15:59:21 murphy_m Exp")
+
+/// Standard parse args method
+/*
+ * parse_args allows the user to configure the test to use values other
+ * than those specified above.
+ */
+int
+parse_args (int argc, char *argv[])
+{
+ /// We set the '-' flag for getopts because we have to do this
+ /// parsing before the ORB does it's parsing, and we'd confuse it to reorder
+ ACE_Get_Opt get_opts (argc, argv, "-B:R:A:X:N:C:F:T:?:");
+ int c;
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'B':
+ before_ =ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'R':
+ remote_ =ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'A':
+ after_ =ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'X':
+ use_realtime_ =ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'N':
+ node_ = ACE_OS::strdup(get_opts.opt_arg ());
+ break;
+ case 'C':
+ client_output_file_ = ACE_OS::strdup(get_opts.opt_arg ());
+ break;
+ case 'F':
+ file_ = ACE_OS::strdup(get_opts.opt_arg ());
+ break;
+ case 'T':
+ activity_ = ACE_OS::strdup(get_opts.opt_arg ());
+ break;
+ case '?':
+ ACE_DEBUG ((LM_DEBUG,
+ "usage: %n [-b precall_execution] "
+ "[-r remote_execution] "
+ "[-a postcall_workload] "
+ "[-N node] "
+ "[-F config_file] "
+ "[-c activity_name]\n"));
+ ACE_OS::exit (1);
+ }
+ }
+ if (node_ == NULL)
+ node_ = ACE_OS::strdup("1");
+ if (file_ == NULL)
+ file_ = ACE_OS::strdup("schedule.cfg");
+ if (activity_ == NULL)
+ activity_ = ACE_OS::strdup("");
+ if (client_output_file_ == NULL)
+ client_output_file_ = ACE_OS::strdup("");
+
+ return 0;
+}
+
+/**
+ * This class runs the test as a new thread since the main thread
+ * cannot set RT priorities as of TAO 1.3.3
+ *
+ */
+class ORB_Thread : public ACE_Task<ACE_SYNCH>
+{
+
+public:
+ORB_Thread(CORBA::ORB_var orb,
+ int argc,
+ char **argv)
+: orb_(orb),
+ argc_(argc),
+ argv_(argv)
+{
+}
+
+int svc(void) {
+ ACE_TRY_NEW_ENV
+ {
+ if (parse_args (argc_, argv_) != 0)
+ {
+ return 1;
+ }
+
+ if (strcmp(activity_,"Client2") == 0
+ || strcmp(activity_,"Client3") == 0)
+ {
+ ACE_OS::sleep(1);
+ }
+
+ CORBA::Object_var obj =
+ orb_->string_to_object ("file://server.ior"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P) orb_->string_to_object ")
+ ACE_TEXT ("(\"file://server.ior\") failed.\n")),
+ -1);
+ }
+
+ testSched::Object1_var object1 =
+ testSched::Object1::_narrow (obj.in ()ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ if (CORBA::is_nil (object1.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Object reference is nil, Aborting\n"), 1);
+ }
+
+
+ if (use_realtime_)
+ {
+ /// Create the ClientScheduler, note that you must pass in the
+ /// orb and the node name. The node name is required so that the
+ /// appropriate information can be read from the config file
+ TAO::RTCosScheduling_ClientScheduler_i *client_sched = 0;
+ ACE_NEW_THROW_EX(client_sched,
+ TAO::RTCosScheduling_ClientScheduler_i (
+ orb_,
+ node_,
+ file_),
+ CORBA::NO_MEMORY());
+ ACE_TRY_CHECK;
+
+
+ // Check to see that the ClientScheduler started correctly
+ if (CORBA::is_nil (client_sched))
+ {
+ /// There was an error in setting up the RTORB,
+ /// RT Policies were not set, throw an exception
+ ACE_OS::exit(1);
+ }
+
+
+
+ /// Create a Current object so we can check on the priority locally
+ obj = orb_->resolve_initial_references ("RTCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ RTCORBA::Current_var current =
+ RTCORBA::Current::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ /// Test to make sure the priority model is exposed
+ CORBA::Policy_var policy =
+ object1->_get_policy (RTCORBA::PRIORITY_MODEL_POLICY_TYPE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RTCORBA::PriorityModelPolicy_var priority_policy =
+ RTCORBA::PriorityModelPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (priority_policy.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Priority Model not exposed!\n"),
+ 1);
+ }
+
+ /// Test to make sure we are using Server Declared Priority model
+ RTCORBA::PriorityModel priority_model =
+ priority_policy->priority_model (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (priority_model != RTCORBA::SERVER_DECLARED)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: priority_model != "
+ "RTCORBA::SERVER_DECLARED!\n"),
+ 1);
+ }
+
+ do_work(before_);
+
+ ACE_TRY_EX(sched_act)
+ {
+ client_sched->schedule_activity (::activity_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(sched_act);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ex,
+ "Invalid activity name\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ ACE_OS::sprintf(buf,
+ "%s\t%s\tBeginning activity at priority %d\n",
+ ACE::timestamp(date_and_time, time_size),
+ activity_,
+ current->the_priority());
+ ACE_DEBUG ((LM_DEBUG,
+ "%s",
+ buf));
+ ACE_OS::strcat(client_output_, buf);
+
+ do_work(before_);
+ ACE_TRY_CHECK;
+
+
+ ACE_OS::sprintf(buf,
+ "%s\t%s\tCalling method1 at priority %d\n",
+ ACE::timestamp(date_and_time, time_size),
+ activity_,
+ current->the_priority());
+ ACE_DEBUG ((LM_DEBUG,
+ "%s",
+ buf));
+ ACE_OS::strcat(client_output_, buf);
+ serv_output_ = ACE_OS::strdup("");
+ object1->method1 (activity_, remote_, serv_output_.inout());
+
+ ACE_OS::strcat(client_output_, serv_output_.in());
+
+
+ ACE_OS::sprintf(buf,
+ "%s\t%s\tDone with method1 at priority %d\n",
+ ACE::timestamp(date_and_time, time_size),
+ activity_,
+ current->the_priority());
+ ACE_DEBUG ((LM_DEBUG,
+ "%s",
+ buf));
+ ACE_OS::strcat(client_output_, buf);
+
+
+ do_work(after_);
+
+ ACE_OS::sprintf(buf,
+ "%s\t%s\tDone with test at priority %d\n",
+ ACE::timestamp(date_and_time, time_size),
+ activity_,
+ current->the_priority());
+ ACE_DEBUG ((LM_DEBUG,
+ "%s",
+ buf));
+ ACE_OS::strcat(client_output_, buf);
+
+
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%T\t%s\tClient\tBeginning Activity\n",
+ activity_));
+ do_work(before_);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "%T\t%s\tClient\tCalling method1\n",
+ activity_));
+
+ object1->method1 (activity_, remote_, serv_output_.inout());
+ ACE_OS::strcat(client_output_,serv_output_.in());
+ /// Finished with remote call
+ ACE_DEBUG ((LM_DEBUG,
+ "%T\t%s\tClient\tDone with method1\n",
+ activity_));
+ do_work(after_);
+ }
+
+ FILE *fp = ACE_OS::fopen(client_output_file_, "w");
+ if (fp)
+ {
+ ACE_OS::fprintf(fp,
+ "%s",
+ client_output_);
+ }
+ else
+ {
+ ACE_DEBUG((LM_DEBUG,"No file to write to\n"));
+ }
+ ACE_OS::fclose(fp);
+
+
+ // Finally destroy the ORB
+ orb_->destroy ();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception in running the client\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+ }
+
+
+private:
+ CORBA::ORB_var orb_;
+ CORBA::ORB_var orb2_;
+ int argc_; char ** argv_;
+};
+
+
+
+int
+ACE_TMAIN (int argc, char * argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "client_orb" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ORB_Thread ot(orb, argc, argv);
+
+ // Need to set the main thread pthread scope and pthread policy to
+ // the values that are specified in svc.conf. This change was
+ // recommended by irfan@oomworks.com
+ long flags = THR_NEW_LWP | THR_JOINABLE |
+
+#if TAO_MAJOR_VERSION > 1 \
+|| (TAO_MAJOR_VERSION==1 && TAO_MINOR_VERSION > 3 ) \
+|| (TAO_MAJOR_VERSION==1 && TAO_MAJOR_VERSION==3 && TAO_MINOR_VERSION > 1)
+
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+ ACE_TRY_CHECK;
+
+#else /* TAO version is 1.3.1 or lower */
+ orb->orb_core ()->orb_params ()->scope_policy () |
+ orb->orb_core ()->orb_params ()->sched_policy ();
+ ACE_TRY_CHECK;
+#endif
+
+ ot.activate(flags);
+ return ot.wait();
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "ERROR in running the client\n");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
+
+void
+do_work(const CORBA::Long value)
+{
+ const int scale_factor = 2000;
+ int work;
+
+ /// Simulate some work
+ static CORBA::ULong prime_number = 9619;
+
+ work = scale_factor * value;
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "test_i::method: %hd units of work\n", work));
+ for (; work != 0; work--)
+ ACE::is_prime (prime_number, 2, prime_number / 2);
+
+}
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/run_test.pl b/TAO/orbsvcs/tests/RTCosScheduling/run_test.pl
new file mode 100755
index 00000000000..9fd147a6a20
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/run_test.pl
@@ -0,0 +1,318 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$file = PerlACE::LocalFile ("server.ior");
+
+unlink $file;
+
+$status = 0;
+#S11 uses schedule object, S10 does not
+$S11 = new PerlACE::Process ("server",
+ "-N 2 -F schedule.cfg -A Server2 -X 1");
+$S10 = new PerlACE::Process ("server",
+ "-N 2 -F schedule.cfg -A Server2 -X 0");
+
+#S2 uses and invalid config file
+$S2 = new PerlACE::Process ("server",
+ "-N 2 -F INVALID_FILE.cfg -A Server2 -X 1");
+
+#s3 tries to schedule an invalid object
+$S3 = new PerlACE::Process ("server",
+ "-N 2 -F schedule.cfg -A Server5 -X 1");
+
+$C1_client_output = PerlACE::LocalFile ("client1_output");
+$C2_client_output = PerlACE::LocalFile ("client2_output");
+$C3_client_output = PerlACE::LocalFile ("client3_output");
+
+unlink $C1_client_output;
+unlink $C2_client_output;
+unlink $C3_client_output;
+
+
+
+# C11 C21 C31 use RTCosScheduler 1.0 on the client
+$C11 = new PerlACE::Process ("client", "-B 0 -R 10 -A 3 -N 1 -C ". $C1_client_output. " -F schedule.cfg -T Client1 -X 1");
+$C21 = new PerlACE::Process ("client", "-B 0 -R 3 -A 3 -N 1 -C ". $C2_client_output. " -F schedule.cfg -T Client2 -X 1");
+$C31 = new PerlACE::Process ("client", "-B 2 -R 3 -A 3 -N 1 -C ". $C3_client_output. " -F schedule.cfg -T Client3 -X 1");
+
+#C10 C20 C30 Do not use RTCosScheduler 1.0 on the client
+$C10 = new PerlACE::Process ("client",
+ "-B 0 -R 10 -A 3 -N 1 -C ".
+ $C1_client_output.
+ " -F schedule.cfg -T Client1 -X 0");
+$C20 = new PerlACE::Process ("client",
+ "-B 0 -R 3 -A 3 -N 1 -C ".
+ $C3_client_output.
+ " -F schedule.cfg -T Client2 -X 0");
+$C30 = new PerlACE::Process ("client",
+ "-B 2 -R 3 -A 3 -N 1 -C ".
+ $C3_client_output.
+ " -F schedule.cfg -T Client3 -X 0");
+
+#C4 is an invalid activity name
+$C4 = new PerlACE::Process ("client",
+ "-B 1 -R 3 -A 0 -N 1 -F schedule.cfg ".
+ "-T Client4 -X 1");
+
+#C5 is an invalid config file
+$C5 = new PerlACE::Process ("client",
+ "-B 1 -R 3 -A 0 -N 1 -F INVALID_FILE.cfg ".
+ "-T Client2 -X 1");
+
+sub spawn_server
+{
+ local ( $param_1 ) = @_ ;
+ $param_1->Spawn ();
+ if (PerlACE::waitforfile_timed ($file, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $param_1->Kill ();
+ exit 1;
+ }
+}
+
+sub kill_server
+{
+ local ($param_1) = @_;
+ $server = $param_1->TerminateWaitKill (15);
+ if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+ }
+ unlink $file;
+}
+
+sub run_client
+{
+ local ($param_1) = @_;
+ $client = $param_1->Spawn();
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
+}
+
+
+sub test
+{
+ local($param_0, $param_1, $param_2, $param_3) = @_;
+ print STDERR $param_0;
+
+ $client1 = $param_1->Spawn();
+ $client2 = $param_2->Spawn();
+ $client3 = $param_3->Spawn();
+
+ if ($client1 != 0) {
+ print STDERR "ERROR: client returned $client1\n";
+ $status = 1;
+ }
+
+ if ($client2 != 0) {
+ print STDERR "ERROR: client returned $client2\n";
+ $status = 1;
+ }
+
+ if ($client3 != 0) {
+ print STDERR "ERROR: client returned $client3\n";
+ $status = 1;
+ }
+
+
+ $param_1->WaitKill (35);
+ $param_2->WaitKill (30);
+ $param_3->WaitKill (30);
+ sleep 2;
+
+ if ($param_0 =~ /Test1/)
+ {
+ evaluate_output();
+ }
+ unlink $C1_client_output;
+ unlink $C2_client_output;
+ unlink $C3_client_output;
+
+
+}
+
+
+sub test5
+{
+ print STDERR "\n==== Testing exceptions\n";
+ print STDERR "\n==== Test5 - Testing ClientScheduler ".
+ "exception for invalid activity name\n".
+ "Should recieve an RTCosScheduling::UnknownName exeption\n";
+ run_client($C4);
+ $C4->WaitKill(10);
+}
+
+sub test6
+{
+ print STDERR "\n==== Test6 - Testing client exception ".
+ "when invalid config file specified\n".
+ "Program should abort because no valid file was given\n";
+ run_client($C5);
+ $C5->WaitKill (10);
+}
+
+sub test7
+{
+ print STDERR "\n==== Test7 - Testing server exception ".
+ "when invalid Object Name specified\n";
+ print STDERR "==== (Object name not in config file)\n".
+ "Should receive an RTCosScheduling::UnknownName exception\n";
+ $S3->Spawn();
+ sleep 1;
+ kill_server($S3);
+}
+
+
+sub test8
+{
+ print STDERR "\n==== Test8 - Testing server exception ".
+ "when invalid config file specified\n".
+ "Server Should abort because an invalid config ".
+ "filename was given\n";
+ $S2->Spawn();
+ sleep 1;
+ kill_server($S2);
+}
+
+sub evaluate_output
+{
+ # this looks at the three output files to see if the
+ # clients ran in the correct order
+ open(INFOC1, $C1_client_output);
+ open(INFOC2, $C2_client_output);
+ open(INFOC3, $C3_client_output);
+
+
+ @arrayC1=<INFOC1>;
+ close (INFOC1);
+ @arrayC2=<INFOC2>;
+ close (INFOC2);
+ @arrayC3=<INFOC3>;
+ close (INFOC3);
+
+
+ $is_valid = 1;
+ $counter = 0;
+
+ # check the client execution to make sure
+ #it runs in the correct order
+ ($BAtimeC1,$client,$activity)=split(/\t/,@arrayC1[0]);
+ ($BAtimeC2,$client,$activity)=split(/\t/,@arrayC2[0]);
+ ($BAtimeC3,$client,$activity)=split(/\t/,@arrayC3[0]);
+
+ ($CMtimeC1,$client,$activity)=split(/\t/,@arrayC1[1]);
+ ($CMtimeC2,$client,$activity)=split(/\t/,@arrayC2[1]);
+ ($CMtimeC3,$client,$activity)=split(/\t/,@arrayC3[1]);
+
+ ($BRtimeC1,$client,$activity)=split(/\t/,@arrayC1[2]);
+ ($BRtimeC2,$client,$activity)=split(/\t/,@arrayC2[2]);
+ ($BRtimeC3,$client,$activity)=split(/\t/,@arrayC3[2]);
+
+ ($FRtimeC1,$client,$activity)=split(/\t/,@arrayC1[3]);
+ ($FRtimeC2,$client,$activity)=split(/\t/,@arrayC2[3]);
+ ($FRtimeC3,$client,$activity)=split(/\t/,@arrayC3[3]);
+
+ ($DMtimeC1,$client,$activity)=split(/\t/,@arrayC1[4]);
+ ($DMtimeC2,$client,$activity)=split(/\t/,@arrayC2[4]);
+ ($DMtimeC3,$client,$activity)=split(/\t/,@arrayC3[4]);
+
+ ($DTtimeC1,$client,$activity)=split(/\t/,@arrayC1[5]);
+ ($DTtimeC2,$client,$activity)=split(/\t/,@arrayC2[5]);
+ ($DTtimeC3,$client,$activity)=split(/\t/,@arrayC3[5]);
+
+
+ if ($BAtimeC1 gt $BAtimeC2 || $BAtimeC1 gt $BAtimeC3)
+ {
+ print STDERR "Scheduler Test Failed - activities did not ".
+ "begin in correct order\n";
+ $is_valid = 0;
+ }
+ if ($CMtimeC1 gt $CMtimeC2 || $CMtimeC1 gt $CMtimeC3)
+ {
+ print STDERR "Scheduler Test Failed - remote method calls not ".
+ "made in correct order\n";
+ $is_valid = 0;
+ }
+ if ($FRtimeC1 gt $FRtimeC3 || $FRtimeC3 gt $FRtimeC2)
+ {
+ print STDERR "Scheduler Test Failed - Remote Method calls did ".
+ "not finish in correct order\n";
+ $is_valid = 0;
+ }
+ if ($DTtimeC3 gt $DTtimeC2 || $DTtimeC2 gt $DTtimeC1)
+ {
+ print STDERR "Scheduler Test Failed - Tests did not finish in ".
+ "correct order\n";
+ $is_valid = 0;
+ }
+ if ($BRtimeC1 gt $BAtimeC2)
+ {
+ print STDERR "Scheduler Test Failed - Client1 remote method call ".
+ "finished before Client2 began local activity\n";
+ $is_valid = 0;
+ }
+ if ($FRtimeC1 gt $BRtimeC3 || $FRtimeC1 gt $BRtimeC2)
+ {
+ print STDERR "Scheduler Test Failed - Client1 finished before ".
+ "Clients2 or 3 made method calls\n";
+ $is_valid = 0;
+ }
+ if ($BRtimeC3 gt $BRtimeC2 || $FRtimeC3 gt $FRtimeC2)
+ {
+ print STDERR "Scheduler Test Failed - Client 3 remote method call ".
+ "did not begin before Client2\n";
+ $is_valid = 0;
+ }
+
+ if ($is_valid == 1)
+ {
+ print STDERR "The scheduling service worked as expected\n";
+ }
+ else
+ {
+ print STDERR "The scheduling service did not work as expected\n";
+ }
+
+}
+
+
+print STDERR "\n==== Running RTCORBA 1.0 Scheduling Service test\n";
+print STDERR "==== Note that the first column is the time, ".
+ "it will be different for you\n\n";
+print STDERR "TIME\t\t\tOBJECT\tLOCATION\tACTIVITY\n";
+
+spawn_server($S11);
+test("\n==== Test1 - YES client side scheduling, ".
+ "YES server side scheduling\n", $C11, $C21, $C31);
+test("\n==== Test2 - NO client side scheduling, ".
+ "YES server side scheduling\n", $C10, $C20, $C30);
+kill_server($S11);
+
+spawn_server($S10);
+test("\n==== Test3 - YES client side scheduling, ".
+ "NO server side scheduling\n", $C11, $C21, $C31);
+test("\n==== Test4 - NO client side scheduling, ".
+ "NO server side scheduling\n", $C10, $C20, $C30);
+kill_server($S10);
+
+spawn_server($S11);
+test5();
+test6();
+kill_server($S11);
+
+
+test7();
+test8();
+
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/schedule.cfg b/TAO/orbsvcs/tests/RTCosScheduling/schedule.cfg
new file mode 100644
index 00000000000..0f74742bcc0
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/schedule.cfg
@@ -0,0 +1,24 @@
+Node 1
+
+Resources:
+BP 11000
+Server2 6000
+END
+
+Tasks:
+Client1 500
+Client2 5500
+Client3 11000
+END
+
+Node 2
+
+Resources:
+BP 17000
+Server2 11000
+Server3 500
+END
+
+Tasks:
+Client4 500
+Client5 10000
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/server.cpp b/TAO/orbsvcs/tests/RTCosScheduling/server.cpp
new file mode 100644
index 00000000000..dbc60e82c6f
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/server.cpp
@@ -0,0 +1,267 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file server.cpp
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+#include "Object1_i.h"
+#include <orbsvcs/RTCosScheduling/RTCosScheduling_ServerScheduler_i.h>
+
+#include "tao/Version.h"
+
+// FUZZ: disable check_for_streams_include
+#include "ace/streams.h"
+#include "ace/Task.h"
+#include "ace/Get_Opt.h"
+#include "tao/ORB_Core.h"
+#include "ace/OS_main.h"
+#include "ace/OS_NS_stdio.h"
+
+const char *ior_output_file = "server.ior";
+char *node_ = 0;
+char *file_ = 0;
+char *shared_file_ = 0;
+char *object_ = 0;
+int num_threads_ = 5;
+int use_realtime_ = 1;
+
+// ORB Thread
+
+class ORB_Thread : public ACE_Task<ACE_SYNCH>
+{
+public:
+
+ORB_Thread(CORBA::ORB_var orb) : orb_(orb)
+{
+}
+
+int
+svc(void) {
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ orb_->run(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "svc");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ exit(0);
+ return 0;
+}
+
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+
+int
+parse_args (int argc, char *argv[])
+{
+ // We set the '-' flag for getopts because we have to do
+ // this parsing before the ORB does it's
+ //parsing, and we'd confuse it to reorder
+ ACE_Get_Opt get_opts (argc, argv, "-:N:F:S:T:A:X:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ {
+ switch (c)
+ {
+ case 'N':
+ node_ = get_opts.opt_arg ();
+ break;
+ case 'F':
+ file_ = get_opts.opt_arg ();
+ break;
+ case 'S':
+ shared_file_ = get_opts.opt_arg ();
+ break;
+ case 'T':
+ num_threads_ = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'A':
+ object_ = ACE_OS::strdup(get_opts.opt_arg ());
+ break;
+ case 'X':
+ use_realtime_ = ACE_OS::atoi(get_opts.opt_arg ());
+ break;
+
+ }
+ }
+ if (node_ == 0)
+ node_ = ACE_OS::strdup("1");
+ if (file_ == 0)
+ file_ = ACE_OS::strdup("schedule.cfg");
+ if (shared_file_ == 0)
+ shared_file_ = ACE_OS::strdup("Scheduling_Service_Shared_Memory");
+ if (object_ == 0)
+ object_ = ACE_OS::strdup("Server2");
+
+ return 0;
+}
+
+
+int
+ACE_TMAIN (int argc, ACE_TCHAR *argv[]) {
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ if (parse_args (argc, argv) != 0)
+ {
+ return 1;
+ }
+
+ CORBA::ORB_var orb=
+ CORBA::ORB_init (argc,
+ argv,
+ "testORB"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// get the root poa
+ CORBA::Object_var object=
+ orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var rootPOA=
+ PortableServer::POA::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ /// Create a manager for the POA
+ PortableServer::POAManager_var poa_manager =
+ rootPOA->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList poa_policy_list;
+ poa_policy_list.length (1);
+
+ poa_policy_list[0] =
+ rootPOA->create_lifespan_policy(PortableServer::TRANSIENT);
+
+ // Create the RT Scheduling service
+ TAO::RTCosScheduling_ServerScheduler_i *server_sched = 0;
+ ACE_NEW_THROW_EX(server_sched,
+ TAO::RTCosScheduling_ServerScheduler_i(
+ node_,
+ file_,
+ shared_file_,
+ num_threads_ ),
+ CORBA::NO_MEMORY());
+
+ /// Create the POA so RT Policies are set
+ PortableServer::POA_var RTPOA =
+ server_sched->create_POA(rootPOA.in(),
+ "my_RT_POA",
+ poa_manager.in(),
+ poa_policy_list
+ ACE_ENV_ARG_PARAMETER);
+
+
+ Object1_impl * servant = 0;
+ ACE_NEW_THROW_EX(servant,
+ Object1_impl(),
+ CORBA::NO_MEMORY());
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var id =
+ RTPOA->activate_object(servant
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var testObject =
+ RTPOA->id_to_reference(id.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::String_var testObject_IORString =
+ orb->object_to_string (testObject.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // If the ior_output_file exists, output the ior to it
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", testObject_IORString.in ());
+ ACE_OS::fclose (output_file);
+
+ if (use_realtime_)
+ {
+ /// Schedule the object
+ ACE_TRY_EX(INNER)
+ {
+ server_sched->schedule_object(testObject.inout(),
+ object_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(INNER);
+ }
+ ACE_CATCH(RTCosScheduling::UnknownName, ex)
+ {
+ ACE_PRINT_EXCEPTION(ACE_ANY_EXCEPTION,
+ "Unknown object passed to schedule_object\n");
+ }
+ ACE_ENDTRY;
+ }
+
+ // Activate the manager and run the event loop
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // Need to set the main thread pthread scope and pthread policy to
+ // the values that are specified in svc.conf. This change was
+ // recommended by irfan@oomworks.com
+ long flags = THR_NEW_LWP | THR_JOINABLE |
+
+#if TAO_MAJOR_VERSION > 1 \
+ || (TAO_MAJOR_VERSION==1 && TAO_MINOR_VERSION > 3 ) \
+ || (TAO_MAJOR_VERSION==1 && TAO_MAJOR_VERSION==3 && TAO_MINOR_VERSION > 1)
+
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
+
+#else /* TAO version is 1.3.1 or lower */
+ orb->orb_core ()->orb_params ()->scope_policy () |
+ orb->orb_core ()->orb_params ()->sched_policy ();
+#endif
+ ORB_Thread ot(orb);
+ ot.activate(flags);
+ ot.wait();
+
+
+ ACE_DEBUG((LM_DEBUG,
+ "Server is shutting down\n\n"));
+
+
+ delete server_sched;
+
+ /// clean up
+ rootPOA->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/server.ior b/TAO/orbsvcs/tests/RTCosScheduling/server.ior
new file mode 100644
index 00000000000..3a8697919ef
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/server.ior
@@ -0,0 +1 @@
+IOR:010000001a00000049444c3a7465737453636865642f4f626a656374313a312e300000000300000000000000d600000001010200110000007274646f632e63732e7572692e656475000039912300000014010f004e5354ff2b873ff9e6060001000000010000000000000001000000010000000004000000000000000800000001000000004f415401000000140000000100000001000100000000000901010000000000024f4154220000000100000001000000110000007274646f632e63732e7572692e65647500003991ffff0000020000002e000000018c134202000000280000000a000000018e134201000000ff7fffff280000000a000000018e134201000000ff7f000000000000ce000000010102000d0000003137322e31362e3134392e31006539912300000014010f004e5354ff2b873ff9e6060001000000010000000000000001000000010000000104000000000000000800000001000000004f415401000000140000000100000001000100000000000901010000000000024f41541e000000018c1342010000000d0000003137322e31362e3134392e3100653991ffff6475020000002e000000018e134202000000280000000a000000018e134201000000ff7f0000280000000a000000018e134201000000ff7f000000000000ca000000010102000c0000003139322e3136382e302e3100399139912300000014010f004e5354ff2b873ff9e6060001000000010000000000000001000000010000000104000000000000000800000001000000004f415401000000140000000100000001000100000000000901010000000000024f41541c000000018e1342010000000c0000003139322e3136382e302e31003991ffff020000002e000000018c134202000000280000000a000000018c134201000000ff7f0000280000000a000000018c134201000000ff7f
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/svc.conf b/TAO/orbsvcs/tests/RTCosScheduling/svc.conf
new file mode 100644
index 00000000000..84f0293b2b9
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/svc.conf
@@ -0,0 +1,2 @@
+#static RT_ORB_Loader "-ORBSchedPolicy SCHED_RR -ORBPriorityMapping linear -ORBScopePolicy SYSTEM"
+static RT_ORB_Loader "-ORBSchedPolicy SCHED_FIFO -ORBPriorityMapping linear -ORBScopePolicy SYSTEM"
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/testSched.idl b/TAO/orbsvcs/tests/RTCosScheduling/testSched.idl
new file mode 100644
index 00000000000..c2d98c7cf88
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/testSched.idl
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+
+//=============================================================================
+/**
+ * @file testSched.idl
+ *
+ * $Id$
+ *
+ * @author Matt Murphy <murphym@cs.uri.edu>
+ */
+//=============================================================================
+
+/**
+ * @class Object1
+ *
+ * @brief Used by the RTCORBA 1.0 scheduling service.
+ */
+
+#ifndef TEST_SCHED
+#define TEST_SCHED
+
+/**
+ * Object1 class is used in the RTCORBA 1.0 Scheduling
+ * Service test.
+ */
+module testSched {
+
+ exception testSchedException {};
+
+ interface Object1 {
+ /**
+ * method1 executes work at the location specified by the object reference.
+ * It sleeps for the number of seconds specified.
+ *
+ * @param seconds The number of seconds to sleep for.
+ */
+ void method1(in string activity, in long second, inout string output_file)
+ raises (testSchedException);
+ };
+
+};
+
+#endif /* TEST_SCHED */
diff --git a/TAO/orbsvcs/tests/RTCosScheduling/testSched_export.h b/TAO/orbsvcs/tests/RTCosScheduling/testSched_export.h
new file mode 100644
index 00000000000..d931b25070d
--- /dev/null
+++ b/TAO/orbsvcs/tests/RTCosScheduling/testSched_export.h
@@ -0,0 +1,60 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl testSched
+// ------------------------------
+#ifndef TESTSCHED_EXPORT_H
+#define TESTSCHED_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TESTSCHED_HAS_DLL)
+# define TESTSCHED_HAS_DLL 0
+# endif /* ! TESTSCHED_HAS_DLL */
+#else
+# if !defined (TESTSCHED_HAS_DLL)
+# define TESTSCHED_HAS_DLL 1
+# endif /* ! TESTSCHED_HAS_DLL */
+#endif
+
+#if defined (TESTSCHED_HAS_DLL) && (TESTSCHED_HAS_DLL == 1)
+# if defined (TESTSCHED_BUILD_DLL)
+# define testSched_Export ACE_Proper_Export_Flag
+# define TESTSCHED_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TESTSCHED_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TESTSCHED_BUILD_DLL */
+# define testSched_Export ACE_Proper_Import_Flag
+# define TESTSCHED_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TESTSCHED_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TESTSCHED_BUILD_DLL */
+#else /* TESTSCHED_HAS_DLL == 1 */
+# define testSched_Export
+# define TESTSCHED_SINGLETON_DECLARATION(T)
+# define TESTSCHED_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TESTSCHED_HAS_DLL == 1 */
+
+// Set TESTSCHED_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TESTSCHED_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TESTSCHED_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TESTSCHED_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TESTSCHED_NTRACE */
+
+#if (TESTSCHED_NTRACE == 1)
+# define TESTSCHED_TRACE(X)
+#else /* (TESTSCHED_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TESTSCHED_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TESTSCHED_NTRACE == 1) */
+
+#endif /* TESTSCHED_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/Makefile.am b/TAO/orbsvcs/tests/Redundant_Naming/Makefile.am
new file mode 100644
index 00000000000..7ff62dd7eec
--- /dev/null
+++ b/TAO/orbsvcs/tests/Redundant_Naming/Makefile.am
@@ -0,0 +1,84 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Redundant_Naming_Client.am
+
+BUILT_SOURCES = \
+ test_objectC.cpp \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.cpp \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.cpp \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+CLEANFILES = \
+ test_object-stamp \
+ test_objectC.cpp \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.cpp \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.cpp \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+test_objectC.cpp test_objectC.h test_objectC.inl test_objectS.cpp test_objectS.h test_objectS.inl test_objectS_T.cpp test_objectS_T.h test_objectS_T.inl: test_object-stamp
+
+test_object-stamp: $(srcdir)/test_object.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/test_object.idl
+ @touch $@
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp \
+ test_objectC.cpp \
+ test_objectS.cpp \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/README b/TAO/orbsvcs/tests/Redundant_Naming/README
new file mode 100644
index 00000000000..85ad95373a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Redundant_Naming/README
@@ -0,0 +1,89 @@
+// $Id$
+
+This application tests the redundancy feature of TAO's Naming Service.
+
+To run all tests automatically -
+ execute Perl script run_test.pl
+
+To run tests manually -
+ start the Naming Service (see
+ TAO/orbsvcs/Naming_Service/README for valid options),
+ then run ./client the optional options are shown below.
+
+NOTE: if running tests manually, the NameService directory must exist
+before starting the Naming Service and this directory must be cleaned out
+manually after stopping the Naming Service.
+
+The following options exist:
+---------------------------
+-b Breath of Context tree, default is 4, minimum is 2
+
+-d Depth of Context tree, default is 4, minimum is 2
+
+-o Breath of Object tree, default is 4, minimum is 2
+
+-p ior for Naming Server 1
+
+-q ior for Naming Server 2
+
+The client creates two context trees, one of breath b and one of depth d,
+and another node with o objects. It then removes the contexts b-1, d and
+the object o-1. All these are done using the first name server. The
+client then accesses contexts b, b-1, d, d-1, and objects o, o-1 looking
+for the appropriate found/not-found returns using the second name server.
+
+ Example (on a Unix system):
+ $ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o nsior1\
+ -r NameService -ORBEndPoint iiop://localhost:10001 &
+ $ $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o nsior2\
+ -r NameService -ORBEndPoint iiop://localhost:10002 &
+ $ ./client -p file://nsior1 -q file://nsior2
+
+ where the steps correspond to 1&2)starting the Naming Service
+ in redundant mode, 3) running the client.
+ Don't forget to kill the name servers after you are done.
+
+
+
+EXPECTED OUTPUT FOR THIS TEST
+*****************************
+
+Redundancy test OK.
+
+The default test runs in a few seconds. (4 on my 500MHz Linux)
+
+
+*****************************
+Restrictions, performance notes, and future
+
+While the redundant naming service is only fully function on Tru64
+clusters, it can be used on any two systems that share a file system
+with locking. However, this test puts the two naming servers on the
+local system doesn't test the locking (probablistic to do, at best)
+and runs the client on the same system. This will specifically test
+only the functionality of the redundancy. The extra parameters can
+be used manually to probe performance, as illustrated below.
+
+Using the b,d, and o options, I determined:
+
+As the number of objects in a single context increases, performance
+decreases. This is because of I/O limits, each addition of a new
+object reference adds about 1/2 KB and rewrites the whole file. I
+observed 9746 objects added to a single context in 100 minutes and
+noted that the disk light was on solid.
+
+As the number of contexts increase, the CPU became the limiting factor.
+2000 contexts under the root context took 20 minutes.
+
+As the depth of the contexts increases, the limit becomes the file
+system. As the number of contexts, equivalent to files, passed 12000,
+the system slowed to a crawl. The first 12000 took about 5 minutes, the
+next 15 minutes only got another 2000. Process CPU was very low, less
+than 5 %. Disk activity was high, but not contiguous, lot of head motion
+not seen in the single context above.
+
+Future enhancement of this service should address these performance
+limits. One obvious enhancement is to use IPC between the redundant
+Naming Servers to reduce the dependence on the disk, then a lazy update
+of the disk can be done. Would take a lot of code, but doable.
+
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc b/TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc
new file mode 100644
index 00000000000..bbeedbc28fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Redundant_Naming/Redundant_Naming.mpc
@@ -0,0 +1,7 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client) : namingexe, portableserver {
+ exename = client
+}
+
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/client.cpp b/TAO/orbsvcs/tests/Redundant_Naming/client.cpp
new file mode 100644
index 00000000000..9e767cc7dad
--- /dev/null
+++ b/TAO/orbsvcs/tests/Redundant_Naming/client.cpp
@@ -0,0 +1,540 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/Naming_Service/
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// This class implements a CORBA client for a redundant CosNaming
+// Service using stubs generated by the TAO ORB IDL compiler.
+//
+// = AUTHORS
+// Rich Seibel <seibel_r@ociweb.com>
+// ============================================================================
+
+#include "test_objectS.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Server.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID (Simple_Naming,
+ client,
+ "$Id$")
+
+#if defined (_MSC_VER)
+# pragma warning (disable : 4250)
+#endif /* _MSC_VER */
+
+class My_Test_Object :
+ public virtual POA_Test_Object
+{
+public:
+ // = Initialization and termination methods.
+ My_Test_Object (CORBA::Short id = 0);
+ // Constructor.
+
+ ~My_Test_Object (void);
+ // Destructor.
+
+ // = Interface implementation accessor methods.
+
+ void id (CORBA::Short id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Sets id.
+
+ CORBA::Short id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Gets id.
+
+private:
+ short id_;
+};
+
+My_Test_Object::My_Test_Object (CORBA::Short id)
+ : id_ (id)
+{
+}
+
+My_Test_Object::~My_Test_Object (void)
+{
+}
+
+CORBA::Short
+My_Test_Object::id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return id_;
+}
+
+void
+My_Test_Object::id (CORBA::Short id ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ id_ = id;
+}
+
+
+// This function runs the test.
+
+int
+main (int argc, ACE_TCHAR **argv)
+{
+ int c_breath = 4;
+ int c_depth = 4;
+ int o_breath = 4;
+ ACE_TCHAR *ns1ref = 0;
+ ACE_TCHAR *ns2ref = 0;
+
+ ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("b:d:o:p:q:"));
+ int c;
+ int i;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'b':
+ i = ACE_OS::atoi(get_opts.opt_arg ());
+ if (i<2)
+ {
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT ("Invalid breath, must be 2 or more\n")));
+ exit(1);
+ }
+ c_breath = i;
+ break;
+ case 'd':
+ i = ACE_OS::atoi(get_opts.opt_arg ());
+ if (i<2)
+ {
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT ("Invalid depth, must be 2 or more\n")));
+ exit(1);
+ }
+ c_depth = i;
+ break;
+ case 'o':
+ i = ACE_OS::atoi(get_opts.opt_arg ());
+ if (i<2)
+ {
+ ACE_ERROR((LM_ERROR,
+ ACE_TEXT ("Invalid breath, must be 2 or more\n")));
+ exit(1);
+ }
+ o_breath = i;
+ break;
+ case 'p':
+ ns1ref = get_opts.opt_arg ();
+ break;
+ case 'q':
+ ns2ref = get_opts.opt_arg ();
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Argument %c \n usage: %s")
+ ACE_TEXT (" [-b <breath of context tree>]")
+ ACE_TEXT (" [-d <depth of context tree>]")
+ ACE_TEXT (" [-o <breath of object tree>]")
+ ACE_TEXT (" -p <ior of first name server>")
+ ACE_TEXT (" -q <ior of second name server>")
+ ACE_TEXT ("\n")),
+ -1);
+ }
+
+ CosNaming::NamingContext_var root_context_1;
+ CosNaming::NamingContext_var root_context_2;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_EX(bl_a)
+ {
+ // Initialize orb
+ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+
+ // ior's are specified for the name servers through a commandline
+ // option or a file.
+
+ // Resolve the first name server
+
+ CORBA::Object_var ns1obj = orb->string_to_object (
+ ACE_TEXT_ALWAYS_CHAR (ns1ref) ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_a);
+
+ if (CORBA::is_nil (ns1obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("invalid ior <%s>\n"),
+ ns1ref),
+ -1);
+ root_context_1 = CosNaming::NamingContext::_narrow (ns1obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK_EX(bl_a);
+
+ // Resolve the second name server
+
+ CORBA::Object_var ns2obj = orb->string_to_object (
+ ACE_TEXT_ALWAYS_CHAR (ns2ref) ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_a);
+
+ if (CORBA::is_nil (ns2obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("invalid ior <%s>\n"),
+ ns2ref),
+ -1);
+ root_context_2 = CosNaming::NamingContext::_narrow (ns2obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_a);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to resolve name servers"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Create a bunch of objects in one context
+ // Note: strings to the naming service must be char, not wchar
+ ACE_TRY_EX(bl_b)
+ {
+ // Bind one context level under root.
+ CosNaming::Name level1;
+ level1.length (1);
+ level1[0].id = CORBA::string_dup ("level1_context");
+ CosNaming::NamingContext_var level1_context;
+ level1_context = root_context_1->bind_new_context (level1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_b);
+ for (i=0; i<o_breath; i++)
+ {
+ // Instantiate a dummy object and bind it under the new context.
+ My_Test_Object *impl1 = new My_Test_Object (i+1);
+ Test_Object_var obj1 = impl1->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_b);
+ impl1->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_b);
+
+ CosNaming::Name obj_name;
+ obj_name.length (1);
+ char wide_name[16];
+ ACE_OS::sprintf(wide_name, "obj_%d", i);
+ obj_name[0].id = CORBA::string_dup (wide_name);
+ level1_context->bind (obj_name, obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_b);
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to create a lot of objects"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Create a deep context tree
+ ACE_TRY_EX(bl_c)
+ {
+ CosNaming::NamingContext_var next_context = root_context_1;
+ for (i=0; i<c_depth; i++)
+ {
+ // Bind level1 context under root.
+ CosNaming::Name deep;
+ deep.length (1);
+ char deep_name[16];
+ ACE_OS::sprintf(deep_name, "deep_%d", i);
+ deep[0].id = CORBA::string_dup (deep_name);
+ CosNaming::NamingContext_var deep_context;
+ deep_context = next_context->bind_new_context (deep
+ ACE_ENV_ARG_PARAMETER);
+ next_context = deep_context;
+ ACE_TRY_CHECK_EX(bl_c);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to create deep context"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Create a wide context tree
+ ACE_TRY_EX(bl_d)
+ {
+ for (i=0; i<c_breath; i++)
+ {
+ // Bind all level of context under root.
+ CosNaming::Name wide;
+ wide.length (1);
+ char wide_name[16];
+ ACE_OS::sprintf(wide_name, "wide_%d", i);
+ wide[0].id = CORBA::string_dup (wide_name);
+ CosNaming::NamingContext_var wide_context;
+ wide_context = root_context_1->bind_new_context (wide
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_d);
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to create wide context"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Delete three selected things, one from each tree
+ ACE_TRY_EX(bl_e)
+ {
+ // Remove the second to last object from the Naming Context
+ CosNaming::Name wide1;
+ wide1.length (2);
+ wide1[0].id = CORBA::string_dup ("level1_context");
+ char wide_name[16];
+ ACE_OS::sprintf(wide_name, "obj_%d", o_breath-2);
+ wide1[1].id = CORBA::string_dup (wide_name);
+ root_context_1->unbind (wide1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+
+ // Remove the second to last context from the wide root Naming Context
+ CosNaming::Name wide2;
+ wide2.length (1);
+ ACE_OS::sprintf(wide_name, "wide_%d", c_breath-2);
+ wide2[0].id = CORBA::string_dup (wide_name);
+ CORBA::Object_var result_obj_ref = root_context_1->resolve (wide2
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+ CosNaming::NamingContext_var result_object =
+ CosNaming::NamingContext::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+ if (CORBA::is_nil (result_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving wide context ")
+ ACE_TEXT ("- nil object ref.\n")),
+ -1);
+ result_object->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+ root_context_1->unbind (wide2 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+
+ // Remove the last context from the deep Naming Context
+ CosNaming::Name deep;
+ deep.length (c_depth);
+ char deep_name[16];
+ for (i=0; i<c_depth; i++)
+ {
+ ACE_OS::sprintf(deep_name, "deep_%d", i);
+ deep[i].id = CORBA::string_dup (deep_name);
+ }
+ result_obj_ref = root_context_1->resolve (deep ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+ result_object =
+ CosNaming::NamingContext::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+ if (CORBA::is_nil (result_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving deep context ")
+ ACE_TEXT ("- nil object ref.\n")),
+ -1);
+ result_object->destroy(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+ root_context_1->unbind (deep ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_e);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to delete objects"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Now use the other name server to access 3 objects next to the
+ // deleted objects and the 3 deleted objects
+ ACE_TRY_EX(bl_f)
+ {
+ // Access the last object from the Naming Context
+ CosNaming::Name wide;
+ wide.length (2);
+ wide[0].id = CORBA::string_dup ("level1_context");
+ char wide_name[16];
+ ACE_OS::sprintf(wide_name, "obj_%d", o_breath-1);
+ wide[1].id = CORBA::string_dup (wide_name);
+ CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_f);
+ Test_Object_var result_object = Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_f);
+ if (CORBA::is_nil (result_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving object from ")
+ ACE_TEXT ("redundant server - nil object ref.\n")),
+ -1);
+ ACE_TRY_CHECK_EX(bl_f);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to resolve object from redundant server"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_TRY_EX(bl_g)
+ {
+ // Access the deleted second to last object from the Naming Context
+ CosNaming::Name wide;
+ wide.length (2);
+ wide[0].id = CORBA::string_dup ("level1_context");
+ char wide_name[16];
+ ACE_OS::sprintf(wide_name, "obj_%d", o_breath-2);
+ wide[1].id = CORBA::string_dup (wide_name);
+ CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_g);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving object from ")
+ ACE_TEXT ("redundant server - deleted object found.\n")),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ //expect exception since the context was deleted
+ }
+ ACE_ENDTRY;
+
+ ACE_TRY_EX(bl_h)
+ {
+ // Access the last context from the wide Naming Context
+ CosNaming::Name wide;
+ wide.length (1);
+ char wide_name[16];
+ ACE_OS::sprintf(wide_name, "wide_%d", c_breath-1);
+ wide[0].id = CORBA::string_dup (wide_name);
+ CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_h);
+ CosNaming::NamingContext_var result_object =
+ CosNaming::NamingContext::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_h);
+ if (CORBA::is_nil (result_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving wide context from ")
+ ACE_TEXT ("redundant server - nil object ref.\n")),
+ -1);
+ ACE_TRY_CHECK_EX(bl_h);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to resolve wide context from redundant server"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_TRY_EX(bl_i)
+ {
+ // Access the deleted second to last object from the Naming Context
+ CosNaming::Name wide;
+ wide.length (2);
+ char wide_name[16];
+ ACE_OS::sprintf(wide_name, "wide_%d", c_breath-2);
+ wide[0].id = CORBA::string_dup (wide_name);
+ CORBA::Object_var result_obj_ref = root_context_2->resolve (wide
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_i);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving wide context from ")
+ ACE_TEXT ("redundant server - deleted object found.\n")),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ //expect exception since the context was deleted
+ }
+ ACE_ENDTRY;
+
+ ACE_TRY_EX(bl_j)
+ {
+ // Access the deleted last context from the deep Naming Context
+ CosNaming::Name deep;
+ deep.length (c_depth);
+ char deep_name[16];
+ for (i=0; i<c_depth; i++)
+ {
+ ACE_OS::sprintf(deep_name, "deep_%d", i);
+ deep[i].id = CORBA::string_dup (deep_name);
+ }
+ CORBA::Object_var result_obj_ref = root_context_1->resolve (deep
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_j);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving deep context from ")
+ ACE_TEXT ("redundant server - deleted object found.\n")),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ //expect exception since the context was deleted
+ }
+ ACE_ENDTRY;
+
+ ACE_TRY_EX(bl_k)
+ {
+ // Access the second to last object from the Naming Context
+ CosNaming::Name deep;
+ deep.length (c_depth-1);
+ char deep_name[16];
+ for (i=0; i<c_depth-1; i++)
+ {
+ ACE_OS::sprintf(deep_name, "deep_%d", i);
+ deep[i].id = CORBA::string_dup (deep_name);
+ }
+ CORBA::Object_var result_obj_ref = root_context_1->resolve (deep
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_k);
+ CosNaming::NamingContext_var result_object =
+ CosNaming::NamingContext::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX(bl_k);
+ if (CORBA::is_nil (result_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("Problems with resolving deep context from ")
+ ACE_TEXT ("redundant server - nil object ref.\n")),
+ -1);
+
+ ACE_TRY_CHECK_EX(bl_k);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Unable to resolve deep context from redundant server"));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Redundancy test OK\n")));
+ return 0;
+
+}
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/run_test.pl b/TAO/orbsvcs/tests/Redundant_Naming/run_test.pl
new file mode 100755
index 00000000000..cf61aa7d89d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Redundant_Naming/run_test.pl
@@ -0,0 +1,118 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs a Naming Service test. It starts
+# all the servers and clients as necessary.
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+use Cwd;
+
+$startdir = getcwd();
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+
+$quiet = 0;
+
+# check for -q flag
+if ($ARGV[0] eq '-q') {
+ $quiet = 1;
+}
+
+# Variables for command-line arguments to client and server
+# executables.
+$ns_orb_port1 = 10001 + PerlACE::uniqueid ();
+$ns_orb_port2 = 10002 + PerlACE::uniqueid ();
+$ns_endpoint1 = "iiop://localhost:$ns_orb_port1";
+$ns_endpoint2 = "iiop://localhost:$ns_orb_port2";
+$iorfile1 = PerlACE::LocalFile ("ns1.ior");
+$iorfile2 = PerlACE::LocalFile ("ns2.ior");
+
+$status = 0;
+
+## Allow the user to determine where the persistent file will be located
+## just in case the current directory is not suitable for locking.
+## We can't change the name of the persistent file because that is not
+## sufficient to work around locking problems for Tru64 when the current
+## directory is NFS mounted from a system that does not properly support
+## locking.
+foreach my $possible ($ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP}) {
+ if (defined $possible && -d $possible) {
+ if (chdir($possible)) {
+ last;
+ }
+ }
+}
+
+print "INFO: Running the test in ", getcwd(), "\n";
+
+# Make sure that the directory to use to hold the naming contexts exists
+# and is cleaned out
+if ( ! -d "NameService" ) {
+ mkdir (NameService, 0777);
+ }
+else {
+ chdir "NameService";
+ opendir(THISDIR, ".");
+ @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+ closedir(THISDIR);
+ unlink @allfiles;
+ chdir "..";
+ }
+
+# Run two Naming Servers in redundant mode and one client. Client uses iors
+# in files to find the individual copies of the Naming Servers.
+
+my $args = "-ORBEndPoint $ns_endpoint1 -o $iorfile1 -m 0 -r NameService";
+my $prog = "$startdir/../../Naming_Service/Naming_Service";
+$NS1 = new PerlACE::Process ($prog, $args);
+
+unlink $iorfile1;
+
+$NS1->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile1, $sleeptime) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
+ $NS1->Kill ();
+ exit 1;
+}
+
+my $args = "-ORBEndPoint $ns_endpoint2 -o $iorfile2 -m 0 -r NameService";
+my $prog = "$startdir/../../Naming_Service/Naming_Service";
+$NS2 = new PerlACE::Process ($prog, $args);
+
+unlink $iorfile2;
+
+$NS2->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile2, $sleeptime) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
+ $NS2->Kill ();
+ exit 1;
+}
+
+my $args = "-p file://$iorfile1 -q file://$iorfile2";
+my $prog = "$startdir/client";
+
+$CL = new PerlACE::Process ($prog, $args);
+
+$client = $CL->SpawnWaitKill (12);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$NS1->Kill ();
+$NS2->Kill ();
+
+unlink $iorfile1;
+unlink $iorfile2;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Redundant_Naming/test_object.idl b/TAO/orbsvcs/tests/Redundant_Naming/test_object.idl
new file mode 100644
index 00000000000..4737f6dc6c8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Redundant_Naming/test_object.idl
@@ -0,0 +1,11 @@
+// $Id$
+
+interface Test_Object
+{
+ // = TITLE
+ // This is a simple interface that tests the Naming Service.
+
+ attribute short id;
+ // This provides an easy way to differentiate objects if each
+ // objects is served by a separate servant.
+};
diff --git a/TAO/orbsvcs/tests/Sched/DynSched_Test.cpp b/TAO/orbsvcs/tests/Sched/DynSched_Test.cpp
new file mode 100644
index 00000000000..fe06daf6ba8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched/DynSched_Test.cpp
@@ -0,0 +1,320 @@
+// $Id$
+
+#include "orbsvcs/Sched/Strategy_Scheduler.h"
+#include "orbsvcs/Time_Utilities.h"
+#if defined (ACE_HAS_QUANTIFY)
+# include <quantify.h>
+#endif /* ACE_HAS_QUANTIFY */
+
+ACE_RCSID (Sched,
+ DynSched_Test,
+ "$Id$")
+
+// period times, in 100 nanoseconds
+#define ONE_HZ 10000000
+#define FIVE_HZ 2000000
+#define TEN_HZ 1000000
+#define TWENTY_HZ 500000
+
+class DynSched_Test
+ // = TITLE
+ // DynSched Test wrapper
+ // = DESCRIPTION
+ // Wraps static functions for test
+{
+public:
+
+ static void setup_rt_info (RtecScheduler::RT_Info &info,
+ const char *entry_point,
+ u_long period,
+ RtecScheduler::Time execution,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Importance_t importance,
+ u_long threads);
+ // Initializes an RT_Info.
+
+ static int register_rt_info (ACE_DynScheduler &scheduler,
+ RtecScheduler::RT_Info &info);
+ // Registers an RT_Info.
+
+
+#if 0 /* not currently used */
+ static void setup_conjunction (RtecScheduler::RT_Info &info,
+ const char *entry_point);
+ // Sets up a conjunction.
+
+ static void setup_disjunction (RtecScheduler::RT_Info &info,
+ const char *entry_point);
+ // Sets up a disjunction.
+
+#endif /* not currently used */
+
+ static int run_schedule (ACE_Scheduler_Strategy &strategy,
+ const char *output_filename,
+ const char *heading);
+ // Creates the schedule, runs timelines.
+
+};
+
+
+// Initializes an RT_Info.
+
+void
+DynSched_Test::setup_rt_info (RtecScheduler::RT_Info &info,
+ const char *entry_point,
+ u_long period,
+ RtecScheduler::Time execution,
+ RtecScheduler::Criticality_t criticality,
+ RtecScheduler::Importance_t importance,
+ u_long threads)
+{
+ // copy the passed entry point string into the RT_Info
+ info.entry_point = CORBA::string_dup (entry_point);
+
+ // initialize other values
+ info.handle = 0;
+ info.worst_case_execution_time = execution;
+ info.typical_execution_time = execution;
+ info.cached_execution_time = ORBSVCS_Time::zero ();
+ info.period = period;
+ info.criticality = criticality;
+ info.importance = importance;
+ info.quantum = ORBSVCS_Time::zero ();
+ info.threads = threads;
+ info.priority = 0;
+ info.preemption_subpriority = 0;
+ info.preemption_priority = 0;
+ info.info_type = RtecScheduler::OPERATION;
+ info.volatile_token = 0;
+}
+
+
+// Registers an RT_Info.
+
+int
+DynSched_Test::register_rt_info (ACE_DynScheduler &scheduler,
+ RtecScheduler::RT_Info &info)
+{
+ int result = 0;
+
+ if (scheduler.register_task (&info, info.handle) !=
+ ACE_DynScheduler::SUCCEEDED)
+ {
+ result = 1;
+ printf ("Could not register info for \"%s\"\n", info.entry_point.in ());
+ }
+
+ return result;
+}
+
+#if 0 /* not currently used */
+
+// Sets up a conjunction.
+
+void
+DynSched_Test::setup_conjunction (RtecScheduler::RT_Info &info,
+ const char *entry_point)
+{
+ // copy the passed entry point string into the RT_Info
+ info.entry_point = CORBA::string_dup (entry_point);
+
+ // initialize other values
+ info.handle = 0;
+ info.worst_case_execution_time = ORBSVCS_Time::zero ();
+ info.typical_execution_time = ORBSVCS_Time::zero ();
+ info.cached_execution_time = ORBSVCS_Time::zero ();
+ info.period = 0;
+ info.criticality = RtecScheduler::VERY_LOW_CRITICALITY;
+ info.importance = RtecScheduler::VERY_LOW_IMPORTANCE;
+ info.quantum = ORBSVCS_Time::zero ();
+ info.threads = 0;
+ info.priority = 0;
+ info.preemption_subpriority = 0;
+ info.preemption_priority = 0;
+ info.info_type = RtecScheduler::CONJUNCTION;
+ info.volatile_token = 0;
+}
+
+
+// Sets up a disjunction.
+
+void
+DynSched_Test::setup_disjunction (RtecScheduler::RT_Info &info,
+ const char *entry_point)
+{
+ // copy the passed entry point string into the RT_Info
+ info.entry_point = CORBA::string_dup (entry_point);
+
+ // initialize other values
+ info.handle = 0;
+ info.worst_case_execution_time = ORBSVCS_Time::zero ();
+ info.typical_execution_time = ORBSVCS_Time::zero ();
+ info.cached_execution_time = ORBSVCS_Time::zero ();
+ info.period = 0;
+ info.criticality = RtecScheduler::VERY_LOW_CRITICALITY;
+ info.importance = RtecScheduler::VERY_LOW_IMPORTANCE;
+ info.quantum = ORBSVCS_Time::zero ();
+ info.threads = 0;
+ info.priority = 0;
+ info.preemption_subpriority = 0;
+ info.preemption_priority = 0;
+ info.info_type = RtecScheduler::DISJUNCTION;
+ info.volatile_token = 0;
+}
+#endif /* not currently used */
+
+
+// Creates the schedule, runs timelines.
+
+int
+DynSched_Test::run_schedule (ACE_Scheduler_Strategy &strategy,
+ const char *output_filename,
+ const char *heading)
+{
+ RtecScheduler::RT_Info low_1, low_5, low_10, low_20;
+ RtecScheduler::RT_Info high_1, high_5, high_10, high_20;
+
+ ACE_Strategy_Scheduler scheduler (strategy);
+
+ DynSched_Test::setup_rt_info (low_1, "low_1", ONE_HZ, 180000,
+ RtecScheduler::LOW_CRITICALITY,
+ RtecScheduler::HIGH_IMPORTANCE, 1);
+ DynSched_Test::setup_rt_info (low_5, "low_5", FIVE_HZ, 180000,
+ RtecScheduler::LOW_CRITICALITY,
+ RtecScheduler::HIGH_IMPORTANCE, 1);
+ DynSched_Test::setup_rt_info (low_10, "low_10", TEN_HZ, 180000,
+ RtecScheduler::LOW_CRITICALITY,
+ RtecScheduler::HIGH_IMPORTANCE, 1);
+ DynSched_Test::setup_rt_info (low_20, "low_20", TWENTY_HZ, 180000,
+ RtecScheduler::LOW_CRITICALITY,
+ RtecScheduler::HIGH_IMPORTANCE, 1);
+ DynSched_Test::setup_rt_info (high_1, "high_1", ONE_HZ, 180000,
+ RtecScheduler::HIGH_CRITICALITY,
+ RtecScheduler::LOW_IMPORTANCE, 1);
+ DynSched_Test::setup_rt_info (high_5, "high_5", FIVE_HZ, 180000,
+ RtecScheduler::HIGH_CRITICALITY,
+ RtecScheduler::LOW_IMPORTANCE, 1);
+ DynSched_Test::setup_rt_info (high_10, "high_10", TEN_HZ, 180000,
+ RtecScheduler::HIGH_CRITICALITY,
+ RtecScheduler::LOW_IMPORTANCE, 1);
+ DynSched_Test::setup_rt_info (high_20, "high_20", TWENTY_HZ, 180000,
+ RtecScheduler::HIGH_CRITICALITY,
+ RtecScheduler::LOW_IMPORTANCE, 1);
+
+ if (
+ DynSched_Test::register_rt_info (scheduler, low_1) ||
+ DynSched_Test::register_rt_info (scheduler, low_5) ||
+ DynSched_Test::register_rt_info (scheduler, low_10) ||
+ DynSched_Test::register_rt_info (scheduler, low_20) ||
+ DynSched_Test::register_rt_info (scheduler, high_1) ||
+ DynSched_Test::register_rt_info (scheduler, high_5) ||
+ DynSched_Test::register_rt_info (scheduler, high_10) ||
+ DynSched_Test::register_rt_info (scheduler, high_20))
+ {
+ return -1;
+ }
+
+#if defined (ACE_HAS_QUANTIFY)
+ quantify_start_recording_data ();
+#endif /* ACE_HAS_QUANTIFY */
+
+ ACE_Unbounded_Set<RtecScheduler::Scheduling_Anomaly *> anomaly_set;
+ ACE_DynScheduler::status_t status = scheduler.schedule (anomaly_set);
+
+#if defined (ACE_HAS_QUANTIFY)
+ quantify_stop_recording_data ();
+#endif /* ACE_HAS_QUANTIFY */
+
+ switch (status)
+ {
+ case ACE_DynScheduler::SUCCEEDED:
+ case ACE_DynScheduler::ST_UTILIZATION_BOUND_EXCEEDED:
+
+ status = scheduler.output_timeline (output_filename, heading);
+ switch (status)
+ {
+ case ACE_DynScheduler::SUCCEEDED:
+ case ACE_DynScheduler::ST_UTILIZATION_BOUND_EXCEEDED:
+ break;
+
+ default :
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "scheduler.output_timeline (\"%s\") failed: "
+ "returned %d\n",
+ output_filename, status), -1);
+ }
+
+ break;
+
+ default :
+
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "scheduler.schedule () failed: "
+ "returned %d\n",
+ status), -1);
+ }
+
+ return 0;
+}
+
+int
+main (int, char *[])
+{
+ int result = 0;
+
+ // create a bunch of different strategies, indicating the minimum critical
+ // priority level (number of priority levels in critical set - 1) for each.
+
+ ACE_RMS_Scheduler_Strategy rms_strategy (3);
+
+ ACE_MLF_Scheduler_Strategy mlf_strategy (0);
+ ACE_EDF_Scheduler_Strategy edf_strategy (0);
+
+ ACE_MUF_Scheduler_Strategy muf_strategy (0);
+
+ result =
+ DynSched_Test::run_schedule (rms_strategy, "RMS_Timelines",
+ "RMS Scheduling Strategy");
+ if (result < 0)
+ {
+ printf ("run_schedule (rms_strategy, \"RMS_Timelines\", "
+ "\"RMS Scheduling Strategy\") returned %d\n",
+ result);
+ return 1;
+ }
+
+ result =
+ DynSched_Test::run_schedule (mlf_strategy, "MLF_Timelines",
+ "MLF Scheduling Strategy");
+ if (result < 0)
+ {
+ printf ("run_schedule (mlf_strategy, \"MLF_Timelines\", "
+ "\"MLF Scheduling Strategy\") returned %d\n",
+ result);
+ return 1;
+ }
+
+ result =
+ DynSched_Test::run_schedule (edf_strategy, "EDF_Timelines",
+ "EDF Scheduling Strategy");
+ if (result < 0)
+ {
+ printf ("run_schedule (edf_strategy, \"EDF_Timelines\", "
+ "\"EDF Scheduling Strategy\") returned %d\n",
+ result);
+ return 1;
+ }
+
+ result =
+ DynSched_Test::run_schedule (muf_strategy, "MUF_Timelines",
+ "MUF Scheduling Strategy");
+ if (result < 0)
+ {
+ printf ("run_schedule (muf_strategy, \"MUF_Timelines\", "
+ "\"MUF Scheduling Strategy\") returned %d\n",
+ result);
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Sched/Makefile.am b/TAO/orbsvcs/tests/Sched/Makefile.am
new file mode 100644
index 00000000000..d561f875016
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched/Makefile.am
@@ -0,0 +1,46 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Sched.am
+
+noinst_PROGRAMS = Sched
+
+Sched_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Sched_SOURCES = \
+ DynSched_Test.cpp
+
+Sched_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Sched/Sched.mpc b/TAO/orbsvcs/tests/Sched/Sched.mpc
new file mode 100644
index 00000000000..1473382f007
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched/Sched.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project: namingexe, rtsched {
+ exename = Sched
+}
diff --git a/TAO/orbsvcs/tests/Sched_Conf/Makefile.am b/TAO/orbsvcs/tests/Sched_Conf/Makefile.am
new file mode 100644
index 00000000000..3ea1fb05ab9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Sched_Conf.am
+
+noinst_PROGRAMS = Sched_Conf
+
+Sched_Conf_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+Sched_Conf_SOURCES = \
+ Sched_Conf.cpp \
+ Sched_Conf_Anomalies_Runtime.h \
+ Sched_Conf_Runtime.h
+
+Sched_Conf_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_RTSched.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Sched_Conf/README b/TAO/orbsvcs/tests/Sched_Conf/README
new file mode 100644
index 00000000000..e787e7d690a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/README
@@ -0,0 +1,42 @@
+Overview:
+
+ The scheduling service can run in one of two different modes of
+ operation, an off-line configuration mode, and a run-time execution mode.
+ The application uses the Scheduler_Factory to specify in which mode
+ it would like to use the scheduling service.
+
+ In the configuration mode, the application registers RT_Infos containing
+ operation characteristics with the off-line scheduler, and also specifies
+ operation dependencies. The Event Channel also registers RT_Infos for its
+ own operations, and specifies any additional dependencies introduced by
+ subscription or event correllation.
+
+ Once all operations are registered, the application invokes the
+ scheduler's compute_scheduling method. The scheduler generates a
+ "schedule" consisting of operation priorities and sub-priorities, and
+ determines whether or not the schedule is feasible. The scheduler also
+ produces queue specification information that can be used to configure
+ the dispatching module's number and kinds of queues (this
+ automatic dispatching module configuration will appear in a TAO release
+ *very* soon). The application then may ask the config scheduler to dump
+ it's schedule to a header file.
+
+ The Sched_Conf.cpp file in this directory is an example of how this is done.
+ Building and running the Sched_Conf executable will produce a header file
+ called Sched_Conf_Runtime.h, which is included by Sched_Conf_Runtime.cpp.
+
+ The dumped header file contains tables with the static scheduling and
+ configuration information. The Sched_Conf_Runtime application passes this
+ information to the run-time scheduler at start-up. The application may also
+ re-register its operations to verify the correct operations were loaded. The
+ Sched_Conf_Runtime does this, and in fact exercises a number of methods
+ of the run-time scheduler to ensure it gives correct responses for the
+ table of operations with which it was instantiated.
+
+Program operation:
+
+ build Sched_Conf
+ run Sched_Conf
+ build Sched_Conf_Runtime
+ run Sched_Conf_Runtime
+
diff --git a/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.cpp b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.cpp
new file mode 100644
index 00000000000..a856587a8f7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.cpp
@@ -0,0 +1,452 @@
+// $Id$
+
+// This program performa a simple scheduler configuration run,
+// and dumps the results of one scheduling into a C++ header file.
+
+#include "ace/Sched_Params.h"
+#include "ace/Get_Opt.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "orbsvcs/Naming/Naming_Server.h"
+
+ACE_RCSID (Sched_Conf,
+ Sched_Conf,
+ "$Id$")
+
+const char* service_name = "ScheduleService";
+
+const char* format_string = " {%-12s, %d, %d, %d, %d, %8d, "
+ " static_cast<RtecScheduler::Criticality_t> (%d), "
+ " static_cast<RtecScheduler::Importance_t> (%d), "
+ " %d, %d, %3d, %d, %d, "
+ "static_cast<RtecScheduler::Info_Type_t> (%d)}\n";
+
+int
+parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "n:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ service_name = get_opt.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-n service_name "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (parse_args (argc, argv) != 0)
+ {
+ return 1;
+ }
+
+ // create initial data for supplier and consumer operations
+ const int operation_count = 16;
+ ACE_Scheduler_Factory::POD_RT_Info config_infos[operation_count] = {
+ // 20 Hz high criticality supplier
+ { "high_20_S", // entry point
+ 0, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 500000, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 1, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 20 Hz low criticality supplier
+ { "low_20_S", // entry point
+ 0, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 500000, // period (100 ns)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 1, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 10 Hz high criticality supplier
+ { "high_10_S", // entry point
+ 0, // handle
+ 10000, // worst case execution time
+ 10000, // typical execution time (unused)
+ 10000, // cached execution time
+ 1000000, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 1, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 10 Hz low criticality supplier
+ { "low_10_S", // entry point
+ 0, // handle
+ 10000, // worst case execution time
+ 10000, // typical execution time (unused)
+ 10000, // cached execution time
+ 1000000, // period (100 ns)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 1, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 5 Hz high criticality supplier
+ { "high_05_S", // entry point
+ 0, // handle
+ 20000, // worst case execution time
+ 20000, // typical execution time (unused)
+ 20000, // cached execution time
+ 2000000, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 1, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 5 Hz low criticality supplier
+ { "low_05_S", // entry point
+ 0, // handle
+ 20000, // worst case execution time
+ 20000, // typical execution time (unused)
+ 20000, // cached execution time
+ 2000000, // period (100 ns)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 1, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler:: RT_INFO_ENABLED
+ },
+ // 1 Hz high criticality supplier (declares a rate but no threads)
+ { "high_01_S", // entry point
+ 0, // handle
+ 100000, // worst case execution time
+ 100000, // typical execution time (unused)
+ 100000, // cached execution time
+ 10000000, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 1 Hz low criticality supplier (remote dependant: scheduler should warn)
+ { "low_01_S", // entry point
+ 0, // handle
+ 100000, // worst case execution time
+ 100000, // typical execution time (unused)
+ 100000, // cached execution time
+ 10000000, // period (100 ns)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 20 Hz high criticality consumer
+ { "high_20_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 20 Hz low criticality consumer
+ { "low_20_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 10 Hz high criticality consumer
+ { "high_10_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 10 Hz low criticality consumer
+ { "low_10_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 5 Hz high criticality consumer
+ { "high_05_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 5 Hz low criticality consumer
+ { "low_05_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 1 Hz high criticality consumer
+ { "high_01_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ },
+ // 1 Hz low criticality consumer
+ { "low_01_C", // entry point
+ 0, // handle
+ 0, // worst case execution time
+ 0, // typical execution time (unused)
+ 0, // cached execution time
+ 0, // period (zero)
+ RtecScheduler::LOW_CRITICALITY, // criticality
+ RtecScheduler::HIGH_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION, // info type
+ RtecScheduler::RT_INFO_ENABLED
+ }
+ };
+
+
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "internet" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the naming services
+ TAO_Naming_Client my_name_client;
+ if (my_name_client.init (orb.in ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ CosNaming::NamingContext_var context =
+ my_name_client.get_context ();
+
+ if (ACE_Scheduler_Factory::use_config (context.in (),
+ service_name) < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to bind to the scheduling service.\n"),
+ 1);
+
+ // Create and initialize RT_Infos in the scheduler, make second
+ // half of array depend on first half.
+ for (int i = 0; i < operation_count; ++i)
+ {
+ // create the RT_Info
+ config_infos[i].handle =
+ ACE_Scheduler_Factory::server ()->create (config_infos[i].entry_point
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // initialize the RT_Info
+ ACE_Scheduler_Factory::server ()->
+ set (config_infos[i].handle,
+ static_cast<RtecScheduler::Criticality_t> (config_infos[i].criticality),
+ config_infos[i].worst_case_execution_time,
+ config_infos[i].typical_execution_time,
+ config_infos[i].cached_execution_time,
+ config_infos[i].period,
+ static_cast<RtecScheduler::Importance_t> (config_infos[i].importance),
+ config_infos[i].quantum,
+ config_infos[i].threads,
+ static_cast<RtecScheduler::Info_Type_t> (config_infos[i].info_type)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // make operations in second half dependant on
+ // operations in the first half of the array,
+ // and have each called twice as a oneway call
+ if (i >= (operation_count / 2))
+ {
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[i].handle,
+ config_infos[i - (operation_count / 2)].handle,
+ 2, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+
+ RtecScheduler::RT_Info_Set_var infos;
+ RtecScheduler::Dependency_Set_var deps;
+ RtecScheduler::Config_Info_Set_var configs;
+ RtecScheduler::Scheduling_Anomaly_Set_var anomalies;
+
+ ACE_Scheduler_Factory::server ()->compute_scheduling
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD),
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD),
+ infos.out (), deps.out (), configs.out (), anomalies.out ()
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::dump_schedule (infos.in (),
+ deps.in (),
+ configs.in (),
+ anomalies.in (),
+ "Sched_Conf_Runtime.h",
+ format_string);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "SYS_EX");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.mpc b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.mpc
new file mode 100644
index 00000000000..42819839f12
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf.mpc
@@ -0,0 +1,8 @@
+// -*- MPC -*-
+// $Id$
+
+project: namingexe, rtsched {
+ Source_Files {
+ Sched_Conf.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies.cpp b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies.cpp
new file mode 100644
index 00000000000..23d60c3709c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies.cpp
@@ -0,0 +1,381 @@
+// $Id$
+
+// This program performa a simple scheduler configuration run,
+// and dumps the results of one scheduling into a C++ header file.
+
+#include "ace/Sched_Params.h"
+#include "ace/Get_Opt.h"
+#include "tao/corba.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/Naming/Naming_Server.h"
+
+ACE_RCSID(Sched_Conf, Sched_Conf_Anomalies, "$Id$")
+
+const char* service_name = "ScheduleService";
+
+const char* format_string = "{%-12s, %d, %d, %d, %d, %8d, "
+ "static_cast<RtecScheduler::Criticality_t> (%d), "
+ "static_cast<RtecScheduler::Importance_t> (%d), "
+ "%d, %d, %3d, %d, %d, "
+ "static_cast<RtecScheduler::Info_Type_t> (%d)}\n";
+
+int
+parse_args (int argc, char *argv [])
+{
+ ACE_Get_Opt get_opt (argc, argv, "n:");
+ int opt;
+
+ while ((opt = get_opt ()) != EOF)
+ {
+ switch (opt)
+ {
+ case 'n':
+ service_name = get_opt.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s "
+ "-n service_name "
+ "\n",
+ argv[0]));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (parse_args (argc, argv) != 0)
+ {
+ return 1;
+ }
+
+ // create initial data for supplier and consumer operations
+ const int operation_count = 8;
+ ACE_Scheduler_Factory::POD_RT_Info config_infos[operation_count] = {
+ // good supplier (no unresolved dependencies)
+ { "good_supplier", // entry point
+ 0, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 500000, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 1, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION // info type
+ },
+ // good consumer (no unresolved dependencies)
+ { "good_consumer", // entry point
+ 1, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 0, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION // info type
+ },
+ // supplier with unresolved remote dependencies
+ { "unresolved_remote_supplier", // entry point
+ 2, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 0, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::REMOTE_DEPENDANT // info type
+ },
+ // consumer with unresolved remote dependencies
+ { "unresolved_remote_consumer", // entry point
+ 3, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 0, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION // info type
+ },
+ // supplier with unresolved local dependencies
+ { "unresolved_local_supplier", // entry point
+ 4, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 0, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION // info type
+ },
+ // consumer with unresolved local dependencies
+ { "unresolved_local_consumer", // entry point
+ 5, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 0, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION // info type
+ },
+ // consumer with unresolved local and remote dependencies
+ { "both_unresolved_consumer_1", // entry point
+ 6, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 0, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION // info type
+ },
+ // another consumer with unresolved
+ // local and remote dependencies
+ { "both_unresolved_consumer_2", // entry point
+ 7, // handle
+ 5000, // worst case execution time
+ 5000, // typical execution time (unused)
+ 5000, // cached execution time
+ 0, // period (100 ns)
+ RtecScheduler::HIGH_CRITICALITY, // criticality
+ RtecScheduler::LOW_IMPORTANCE, // importance
+ 0, // quantum (unused)
+ 0, // threads
+ 0, // OS priority
+ 0, // Preemption subpriority
+ 0, // Preemption priority
+ RtecScheduler::OPERATION // info type
+ }
+ };
+
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "internet" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Initialize the naming services
+ TAO_Naming_Client my_name_client;
+ if (my_name_client.init (orb.in ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ CosNaming::NamingContext_var context =
+ my_name_client.get_context ();
+
+ if (ACE_Scheduler_Factory::use_config (context.in (),
+ service_name) < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to bind to the scheduling service.\n"),
+ 1);
+
+ // create and initialize RT_Infos in the scheduler,
+ // make second half of array depend on first half.
+ for (int i = 0; i < operation_count; ++i)
+ {
+ // create the RT_Info
+ config_infos[i].handle =
+ ACE_Scheduler_Factory::server ()->create (config_infos[i].entry_point
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // initialize the RT_Info
+ ACE_Scheduler_Factory::server ()->
+ set (config_infos[i].handle,
+ static_cast<RtecScheduler::Criticality_t> (config_infos[i].criticality),
+ config_infos[i].worst_case_execution_time,
+ config_infos[i].typical_execution_time,
+ config_infos[i].cached_execution_time,
+ config_infos[i].period,
+ static_cast<RtecScheduler::Importance_t> (config_infos[i].importance),
+ config_infos[i].quantum,
+ config_infos[i].threads,
+ static_cast<RtecScheduler::Info_Type_t> (config_infos[i].info_type)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+
+ // register dependency of good consumer on good supplier
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[1].handle,
+ config_infos[0].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // register dependency of consumer that will have unresolved remote
+ // dependencies on supplier with unresolved remote dependencies
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[3].handle,
+ config_infos[2].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // register dependency of consumer that will have unresolved local
+ // dependencies on supplier with unresolved local dependencies
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[5].handle,
+ config_infos[4].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ // register dependencies on each supplier of first consumer that will
+ // have both unresolved local and unresolved remote dependencies.
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[6].handle,
+ config_infos[0].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[6].handle,
+ config_infos[2].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[6].handle,
+ config_infos[4].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Register dependencies on each of the other consumers by second
+ // consumer that will have both unresolved local and unresolved remote
+ // dependencies.
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[7].handle,
+ config_infos[1].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[7].handle,
+ config_infos[3].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[7].handle,
+ config_infos[5].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::server ()->
+ add_dependency (config_infos[7].handle,
+ config_infos[6].handle,
+ 1, // number of calls
+ RtecBase::ONE_WAY_CALL // type of dependency
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RtecScheduler::RT_Info_Set_var infos;
+ RtecScheduler::Dependency_Set_var deps;
+ RtecScheduler::Config_Info_Set_var configs;
+ RtecScheduler::Scheduling_Anomaly_Set_var anomalies;
+
+ ACE_Scheduler_Factory::server ()->compute_scheduling
+ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD),
+ ACE_Sched_Params::priority_max (ACE_SCHED_FIFO,
+ ACE_SCOPE_THREAD),
+ infos.out (), deps.out (),
+ configs.out (), anomalies.out () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_Scheduler_Factory::dump_schedule (infos.in (),
+ deps.in (),
+ configs.in (),
+ anomalies.in (),
+ "Sched_Conf_Anomalies_Runtime.h",
+ format_string);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "SYS_EX");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies_Runtime.h b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies_Runtime.h
new file mode 100644
index 00000000000..2662b3acb41
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Anomalies_Runtime.h
@@ -0,0 +1,59 @@
+// $Id$
+
+// This file was automatically generated by the Scheduler_Factory.
+// Before editing the file please consider generating it again.
+
+#include "orbsvcs/Scheduler_Factory.h"
+
+
+// The following scheduling anomalies were detected:
+ERROR: ST_UNRESOLVED_LOCAL_DEPENDENCIES
+ERROR: The following entry points have unresolved local dependencies:
+// unresolved_local_supplier
+// unresolved_local_consumer
+// both_unresolved_consumer_1
+// both_unresolved_consumer_2
+
+// WARNING: ST_UNRESOLVED_REMOTE_DEPENDENCIES
+// WARNING: The following entry points have unresolved remote dependencies:
+// unresolved_remote_supplier
+// unresolved_remote_consumer
+// both_unresolved_consumer_1
+// both_unresolved_consumer_2
+
+
+
+static ACE_Scheduler_Factory::POD_RT_Info infos[] = {
+{"good_supplier", 1, 5000, 5000, 5000, 500000, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 1, 15, 0, 0, (RtecScheduler::Info_Type_t) 0}
+,
+{"good_consumer", 2, 5000, 5000, 5000, 0, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 0, 15, 1, 0, (RtecScheduler::Info_Type_t) 0}
+,
+{"unresolved_remote_supplier", 3, 5000, 5000, 5000, 0, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 0, 0, 0, 0, (RtecScheduler::Info_Type_t) 3}
+,
+{"unresolved_remote_consumer", 4, 5000, 5000, 5000, 0, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 0, 0, 0, 0, (RtecScheduler::Info_Type_t) 0}
+,
+{"unresolved_local_supplier", 5, 5000, 5000, 5000, 0, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 0, 0, 0, 0, (RtecScheduler::Info_Type_t) 0}
+,
+{"unresolved_local_consumer", 6, 5000, 5000, 5000, 0, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 0, 0, 0, 0, (RtecScheduler::Info_Type_t) 0}
+,
+{"both_unresolved_consumer_1", 7, 5000, 5000, 5000, 0, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 0, 0, 0, 0, (RtecScheduler::Info_Type_t) 0}
+,
+{"both_unresolved_consumer_2", 8, 5000, 5000, 5000, 0, (RtecScheduler::Criticality_t) 3, (RtecScheduler::Importance_t) 1, 0, 0, 0, 0, 0, (RtecScheduler::Info_Type_t) 0}
+
+};
+
+static int infos_size = sizeof(infos)/sizeof(infos[0]);
+
+
+static ACE_Scheduler_Factory::POD_Config_Info configs[] = {
+ { 0, 15, (RtecScheduler::Dispatching_Type_t) 2 }
+};
+
+static int configs_size = sizeof(configs)/sizeof(configs[0]);
+
+
+// This sets up Scheduler_Factory to use the runtime version.
+int scheduler_factory_setup =
+ ACE_Scheduler_Factory::use_runtime (configs_size, configs, infos_size, infos);
+
+// EOF
diff --git a/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.cpp b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.cpp
new file mode 100644
index 00000000000..12692c53c26
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.cpp
@@ -0,0 +1,175 @@
+// $Id$
+
+// This program exercises a run-time scheduler,
+// using the config run generated C++ header file.
+
+#include "ace/Sched_Params.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_string.h"
+#include "tao/corba.h"
+
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Scheduler_Factory.h"
+#include "orbsvcs/Naming/Naming_Server.h"
+
+#include "Sched_Conf_Runtime.h"
+
+ACE_RCSID(Sched_Conf, Sched_Conf_Runtime, "$Id$")
+
+
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ // Initialize ORB.
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "internet" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Store a pointer to the local run-time scheduler.
+ RtecScheduler::Scheduler_ptr runtime_scheduler =
+ ACE_Scheduler_Factory::server ();
+
+ // Some useful variables for retrieving values from the scheduler.
+ RtecScheduler::RT_Info *rt_info = 0;
+ RtecScheduler::OS_Priority priority;
+ RtecScheduler::Preemption_Subpriority_t subpriority;
+ RtecScheduler::Preemption_Priority_t p_priority;
+ RtecScheduler::Dispatching_Type_t dispatching_type;
+
+ for (int i = 0; i < infos_size; ++i)
+ {
+ // Make sure the correct handle is returned by the
+ // run-time scheduler's create and lookup methods.
+ ACE_ASSERT (infos [i].handle ==
+ runtime_scheduler->create (infos [i].entry_point
+ ACE_ENV_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (infos [i].handle ==
+ runtime_scheduler->lookup (infos [i].entry_point
+ ACE_ENV_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+
+ // Make sure the values in the RT_Info returned by get are OK.
+ delete rt_info;
+ rt_info = runtime_scheduler->get (infos [i].handle
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (rt_info != 0);
+ ACE_ASSERT (ACE_OS::strcmp (rt_info->entry_point,
+ infos [i].entry_point) == 0);
+ ACE_ASSERT (rt_info->handle ==
+ infos [i].handle);
+ ACE_ASSERT (rt_info->worst_case_execution_time ==
+ infos [i].worst_case_execution_time);
+ ACE_ASSERT (rt_info->typical_execution_time ==
+ infos [i].typical_execution_time);
+ ACE_ASSERT (rt_info->cached_execution_time ==
+ infos [i].cached_execution_time);
+ ACE_ASSERT (rt_info->period ==
+ infos [i].period);
+ ACE_ASSERT (rt_info->criticality ==
+ static_cast<RtecScheduler::Criticality_t> (infos [i].criticality));
+ ACE_ASSERT (rt_info->importance ==
+ static_cast<RtecScheduler::Importance_t> (infos [i].importance));
+ ACE_ASSERT (rt_info->quantum ==
+ infos [i].quantum);
+ ACE_ASSERT (rt_info->threads ==
+ infos [i].threads);
+ ACE_ASSERT (rt_info->priority ==
+ infos [i].priority);
+ ACE_ASSERT (rt_info->preemption_subpriority ==
+ infos [i].static_subpriority);
+ ACE_ASSERT (rt_info->preemption_priority ==
+ infos [i].preemption_priority);
+ ACE_ASSERT (rt_info->info_type ==
+ static_cast<RtecScheduler::Info_Type_t> (infos [i].info_type));
+
+ // Make sure the values in the scheduler's internal RT_Info are OK.
+ // Scheduler will generate messages if any values don't match.
+ runtime_scheduler->set (infos [i].handle,
+ static_cast<RtecScheduler::Criticality_t> (infos [i].criticality),
+ infos [i].worst_case_execution_time,
+ infos [i].typical_execution_time,
+ infos [i].cached_execution_time,
+ infos [i].period,
+ static_cast<RtecScheduler::Importance_t> (infos [i].importance),
+ infos [i].quantum,
+ infos [i].threads,
+ static_cast<RtecScheduler::Info_Type_t> (infos [i].info_type)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Make sure the correct priority values are returned.
+ runtime_scheduler->priority (infos [i].handle,
+ priority,
+ subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (priority == infos [i].priority);
+ ACE_ASSERT (subpriority == infos [i].static_subpriority);
+ ACE_ASSERT (p_priority == infos [i].preemption_priority);
+ runtime_scheduler->entry_point_priority (infos [i].entry_point,
+ priority,
+ subpriority,
+ p_priority
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (priority == infos [i].priority);
+ ACE_ASSERT (subpriority == infos [i].static_subpriority);
+ ACE_ASSERT (p_priority == infos [i].preemption_priority);
+ }
+
+ for (int j = 0; j < configs_size; ++j)
+ {
+ // Make sure the correct preemption priority is stored.
+ ACE_ASSERT (j == configs [j].preemption_priority);
+
+ // Make sure the correct queue configuration values are returned.
+ runtime_scheduler->
+ dispatch_configuration (configs [j].preemption_priority,
+ priority,
+ dispatching_type
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (priority == configs [j].thread_priority);
+ ACE_ASSERT (dispatching_type == configs [j].dispatching_type);
+
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "SYS_EX");
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.h b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.h
new file mode 100644
index 00000000000..b0fa2c85cbd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Sched_Conf/Sched_Conf_Runtime.h
@@ -0,0 +1,62 @@
+// $Id$
+
+// This file was automatically generated by the Scheduler_Factory.
+// Before editing the file please consider generating it again.
+
+#include "orbsvcs/Scheduler_Factory.h"
+
+
+// There were no scheduling anomalies.
+
+
+static ACE_Scheduler_Factory::POD_RT_Info infos[] = {
+ {"high_20_S" , 1, 5000, 5000, 5000, 500000, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 1, 15, 11, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_20_S" , 2, 5000, 5000, 5000, 500000, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 1, 2, 11, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"high_10_S" , 3, 10000, 10000, 10000, 1000000, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 1, 15, 8, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_10_S" , 4, 10000, 10000, 10000, 1000000, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 1, 2, 8, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"high_05_S" , 5, 20000, 20000, 20000, 2000000, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 1, 15, 5, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_05_S" , 6, 20000, 20000, 20000, 2000000, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 1, 2, 5, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"high_01_S" , 7, 100000, 100000, 100000, 10000000, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 0, 15, 2, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_01_S" , 8, 100000, 100000, 100000, 10000000, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 0, 2, 2, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"high_20_C" , 9, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 0, 15, 9, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_20_C" , 10, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 0, 2, 9, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"high_10_C" , 11, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 0, 15, 6, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_10_C" , 12, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 0, 2, 6, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"high_05_C" , 13, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 0, 15, 3, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_05_C" , 14, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 0, 2, 3, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"high_01_C" , 15, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (3), static_cast<RtecScheduler::Importance_t> (1), 0, 0, 15, 0, 0, static_cast<RtecScheduler::Info_Type_t> (0)}
+,
+ {"low_01_C" , 16, 0, 0, 0, 0, static_cast<RtecScheduler::Criticality_t> (1), static_cast<RtecScheduler::Importance_t> (3), 0, 0, 2, 0, 1, static_cast<RtecScheduler::Info_Type_t> (0)}
+
+};
+
+static int infos_size = sizeof(infos)/sizeof(infos[0]);
+
+
+static ACE_Scheduler_Factory::POD_Config_Info configs[] = {
+ { 0, 15, (RtecScheduler::Dispatching_Type_t) 2 },
+ { 1, 2, (RtecScheduler::Dispatching_Type_t) 2 }
+};
+
+static int configs_size = sizeof(configs)/sizeof(configs[0]);
+
+
+// This sets up Scheduler_Factory to use the runtime version.
+int scheduler_factory_setup =
+ ACE_Scheduler_Factory::use_runtime (configs_size, configs, infos_size, infos);
+
+// EOF
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/Makefile.am b/TAO/orbsvcs/tests/Security/BiDirectional/Makefile.am
new file mode 100644
index 00000000000..2f02b708355
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/Makefile.am
@@ -0,0 +1,118 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Secure_BiDir_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.Secure_BiDir_SSL_Client.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+client_SOURCES = \
+ client.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ test_i.h \
+ test_i.inl
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_BiDirGIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Makefile.Secure_BiDir_SSL_Server.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+server_SOURCES = \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ test_i.h \
+ test_i.inl
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_BiDirGIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/README b/TAO/orbsvcs/tests/Security/BiDirectional/README
new file mode 100644
index 00000000000..14e5d33aaf8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/README
@@ -0,0 +1,29 @@
+# $Id$
+
+This is a test that exercises the birectional GIOP connection
+implementation in TAO over SSLIOP connection.
+
+Basicaly, the test is a copy of the $TAO_ROOT/tests/BiDirectional with
+added support for SSLIOP
+
+Start the server like this
+
+$ server -ORBSvcConf server.conf -o <file.ior> -i <no_iterations>
+$ client -ORBSvcConf client.conf -k file://<file.ior> -x
+
+Or, simply
+
+$ ./run_test.pl -ssl
+
+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
+would crash itself.
+
+To determine that no new connections have been opened or used the test
+relies on the fact that TAO uses a transport cache. It can provide us
+iwith the number of currently cashed transports before and after making an
+invocation. Both the client and at the server make this check.
+
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/Secure_BiDir.mpc b/TAO/orbsvcs/tests/Security/BiDirectional/Secure_BiDir.mpc
new file mode 100644
index 00000000000..2b128347974
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/Secure_BiDir.mpc
@@ -0,0 +1,33 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*SSL Server): taoexe, portableserver, minimum_corba, bidir_giop {
+ after += *idl
+ Source_Files {
+ test_i.cpp
+ testS.cpp
+ testC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*SSL Client): taoexe, portableserver, minimum_corba, bidir_giop {
+ after += *idl
+ Source_Files {
+ test_i.cpp
+ testS.cpp
+ testC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/client.conf b/TAO/orbsvcs/tests/Security/BiDirectional/client.conf
new file mode 100644
index 00000000000..c827b49249a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/client.conf
@@ -0,0 +1,10 @@
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey 'PEM:ssl/client-key.pem' -SSLCertificate 'PEM:ssl/client-cert.pem' -SSLCAFile 'PEM:ssl/ca.pem'"
+
+dynamic Advanced_Resource_Factory Service_Object*
+ TAO_Strategies:_make_TAO_Advanced_Resource_Factory ()
+ "-ORBProtocolFactory SSLIOP_Factory"
+
+static Client_Strategy_Factory "-ORBConnectStrategy blocked"
+
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/client.cpp b/TAO/orbsvcs/tests/Security/BiDirectional/client.cpp
new file mode 100644
index 00000000000..fb15517f37e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/client.cpp
@@ -0,0 +1,207 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "test_i.h"
+#include "tao/BiDir_GIOP/BiDirGIOP.h"
+#include "tao/AnyTypeCode/Any.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+
+ACE_RCSID(BiDirectional, client, "$Id$")
+
+const char *ior = "file://test.ior";
+
+void do_nothing (void)
+{
+}
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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 child_poa =
+ root_poa->create_POA ("childPOA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of childPOA is over. Destroy the Policy objects.
+ for (CORBA::ULong i = 0;
+ i < policies.length ();
+ ++i)
+ {
+ policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+
+ Callback_i callback_impl (orb.in ());
+
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("client_callback");
+
+ child_poa->activate_object_with_id (id.in (),
+ &callback_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var callback_object =
+ child_poa->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Callback_var callback =
+ Callback::_narrow (callback_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::String_var ior =
+ orb->object_to_string (callback.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Client callback activated as <%s>\n", ior.in ()));
+
+ // Send the calback object to the server
+ server->callback_object (callback.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This is a non-portable, but the only currently available way of
+ // determining the number of currently open connections.
+ size_t pre_call_connections =
+ orb->orb_core ()->lane_resources ().transport_cache ().current_size ();
+
+ // A method to kickstart callbacks from the server
+ CORBA::Long r =
+ server->test_method (1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (r != 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) unexpected result = %d ",
+ r));
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This is a non-portable, but the only currently available way of
+ // determining the number of currently open connections.
+ size_t cur_connections =
+ orb->orb_core()->lane_resources().transport_cache().current_size ();
+
+ if (cur_connections > pre_call_connections)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Expected %d "
+ "connections in the transport cache, but found "
+ "%d instead. Aborting.\n",
+ pre_call_connections,
+ cur_connections));
+
+ ACE_OS::abort ();
+ }
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/run_test.pl b/TAO/orbsvcs/tests/Security/BiDirectional/run_test.pl
new file mode 100755
index 00000000000..7a181ebc862
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/run_test.pl
@@ -0,0 +1,187 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{'ACE_ROOT'}/bin";
+use PerlACE::Run_Test;
+use Getopt::Long;
+
+$status = 0;
+$opt = "";
+$conf_client = "";
+$conf_server = "";
+$iorfile = PerlACE::LocalFile ("test.ior");
+$iter = 10;
+
+sub options () {
+ my $help = 0; # handled locally
+ my $man = 0; # handled locally
+ my $ssl = 0; # handled locally
+ my $dotdec = 0; # handled locally
+ my $debug; # handled locally
+ my $shost; # handled locally
+ my $chost; # handled locally
+
+ # Process options.
+ if ( @ARGV > 0 ) {
+ GetOptions ('help|?' => \$help,
+ 'manual' => \$man,
+ 'iter=i' => \$iter,
+ 'ssl' => \$ssl,
+ 'dd=s' => \$dotdec,
+ 'shost=s' => \$shost,
+ 'chost=s' => \$chost,
+ 'debug=i' => \$debug) or pod2usage(2);
+ }
+
+ if ($ssl) {
+ $conf_client = " -ORBSvcConf client.conf";
+ $conf_server = " -ORBSvcConf server.conf";
+ }
+
+ if ($debug) {
+ $opt = "$opt -ORBDebugLevel $debug";
+ }
+
+ if ($dotdec) {
+ if ($dotdec =~ /client/) {
+ $conf_client = "$conf_client -ORBDottedDecimalAddresses 1";
+ }
+ if ($dotdec =~ /server/) {
+ $conf_server = "$conf_server -ORBDottedDecimalAddresses 1";
+ }
+ }
+
+ if ($shost) {
+ $conf_server = "$conf_server -ORBListenEndpoints iiop:///hostname_in_ior=$shost";
+ }
+
+ if ($chost) {
+ $conf_client = "$conf_client -ORBListenEndpoints iiop:///hostname_in_ior=$chost";
+ }
+
+ if ( $man or $help ) {
+ # Load Pod::Usage only if needed.
+ require "Pod/Usage.pm";
+ import Pod::Usage;
+ pod2usage(1) if $help;
+ pod2usage(VERBOSE => 2) if $man;
+ return 0;
+ }
+
+ return 1;
+}
+
+options () or die "Nothing executed";
+
+unlink $iorfile;
+
+print STDERR "Executing, server options=$conf_server $opt -o $iorfile -i $iter\n";
+$SV = new PerlACE::Process ("server",
+ "$conf_server $opt -o $iorfile -i $iter");
+
+print STDERR "Executing, client options=$conf_client $opt -k file://$iorfile\n";
+$CL = new PerlACE::Process ("client",
+ "$conf_client $opt -k file://$iorfile");
+# "$conf_client -k file://$iorfile");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (20);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+
+if ($status != 0) {
+ print STDERR "Test failed\n";
+}
+else {
+ print STDERR "Test succeded\n";
+}
+
+exit $status;
+
+__END__
+
+=head1 NAME
+
+run_test.pl - A driver to run the test
+
+=head1 SYNOPSIS
+
+B<run_test.pl> [B<-help|?>] [B<-iter iterations>] [B<-chost host>]
+ [B<-dd who>] [B<-shost host>] [B<-man>] [B<-ssl>]
+ [B<-debug level>]
+
+
+=head1 DESCRIPTION
+
+This is a test that exercises the birectional GIOP connection
+implementation in TAO over SSLIOP connection. Start the server like this
+
+ $ server -ORBSvcConf server.conf -o <file.ior> -i <no_iterations>
+ $ client -ORBSvcConf client.conf -k file://<file.ior> -x
+
+Or, simply
+
+ $ ./run_test.pl -ssl
+
+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
+would crash itself.
+
+Basicaly, the test is a copy of the $TAO_ROOT/tests/BiDirectional with
+added support for SSLIOP
+
+=head1 OPTIONS
+
+[B<-help|?>]
+ Print a short help message
+
+[B<-iter iterations>]
+ The number of iterations to make. Default is 10.
+
+[B<-chost hostname>]
+ The hostname_in_ior for the client. Used only if specified.
+
+[B<-shost hostname>]
+ The hostname_in_ior for the server. Used only if specified.
+
+[B<-man>]
+ Prints this nice manual page
+
+[B<-dd who>]
+ Request the usage of -ORBDottedDecimalAddresses 1" for the client, the
+ server or both. Values of who can be "client", "server" or
+ "client,server".
+
+[B<-ssl>]
+ Enables the use of SSLIOP instead of IIOP
+
+[B<-debug level>]
+ Enables debugging. Values for level are 1-10
+
+=cut
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/server.conf b/TAO/orbsvcs/tests/Security/BiDirectional/server.conf
new file mode 100644
index 00000000000..6ad7e6d78a8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/server.conf
@@ -0,0 +1,10 @@
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey 'PEM:ssl/server-key.pem' -SSLCertificate 'PEM:ssl/server-cert.pem' -SSLCAFile 'PEM:ssl/ca.pem'"
+
+dynamic Advanced_Resource_Factory Service_Object*
+ TAO_Strategies:_make_TAO_Advanced_Resource_Factory ()
+ "-ORBProtocolFactory SSLIOP_Factory"
+
+static Client_Strategy_Factory "-ORBConnectStrategy blocked"
+
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp b/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp
new file mode 100644
index 00000000000..44ddec21390
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp
@@ -0,0 +1,175 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "test_i.h"
+#include "tao/BiDir_GIOP/BiDirGIOP.h"
+#include "tao/AnyTypeCode/Any.h"
+
+ACE_RCSID(BiDirectional, server, "$Id$")
+
+const char *ior_output_file = 0;
+int no_iterations = 10;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:i:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'i':
+ no_iterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "-i <no_iterations>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ 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 () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // 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 child_poa =
+ root_poa->create_POA ("childPOA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of childPOA is over. Destroy the Policy objects.
+ for (CORBA::ULong i = 0;
+ i < policies.length ();
+ ++i)
+ {
+ policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Simple_Server_i server_impl (orb.in (),
+ no_iterations);
+
+ PortableServer::ObjectId_var id =
+ PortableServer::string_to_ObjectId ("simple_server");
+
+ child_poa->activate_object_with_id (id.in (),
+ &server_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ child_poa->id_to_reference (id.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Server activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ int retval = 0;
+ while (retval == 0)
+ {
+ // Just process one upcall. We know that we would get the
+ // clients IOR in that call.
+ CORBA::Boolean pending =
+ orb->work_pending(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (pending)
+ {
+ orb->perform_work(ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Now that hopefully we have the clients IOR, just start
+ // making remote calls to the client.
+ retval = server_impl.call_client (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/ssl/ca.pem b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/ca.pem
new file mode 100644
index 00000000000..d64a1754e82
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/ca.pem
@@ -0,0 +1,34 @@
+-----BEGIN CERTIFICATE-----
+MIICuDCCAiGgAwIBAgIBADANBgkqhkiG9w0BAQQFADBNMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8w
+DQYDVQQDEwZzZXJ2ZXIwHhcNMDUwNDE4MjAzNDQxWhcNMDYwNDE4MjAzNDQxWjBN
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEM
+MAoGA1UEChMDT0NJMQ8wDQYDVQQDEwZzZXJ2ZXIwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBANCcDTCxc5DlaXJtflPMTkCUook5uOF1N56inw0eyaLx8zucv3TL
+LU1cORInZDzie7+ImiQ8tmiB+3rCy/UER5F0zv8Pc0aklyysK+cjMlA0mu7D26Ut
+M/YlDp18kyBmSWEtx3AobTUo5Ry5dqXjN96oJGUc+WypIJX6yvs3CsKNAgMBAAGj
+gacwgaQwHQYDVR0OBBYEFElH1lMSF2uqjpL29w0U3+NNVLsvMHUGA1UdIwRuMGyA
+FElH1lMSF2uqjpL29w0U3+NNVLsvoVGkTzBNMQswCQYDVQQGEwJVUzELMAkGA1UE
+CBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8wDQYDVQQD
+EwZzZXJ2ZXKCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQB8Tttf
+Yf+9cjjdw01L1ERXjJIcwH5ZhhKoCguDV0BmbkDmTD8DhIMLZG3mKkJnS7g0JRT3
+7Gs4okPK+sPW7elRLxTvlYZeO4O9ra6TF9+esSw03h3p10/MdCFyt5YK7i6DHWMJ
+hYUnQ6tBMvDuTamwWoxJGWDxkkBSRrGgVRb3IQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICuDCCAiGgAwIBAgIBADANBgkqhkiG9w0BAQQFADBNMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8w
+DQYDVQQDEwZjbGllbnQwHhcNMDUwNDE4MjAzNDQxWhcNMDYwNDE4MjAzNDQxWjBN
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEM
+MAoGA1UEChMDT0NJMQ8wDQYDVQQDEwZjbGllbnQwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBAKlt5waXlc4y4i8T4kJ+z0DGHAdjJCl5f+CAAhiAGnM6ojV7YNbH
+KHZW2qGBvq5jsy2DXGJC7/hxV3IKerv1Us9znbFypAgJNwqERBlwC0enBcfrQkIa
+umzheCyr6xSDSAB9Kmgtsrm1JGuq7eOIfqiUUBCovpg+Y3Q1eLvD34eJAgMBAAGj
+gacwgaQwHQYDVR0OBBYEFKYlVQvY/ngeBTk9SsDbu/1S8e6PMHUGA1UdIwRuMGyA
+FKYlVQvY/ngeBTk9SsDbu/1S8e6PoVGkTzBNMQswCQYDVQQGEwJVUzELMAkGA1UE
+CBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8wDQYDVQQD
+EwZjbGllbnSCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAU9c+R
+NCKu/jkIkUUACc+yTiNb2DvLJtRpWsrUSTLj8KK9wXlwyk3Zm/0h7PjGMUyE7nPi
+4vWXDrXBgQ3gXbcmbMygFJikAO6jVlyE+49AsJET/HzTorTgu7n+/Y3D9+J5GTDA
+jFzmjtaMPErQwhjRvG15ekJOZeqR8NjIRPm/OQ==
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-cert.pem b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-cert.pem
new file mode 100644
index 00000000000..27b6c182238
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-cert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICuDCCAiGgAwIBAgIBADANBgkqhkiG9w0BAQQFADBNMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8w
+DQYDVQQDEwZjbGllbnQwHhcNMDUwNDE4MjAzNDQxWhcNMDYwNDE4MjAzNDQxWjBN
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEM
+MAoGA1UEChMDT0NJMQ8wDQYDVQQDEwZjbGllbnQwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBAKlt5waXlc4y4i8T4kJ+z0DGHAdjJCl5f+CAAhiAGnM6ojV7YNbH
+KHZW2qGBvq5jsy2DXGJC7/hxV3IKerv1Us9znbFypAgJNwqERBlwC0enBcfrQkIa
+umzheCyr6xSDSAB9Kmgtsrm1JGuq7eOIfqiUUBCovpg+Y3Q1eLvD34eJAgMBAAGj
+gacwgaQwHQYDVR0OBBYEFKYlVQvY/ngeBTk9SsDbu/1S8e6PMHUGA1UdIwRuMGyA
+FKYlVQvY/ngeBTk9SsDbu/1S8e6PoVGkTzBNMQswCQYDVQQGEwJVUzELMAkGA1UE
+CBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8wDQYDVQQD
+EwZjbGllbnSCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAU9c+R
+NCKu/jkIkUUACc+yTiNb2DvLJtRpWsrUSTLj8KK9wXlwyk3Zm/0h7PjGMUyE7nPi
+4vWXDrXBgQ3gXbcmbMygFJikAO6jVlyE+49AsJET/HzTorTgu7n+/Y3D9+J5GTDA
+jFzmjtaMPErQwhjRvG15ekJOZeqR8NjIRPm/OQ==
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-key.pem b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-key.pem
new file mode 100644
index 00000000000..8d5282eeaa5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/client-key.pem
@@ -0,0 +1,32 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQCpbecGl5XOMuIvE+JCfs9AxhwHYyQpeX/ggAIYgBpzOqI1e2DW
+xyh2Vtqhgb6uY7Mtg1xiQu/4cVdyCnq79VLPc52xcqQICTcKhEQZcAtHpwXH60JC
+Grps4Xgsq+sUg0gAfSpoLbK5tSRrqu3jiH6olFAQqL6YPmN0NXi7w9+HiQIDAQAB
+AoGAMUz3kqV9Q9julABXMD4yFIkREt04YpEmMq9M7NAp4inHlYRnM1gUYAr551EX
+qSr9slqtATK1HTft2BNQj2zdQWLLs4rJ7FvVYLYdBBCAFdYugjnjkxHafaOYX/Sb
+HGHiGZxM/6N5BUijGfNBc4qF+jeONDyGDZoxW//uqaslpmECQQDeqG+QF3Kqe272
+HPol81WpLL8M6Vtk8woLB9/T7oKHEbw4C/ZzHqJQPGcEUxStm3z9Bo+rb1wjAMp/
+r/TL0i3VAkEAwsz0C3JPbt9PC0UwqrgXfsvYuVNwJ60HGGe29mQ+5xpFQgzOPgUI
+XRaXpCtnMYinedsGeGEBvDHZkESibkZo5QJAYCeBNkrJ/BGeE67j4Cu7nHl0cBD+
+pRPIDId0A8QGnmnsTI/t+D0Mf3X2TwnJ7kctrN9+f9xxf7RBvu6v2q2DmQJAd5+O
+efz/ZHGDQ8OAaEXWP8oEU4I2jFbH1afTBil3K0nJoA7nE9TZVvjJtEnm+9cUKVNj
+/MZtX1kpZluPd7KLNQJATm3ZjpwPsK/wz2W0cIfZjswh7ARW3ie3UzWI7ryBumQB
+q0wXd5VXuG2hmWI2S0SfuRRDWxCW/KmPVYCaSY+HQg==
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIICuDCCAiGgAwIBAgIBADANBgkqhkiG9w0BAQQFADBNMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8w
+DQYDVQQDEwZjbGllbnQwHhcNMDUwNDE4MjAzNDQxWhcNMDYwNDE4MjAzNDQxWjBN
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEM
+MAoGA1UEChMDT0NJMQ8wDQYDVQQDEwZjbGllbnQwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBAKlt5waXlc4y4i8T4kJ+z0DGHAdjJCl5f+CAAhiAGnM6ojV7YNbH
+KHZW2qGBvq5jsy2DXGJC7/hxV3IKerv1Us9znbFypAgJNwqERBlwC0enBcfrQkIa
+umzheCyr6xSDSAB9Kmgtsrm1JGuq7eOIfqiUUBCovpg+Y3Q1eLvD34eJAgMBAAGj
+gacwgaQwHQYDVR0OBBYEFKYlVQvY/ngeBTk9SsDbu/1S8e6PMHUGA1UdIwRuMGyA
+FKYlVQvY/ngeBTk9SsDbu/1S8e6PoVGkTzBNMQswCQYDVQQGEwJVUzELMAkGA1UE
+CBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8wDQYDVQQD
+EwZjbGllbnSCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAU9c+R
+NCKu/jkIkUUACc+yTiNb2DvLJtRpWsrUSTLj8KK9wXlwyk3Zm/0h7PjGMUyE7nPi
+4vWXDrXBgQ3gXbcmbMygFJikAO6jVlyE+49AsJET/HzTorTgu7n+/Y3D9+J5GTDA
+jFzmjtaMPErQwhjRvG15ekJOZeqR8NjIRPm/OQ==
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/ssl/make-client-keys b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/make-client-keys
new file mode 100755
index 00000000000..6ba5894dde9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/make-client-keys
@@ -0,0 +1,16 @@
+#!/bin/bash -x
+
+openssl req -new -x509 -days 365 -nodes -newkey rsa:1024 \
+ -out server-cert.pem -keyout server-key.pem \
+ -subj "/C=US/ST=MO/L=St. Louis/O=OCI/CN=server"
+
+cat server-cert.pem >>server-key.pem
+cat server-cert.pem >ca.pem
+
+openssl req -new -x509 -days 365 -nodes -newkey rsa:1024 \
+ -out client-cert.pem -keyout client-key.pem \
+ -subj "/C=US/ST=MO/L=St. Louis/O=OCI/CN=client"
+
+cat client-cert.pem >>client-key.pem
+cat client-cert.pem >>ca.pem
+
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-cert.pem b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-cert.pem
new file mode 100644
index 00000000000..94354a922a7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-cert.pem
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICuDCCAiGgAwIBAgIBADANBgkqhkiG9w0BAQQFADBNMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8w
+DQYDVQQDEwZzZXJ2ZXIwHhcNMDUwNDE4MjAzNDQxWhcNMDYwNDE4MjAzNDQxWjBN
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEM
+MAoGA1UEChMDT0NJMQ8wDQYDVQQDEwZzZXJ2ZXIwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBANCcDTCxc5DlaXJtflPMTkCUook5uOF1N56inw0eyaLx8zucv3TL
+LU1cORInZDzie7+ImiQ8tmiB+3rCy/UER5F0zv8Pc0aklyysK+cjMlA0mu7D26Ut
+M/YlDp18kyBmSWEtx3AobTUo5Ry5dqXjN96oJGUc+WypIJX6yvs3CsKNAgMBAAGj
+gacwgaQwHQYDVR0OBBYEFElH1lMSF2uqjpL29w0U3+NNVLsvMHUGA1UdIwRuMGyA
+FElH1lMSF2uqjpL29w0U3+NNVLsvoVGkTzBNMQswCQYDVQQGEwJVUzELMAkGA1UE
+CBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8wDQYDVQQD
+EwZzZXJ2ZXKCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQB8Tttf
+Yf+9cjjdw01L1ERXjJIcwH5ZhhKoCguDV0BmbkDmTD8DhIMLZG3mKkJnS7g0JRT3
+7Gs4okPK+sPW7elRLxTvlYZeO4O9ra6TF9+esSw03h3p10/MdCFyt5YK7i6DHWMJ
+hYUnQ6tBMvDuTamwWoxJGWDxkkBSRrGgVRb3IQ==
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-key.pem b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-key.pem
new file mode 100644
index 00000000000..1f430348d55
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/ssl/server-key.pem
@@ -0,0 +1,32 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDQnA0wsXOQ5WlybX5TzE5AlKKJObjhdTeeop8NHsmi8fM7nL90
+yy1NXDkSJ2Q84nu/iJokPLZogft6wsv1BEeRdM7/D3NGpJcsrCvnIzJQNJruw9ul
+LTP2JQ6dfJMgZklhLcdwKG01KOUcuXal4zfeqCRlHPlsqSCV+sr7NwrCjQIDAQAB
+AoGAf5gDRVY0XlrDbVblXrHm5v9CjvZ8S4Jbm67R47+CCyU75alRPUmMkvWmfqET
+YV4R3Kvbw/BSjYd7XrHI+Ds+3e/0grBK4MM0DpWT1Dqa/EklACt5DlJ3UPmAUnAp
+IvuLgcC/8e88VWylQ1vRJ2qoTvrY3yZI5NQXfuaxf7eQLyECQQD+jh5pX4qL7MDQ
+FskGqB4CUDy/UO/Ye2hTY/ILIj7H5X/Rpn82fEItx9NfAuW4loaKBrpGElwqJJJw
+9EeN2sMpAkEA0csr6f/hBaxyenaZ72fTNDFvX1EsnqVpOdcYFgJYFsizcjpHNjkj
+GlBo7WTrfKPgJCVHrSd7zqpz6a8Dj6R0xQJAOpKpHMYHMzs/AqK7jvSQMygTUlJl
+XgLHdqjAwR8YIxcD2lHdY8Qj1jTsxif8hATe4FO7+POwkWHo8GTFMjbsQQJBALaW
+Svv3NRLJCUFII6VXCVwtgi7E6T6R28j5SP8uvxflSTgrPHsWs1Rdk1S5NrJdtd//
+iihLatdtRkClj0Xe7bkCQQCM/JaBwb7UyHFmGhSk/6teiTc+GiRQkbTV7ssbIB6N
+1KPKXPguFf4bemVjadw6d9mljTat/QcgJRdaW8iAjqa1
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIICuDCCAiGgAwIBAgIBADANBgkqhkiG9w0BAQQFADBNMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8w
+DQYDVQQDEwZzZXJ2ZXIwHhcNMDUwNDE4MjAzNDQxWhcNMDYwNDE4MjAzNDQxWjBN
+MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEM
+MAoGA1UEChMDT0NJMQ8wDQYDVQQDEwZzZXJ2ZXIwgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBANCcDTCxc5DlaXJtflPMTkCUook5uOF1N56inw0eyaLx8zucv3TL
+LU1cORInZDzie7+ImiQ8tmiB+3rCy/UER5F0zv8Pc0aklyysK+cjMlA0mu7D26Ut
+M/YlDp18kyBmSWEtx3AobTUo5Ry5dqXjN96oJGUc+WypIJX6yvs3CsKNAgMBAAGj
+gacwgaQwHQYDVR0OBBYEFElH1lMSF2uqjpL29w0U3+NNVLsvMHUGA1UdIwRuMGyA
+FElH1lMSF2uqjpL29w0U3+NNVLsvoVGkTzBNMQswCQYDVQQGEwJVUzELMAkGA1UE
+CBMCTU8xEjAQBgNVBAcTCVN0LiBMb3VpczEMMAoGA1UEChMDT0NJMQ8wDQYDVQQD
+EwZzZXJ2ZXKCAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQB8Tttf
+Yf+9cjjdw01L1ERXjJIcwH5ZhhKoCguDV0BmbkDmTD8DhIMLZG3mKkJnS7g0JRT3
+7Gs4okPK+sPW7elRLxTvlYZeO4O9ra6TF9+esSw03h3p10/MdCFyt5YK7i6DHWMJ
+hYUnQ6tBMvDuTamwWoxJGWDxkkBSRrGgVRb3IQ==
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/test.idl b/TAO/orbsvcs/tests/Security/BiDirectional/test.idl
new file mode 100644
index 00000000000..4839f8a67b1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/test.idl
@@ -0,0 +1,26 @@
+//
+// $Id$
+//
+
+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 ();
+};
+
+interface Simple_Server
+{
+ /// 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/orbsvcs/tests/Security/BiDirectional/test_i.cpp b/TAO/orbsvcs/tests/Security/BiDirectional/test_i.cpp
new file mode 100644
index 00000000000..af19f459239
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/test_i.cpp
@@ -0,0 +1,102 @@
+// $Id$
+
+#include "test_i.h"
+
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "tao/Thread_Lane_Resources.h"
+
+#if !defined(__ACE_INLINE__)
+#include "test_i.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(BiDirectional, test_i, "$Id$")
+
+void
+Callback_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG ((LM_DEBUG, "Performing clean shutdown\n"));
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Callback_i::callback_method (ACE_ENV_SINGLE_ARG_DECL_NOT_USED /*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Callback method called \n"));
+}
+
+
+// ****************************************************************
+
+CORBA::Long
+Simple_Server_i::test_method (CORBA::Boolean do_callback
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (do_callback)
+ {
+ this->flag_ = 1;
+ }
+
+ return 0;
+}
+
+void
+Simple_Server_i::callback_object (Callback_ptr callback
+ ACE_ENV_ARG_DECL_NOT_USED )
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Store the callback object
+ this->callback_ = Callback::_duplicate (callback);
+}
+
+int
+Simple_Server_i::call_client (ACE_ENV_SINGLE_ARG_DECL)
+{
+ size_t pre_call_connections =
+ this->orb_->orb_core ()->lane_resources ().transport_cache ().current_size ();
+
+ if (this->flag_)
+ {
+ for (int times = 0; times < this->no_iterations_; ++times)
+ {
+ this->callback_->callback_method (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ size_t cur_connections =
+ this->orb_->orb_core()->lane_resources().transport_cache().current_size ();
+
+ if (cur_connections > pre_call_connections)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) TEST OUTPUT: expected to find %d "
+ "connections in the transport cache, but found "
+ "%d instead. Aborting.\n",
+ pre_call_connections,
+ cur_connections));
+
+ ACE_OS::abort ();
+ }
+ }
+
+ this->callback_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ this->flag_ = 0;
+
+ return 1;
+ }
+
+ return 0;
+}
+
+
+void
+Simple_Server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/test_i.h b/TAO/orbsvcs/tests/Security/BiDirectional/test_i.h
new file mode 100644
index 00000000000..9cf3cb4977c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/test_i.h
@@ -0,0 +1,92 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/BiDirectional
+//
+// = FILENAME
+// test_i.h
+//
+// = AUTHOR
+// Balachandran Natarajan <bala@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_BIDIRECTIONAL_TEST_I_H
+#define TAO_BIDIRECTIONAL_TEST_I_H
+
+#include "testS.h"
+
+class Callback_i : public POA_Callback
+{
+ // = TITLE
+ // A callback object to the "client"
+ //
+ // = DESCRIPTION
+ // To test that the server can call the client on the same
+ // connection that was established by the client
+ //
+public:
+ Callback_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Safe way to shutdown
+
+ void callback_method (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // The callback method
+
+private:
+ CORBA::ORB_var orb_;
+ // The orb
+
+};
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb, int no_iterations);
+ // ctor
+
+ // = The Simple_Server methods.
+ CORBA::Long test_method (CORBA::Boolean do_callback
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void callback_object (Callback_ptr callback
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ int call_client (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+
+private:
+ CORBA::ORB_var orb_;
+ // The ORB
+
+ int flag_;
+ // Flag to indicate, whether we are ready for a remote call.
+
+ Callback_var callback_;
+ // Callback Object
+
+ int no_iterations_;
+ // Number of times the callback needs to be called
+};
+
+#if defined(__ACE_INLINE__)
+#include "test_i.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_BIDIRECTIONAL_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/test_i.inl b/TAO/orbsvcs/tests/Security/BiDirectional/test_i.inl
new file mode 100644
index 00000000000..799be9fdcbe
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/test_i.inl
@@ -0,0 +1,17 @@
+// $Id$
+
+ACE_INLINE
+Callback_i::Callback_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+ACE_INLINE
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb,
+ int no_iterations)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ flag_ (0),
+ callback_ (0),
+ no_iterations_ (no_iterations)
+{
+}
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/Big_Request.mpc b/TAO/orbsvcs/tests/Security/Big_Request/Big_Request.mpc
new file mode 100644
index 00000000000..c5089718b4d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/Big_Request.mpc
@@ -0,0 +1,34 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ TX_Object.idl
+ }
+ custom_only = 1
+}
+
+project(*security client): taoclient, anytypecode, ssl {
+ after += *idl
+
+ Source_Files {
+ TX_ObjectC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*security server): taoserver, ssl {
+ after += *idl
+
+ Source_Files {
+ TX_Object_i.cpp
+ TX_ObjectS.cpp
+ TX_ObjectC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/Makefile.am b/TAO/orbsvcs/tests/Security/Big_Request/Makefile.am
new file mode 100644
index 00000000000..21c8934a1bd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/Makefile.am
@@ -0,0 +1,125 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Big_Request_Idl.am
+
+BUILT_SOURCES = \
+ TX_ObjectC.cpp \
+ TX_ObjectC.h \
+ TX_ObjectC.inl \
+ TX_ObjectS.cpp \
+ TX_ObjectS.h \
+ TX_ObjectS.inl
+
+CLEANFILES = \
+ TX_Object-stamp \
+ TX_ObjectC.cpp \
+ TX_ObjectC.h \
+ TX_ObjectC.inl \
+ TX_ObjectS.cpp \
+ TX_ObjectS.h \
+ TX_ObjectS.inl
+
+TX_ObjectC.cpp TX_ObjectC.h TX_ObjectC.inl TX_ObjectS.cpp TX_ObjectS.h TX_ObjectS.inl: TX_Object-stamp
+
+TX_Object-stamp: $(srcdir)/TX_Object.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/TX_Object.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ TX_Object.idl
+
+## Makefile.Big_Request_Security_Client.am
+
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+client_SOURCES = \
+ TX_ObjectC.cpp \
+ client.cpp \
+ TX_Object_i.h
+
+client_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+client_LDADD = \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+
+## Makefile.Big_Request_Security_Server.am
+
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+server_SOURCES = \
+ TX_ObjectC.cpp \
+ TX_ObjectS.cpp \
+ TX_Object_i.cpp \
+ server.cpp \
+ TX_Object_i.h
+
+server_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+server_LDADD = \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/README b/TAO/orbsvcs/tests/Security/Big_Request/README
new file mode 100644
index 00000000000..31790e131fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/README
@@ -0,0 +1,35 @@
+#
+# $Id$
+#
+
+---
+The initial version of this test was contributed by Andrew Finnell.
+Additional modifications (simplifications, improvements, etc) were
+made by the DOC Group prior to inclusion in the TAO distribution.
+---
+
+This test excercises the ability of the SSLIOP pluggable protocol to
+send very large requests and replies. It is intended to make the ORB
+send the message and reply in multiple parts (e.g. chains in a message
+block that fill several elements of an "iovec" vector to be sent
+through a scatter write/send interface). In particular, it is
+difficult to completely reproduce the semantics of the writev() system
+call with SSL_write(). As such, if the semantics are not emulated
+properly, large requests and replies will fail.
+
+All that is really done is to send a 3MB octet sequence as an "in"
+argument, and receive the same 3MB octet sequence from the server
+through an "out" argument.
+
+The expected test output is the following:
+
+==== Running SSLIOP Big_Request test
+Activated as <IOR:010000001200000049...0a410>
+Sending octet sequence of length: 3461724
+Received octet sequence of length: 3461724
+Sending octet sequence of length: 3461724
+Received octet sequence of length: 3461724
+
+Event loop finished.
+
+SSLIOP Big_Request test passed.
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/TX_Object.idl b/TAO/orbsvcs/tests/Security/Big_Request/TX_Object.idl
new file mode 100644
index 00000000000..5a1b4019323
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/TX_Object.idl
@@ -0,0 +1,27 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file TX_Object.idl
+ *
+ * $Id$
+ *
+ * IDL for the SSLIOP Big_Request test.
+ *
+ * @author Andrew Finnell
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+typedef sequence<octet> DataSeq;
+
+interface TX_Object
+{
+
+ void send (in DataSeq data);
+ void recv (out DataSeq data);
+
+ oneway void shutdown ();
+
+};
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.cpp b/TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.cpp
new file mode 100644
index 00000000000..b3910364baf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.cpp
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+
+#include "TX_Object_i.h"
+
+
+ACE_RCSID (Big_Request,
+ TX_Object_i,
+ "$Id$")
+
+
+TX_Object_i::TX_Object_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ data_ ()
+{
+}
+
+TX_Object_i::~TX_Object_i (void)
+{
+}
+
+void
+TX_Object_i::send (const DataSeq & data
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->data_ = data;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Received octet sequence of length:\t%u\n",
+ data.length ()));
+}
+
+void
+TX_Object_i::recv (DataSeq_out data
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_NEW_THROW_EX (data,
+ DataSeq,
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+
+ (*data) = this->data_;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sending octet sequence of length:\t%u\n",
+ data->length ()));
+}
+
+void
+TX_Object_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.h b/TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.h
new file mode 100644
index 00000000000..53bc2e447c9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/TX_Object_i.h
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TX_Object_i.h
+ *
+ * $Id$
+ *
+ * Header for the SSLIOP Big_Request test server implementation.
+ *
+ * @author Andrew Finnell
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TX_OBJECT_I_H
+#define TX_OBJECT_I_H
+
+#include "TX_ObjectS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class TX_Object_i : public virtual POA_TX_Object
+{
+public:
+
+ // Constructor
+ TX_Object_i (CORBA::ORB_ptr orb);
+
+ // Destructor
+ virtual ~TX_Object_i (void);
+
+ virtual void send (const DataSeq & data
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void recv (DataSeq_out data
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ CORBA::ORB_var orb_;
+
+ DataSeq data_;
+
+};
+
+
+#endif /* TX_OBJECT_I_H */
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/cacert.pem b/TAO/orbsvcs/tests/Security/Big_Request/cacert.pem
new file mode 100644
index 00000000000..a9e905f4e6c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/cacert.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDfTCCAuagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBjDELMAkGA1UEBhMCVVMx
+CzAJBgNVBAgTAkNBMQ8wDQYDVQQHEwZJcnZpbmUxEjAQBgNVBAoTCURPQyBHcm91
+cDEQMA4GA1UECxYHVUNJX0RPQzERMA8GA1UEAxMIUHJpeWFua2ExJjAkBgkqhkiG
+9w0BCQEWF3Bnb250bGFAZG9jLmVjZS51Y2kuZWR1MB4XDTAxMDYxMTE3MjI0MVoX
+DTExMDYwOTE3MjI0MVowgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyFiCRDUH
+nGJqQG9jT/2PhZUAgfwXvIwfDM8m/WujCt/buDcrOz767shBsk4HZhW91Vm4mE03
+K1zfCzojRigf28uyB/rlp60p2Fq0wvZBNNU5Muia6esleR4unb4QslOpcFhct/9n
+UPnlnnsZOTaGWaELNKEjYfHqPh8PQ0lYurECAwEAAaOB7DCB6TAdBgNVHQ4EFgQU
+0Y6IZjkLbLbtZ5aoKLcfd7Yc/kYwgbkGA1UdIwSBsTCBroAU0Y6IZjkLbLbtZ5ao
+KLcfd7Yc/kahgZKkgY8wgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GB
+AHYi8ulIzUI3p3+Ma16rumZxvKcmkJJbU6fpAv4ZvK6AWyy+6Ja0GD5N3SGEx+xU
+nMffTR+LePa9PAZiR7dNkF6ikPxXZu4jn8KY2zFT3SB/VjCoEetR9i9QI//O0Fea
+3yZ0NygNWe5cyVDLCb4meucJpsClfyL28DWzMwD2liX3
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/client.conf b/TAO/orbsvcs/tests/Security/Big_Request/client.conf
new file mode 100644
index 00000000000..5847fa22a03
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/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:client_key.pem -SSLCertificate PEM:client_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/client.conf.xml b/TAO/orbsvcs/tests/Security/Big_Request/client.conf.xml
new file mode 100644
index 00000000000..d14d7475b5d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/client.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Big_Request/client.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:client_key.pem -SSLCertificate PEM:client_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/client.cpp b/TAO/orbsvcs/tests/Security/Big_Request/client.cpp
new file mode 100644
index 00000000000..44eeca19e7d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/client.cpp
@@ -0,0 +1,126 @@
+#include "TX_ObjectC.h"
+#include "ace/OS_NS_stdlib.h"
+#include "ace/OS_NS_string.h"
+#include "ace/Get_Opt.h"
+#include "ace/SString.h"
+
+ACE_RCSID (Big_Request,
+ client,
+ "$Id$")
+
+const char *ior = "file://test.ior";
+const char *cert_file = "cacert.pem";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc,
+ argv,
+ ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (::parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var obj =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Nil server object reference\n"),
+ -1);
+
+ TX_Object_var txObject =
+ TX_Object::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DataSeq data_input;
+
+ const CORBA::ULong len = 3461724;
+
+ data_input.length (len);
+
+ // Fill in some useless data.
+ for (CORBA::ULong i = 0; i < len; ++i)
+ data_input[i] = i % 9;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Sending octet sequence of length:\t%u\n",
+ data_input.length ()));
+
+ txObject->send (data_input ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ DataSeq_var data_output;
+
+ txObject->recv (data_output.out () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "Received octet sequence of length:\t%u\n",
+ data_output->length ()));
+
+ txObject->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Sanity check
+ if (data_output->length () != len
+ || ACE_OS::memcmp (data_input.get_buffer (),
+ data_output->get_buffer (),
+ len) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "ERROR: Received octet sequence does not match "
+ "the one that was sent.\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ERROR");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n"
+ "SSLIOP Big_Request test passed.\n"));
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/client_cert.pem b/TAO/orbsvcs/tests/Security/Big_Request/client_cert.pem
new file mode 100644
index 00000000000..0bebb696cfc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/client_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQYwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExODEwMzRaFw0xMTA2
+MDkxODEwMzRaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEQMA4GA1UEChMHVEFPK09DSTEMMAoGA1UECxMDT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL6f8pBX7Mi3FPY/OYBOq+kb
+wQ3WX0Z8+nDxd7AiWDAx2AL5EaX8xnUiRi96OJ+CYPCYOUlavGVzZkRVMFdOuHAn
+RvY2sCpvU2rkKpEx9Pd50l7FLnXJuflnRc6zIEKOvuQcPJvsP4AaxaFxTnZExXQJ
+kDEiQP3mGID/eXtUzywbAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAuvSoOnMB6sxj
+ft9YbdLeyATTPzHbxAb6zQo72DUmM3roNowUrefHymU8jZoC6HeaROeKCU0MkVes
+l/jYlz/OwSYkbyGNIUkq4DHEWKzXEg8M603fsWK6IK3T5iPBHY+l/mYSEHJPfypZ
+fl/y4YSNJZlrz6kCIHTcwfHXDRC1mjM=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/client_key.pem b/TAO/orbsvcs/tests/Security/Big_Request/client_key.pem
new file mode 100644
index 00000000000..1428b501712
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/client_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQC+n/KQV+zItxT2PzmATqvpG8EN1l9GfPpw8XewIlgwMdgC+RGl
+/MZ1IkYvejifgmDwmDlJWrxlc2ZEVTBXTrhwJ0b2NrAqb1Nq5CqRMfT3edJexS51
+ybn5Z0XOsyBCjr7kHDyb7D+AGsWhcU52RMV0CZAxIkD95hiA/3l7VM8sGwIDAQAB
+AoGABGaa6fwtqkCXykuRX0XxsBME9PXTA0SVX5AjjDxuvsYXz5HCd4uLZV7iMexn
+bD9NT6CkCe5/VPRCEyfIUuutVFc7lkPwuRw5FvNcf4gMH9ltufQfH/KeR7d2Jvge
+zrTOH7nicshy67mfOEOaoDphWoT9uy+7ayym+EsJLJU37VkCQQD6xLRu5r9tKX2/
+NfIQsGxF3TZyXgxcuxMh9JOq5E9nBwhr1JaXDbXktXfIK/F3XWHLFS8CIg6PhgGY
+i/+UtGzvAkEAwpoHp89U2jLdVRoIcwy5o7Ocwk3HCXem3UgFWXzzunGM1x+ozDFA
+uo5nyXiAO6Buka9C2czje275kE18BbqLlQJBAMJNf/EeYdzXdVOfHPzJdlt72CAt
+ty5y1ZRNyc10MgIGdQP4KObJ/NJFuZYkVmjCtm+A7neco+OZVcs5TsOOOYkCQBHQ
+6EKEyM/xODJCX+OolpZWK1PeqwpC2hQIM/Uta2L2Yl6Pl3SaTcLGptnbHmJXHchY
+s1YdW/ZBArgjX+dmXMECQApTKWbVLmNsEoOlHU/I/KhGsfuojrzBMMe3FKLiHpmu
+u86L3vu3OGZFcPgjazxWZcip8JekeJ7c+6suLNNRQ5I=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/run_test.pl b/TAO/orbsvcs/tests/Security/Big_Request/run_test.pl
new file mode 100755
index 00000000000..c2806f6c246
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/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;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$file = PerlACE::LocalFile ("test.ior");
+
+unlink $file;
+
+$status = 0;
+
+# Set the SSL environment
+# This doesn't work on Windows. For some reason,
+# environment variables aren't propagated to child processes.
+#$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+$SV = new PerlACE::Process ("server",
+ "-o $file -ORBSvcConf server$PerlACE::svcconf_ext");
+$CL = new PerlACE::Process ("client",
+ "-ORBSvcConf client$PerlACE::svcconf_ext -k file://$file");
+
+print STDERR "\n\n==== Running SSLIOP Big_Request test\n";
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($file, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (180);
+
+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 $file;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/server.conf b/TAO/orbsvcs/tests/Security/Big_Request/server.conf
new file mode 100644
index 00000000000..ee0ef1aa57c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/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:server_key.pem -SSLCertificate PEM:server_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/server.conf.xml b/TAO/orbsvcs/tests/Security/Big_Request/server.conf.xml
new file mode 100644
index 00000000000..5e92069a8c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/server.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Big_Request/server.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:server_key.pem -SSLCertificate PEM:server_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/server.cpp b/TAO/orbsvcs/tests/Security/Big_Request/server.cpp
new file mode 100644
index 00000000000..a2a09539439
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/server.cpp
@@ -0,0 +1,121 @@
+
+#include "TX_Object_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+#include "ace/SString.h"
+
+ACE_RCSID (Big_Request,
+ server,
+ "$Id$")
+
+const char *ior_output_file = 0;
+const char *cert_file = "cacert.pem";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+int
+main (int argc, char * argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poaObj =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var rootPoa =
+ PortableServer::POA::_narrow (poaObj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ rootPoa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (::parse_args (argc, argv) != 0)
+ return 1;
+
+ TX_Object_i implObject (orb.in ());
+
+ TX_Object_var txObject = implObject._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (txObject.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it.
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s\n",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n"
+ "Event loop finished.\n"));
+
+ rootPoa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "ERROR");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/server_cert.pem b/TAO/orbsvcs/tests/Security/Big_Request/server_cert.pem
new file mode 100644
index 00000000000..0fc394c24d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/server_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQMwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExNzQ4NTVaFw0xMTA2
+MDkxNzQ4NTVaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEMMAoGA1UEChMDT0NJMRAwDgYDVQQLEwdUQU8rT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANKXmudWiLVu/zdBlSr0/dlr
+pRe+Ie26cPyMo5lKiYNY77tABTiOXe5qLUEryjQ/fZ74gmBe4AYFwb7nu/f58X4A
+0tzSg2M4spWM7N4tzf+YbcUipRt9sEISxwfUxNNWTKnLxvCmkzOsISisukdzTkqJ
+fdzEcPfhO2BZKOdmlg1hAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAjUl3ami01tPY
+P1vMp2642dsIKLZis0TmeWp6HNpm52TbiGZOCqDrvtSQ9+2vGz0BkHvGqWKtD+wv
+zJH23fNnqFuzy1C1xtjoeqhXECTsWVTVdoEox8hSWxPiYRE2dioraZQQ5ENDosh+
+V9YcqJJpnKDUOSGVGuyaU7DpR8yK0pc=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Big_Request/server_key.pem b/TAO/orbsvcs/tests/Security/Big_Request/server_key.pem
new file mode 100644
index 00000000000..567a41da6dc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Big_Request/server_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDSl5rnVoi1bv83QZUq9P3Za6UXviHtunD8jKOZSomDWO+7QAU4
+jl3uai1BK8o0P32e+IJgXuAGBcG+57v3+fF+ANLc0oNjOLKVjOzeLc3/mG3FIqUb
+fbBCEscH1MTTVkypy8bwppMzrCEorLpHc05KiX3cxHD34TtgWSjnZpYNYQIDAQAB
+AoGAC/TxpZrjLjH8KZ3+oy6/zv1upTd1Y7MHQT+W9lgmEKAXFHGhGkHzEVtT8HRV
+CbxlHIaNmH0qiQ0AoB82K/E0BdIMvE+y2qQwlpMfBMX6/TACORReJN3NXGsXwHP4
+/pNlS4LX7/NZbxlReAlDNP+FO8sdKZTyM3VXHFWJbmm4wsECQQD06zQ4uthp0zI9
+WTZiiAUgYwOcnLnXwfWOLAr8RCnYgwiS7MBCcmhZAgWX5SZJYVCwEJ12DAHy02NJ
+EhiSgo+JAkEA3B7PcS5FqZFi6wVjEG6yF8OuSb/rl+FZfV6utZdCVdMPxacEVxlD
+q7H/dk23O4WwASBriU0PR9/KG3T/LvKBGQJAaYRn1EUTdcxKqcmkt6CYbNKbvL59
+BqqGq4DoHrUTPjd92ybq0fXOZQKM/Fr6OsUVaTVPUYtsz3wpG1MTiRN82QJACX6+
+vggb8yuVU8QAuPW9cu769q1zsTKEVLcf3C9xKhiXppQEyOkLFT3xYh4KGGQ06meG
+m/6Z+SS7KCIM2+6UCQJBANHIzgxDWtrLuWJviNh9EbCsdMioxBH+LGaqFKLC70xD
+Pyoqn+QJQu/ekT+FUb0BeFJfGPzFjh1mFYn4tXxWqMs=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Callback/Callback.mpc b/TAO/orbsvcs/tests/Security/Callback/Callback.mpc
new file mode 100644
index 00000000000..e2a379ae985
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/Callback.mpc
@@ -0,0 +1,40 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ server.idl
+ client.idl
+ }
+ custom_only = 1
+}
+
+project(*security server): taoexe, portableserver, ssl {
+ after += *idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ clientC.cpp
+ serverC.cpp
+ serverS.cpp
+ server_i.cpp
+ server.cpp
+ }
+}
+
+project(*security client): taoexe, portableserver, ssl {
+ after += *idl
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ clientC.cpp
+ clientS.cpp
+ serverC.cpp
+ client_i.cpp
+ client.cpp
+ }
+}
diff --git a/TAO/orbsvcs/tests/Security/Callback/Makefile.am b/TAO/orbsvcs/tests/Security/Callback/Makefile.am
new file mode 100644
index 00000000000..43e645ea98f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/Makefile.am
@@ -0,0 +1,154 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Callback_Idl.am
+
+BUILT_SOURCES = \
+ serverC.cpp \
+ serverC.h \
+ serverC.inl \
+ serverS.cpp \
+ serverS.h \
+ serverS.inl
+
+CLEANFILES = \
+ server-stamp \
+ serverC.cpp \
+ serverC.h \
+ serverC.inl \
+ serverS.cpp \
+ serverS.h \
+ serverS.inl
+
+serverC.cpp serverC.h serverC.inl serverS.cpp serverS.h serverS.inl: server-stamp
+
+server-stamp: $(srcdir)/server.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/server.idl
+ @touch $@
+
+BUILT_SOURCES += \
+ clientC.cpp \
+ clientC.h \
+ clientC.inl \
+ clientS.cpp \
+ clientS.h \
+ clientS.inl
+
+CLEANFILES += \
+ client-stamp \
+ clientC.cpp \
+ clientC.h \
+ clientC.inl \
+ clientS.cpp \
+ clientS.h \
+ clientS.inl
+
+clientC.cpp clientC.h clientC.inl clientS.cpp clientS.h clientS.inl: client-stamp
+
+client-stamp: $(srcdir)/client.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/client.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ client.idl \
+ server.idl
+
+## Makefile.Callback_Security_Client.am
+
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+client_SOURCES = \
+ client.cpp \
+ clientC.cpp \
+ clientS.cpp \
+ client_i.cpp \
+ serverC.cpp \
+ client_i.h
+
+client_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+client_LDADD = \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+
+## Makefile.Callback_Security_Server.am
+
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+server_SOURCES = \
+ clientC.cpp \
+ server.cpp \
+ serverC.cpp \
+ serverS.cpp \
+ server_i.cpp \
+ server_i.h
+
+server_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+server_LDADD = \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/Callback/README b/TAO/orbsvcs/tests/Security/Callback/README
new file mode 100644
index 00000000000..5c8153c6672
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/README
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+
+This test is designed to excercise the connection cache related code
+in a complex pluggable protocol such as SSLIOP.
+
+An object reference is sent to the target as an "in" parameter. The
+target then uses that object reference to invoke a callback method on
+an object residing at the client.
+
+If the secure connection is not cached properly, then it will not be
+possible to invoke the callback method on the client.
diff --git a/TAO/orbsvcs/tests/Security/Callback/cacert.pem b/TAO/orbsvcs/tests/Security/Callback/cacert.pem
new file mode 100644
index 00000000000..a9e905f4e6c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/cacert.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDfTCCAuagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBjDELMAkGA1UEBhMCVVMx
+CzAJBgNVBAgTAkNBMQ8wDQYDVQQHEwZJcnZpbmUxEjAQBgNVBAoTCURPQyBHcm91
+cDEQMA4GA1UECxYHVUNJX0RPQzERMA8GA1UEAxMIUHJpeWFua2ExJjAkBgkqhkiG
+9w0BCQEWF3Bnb250bGFAZG9jLmVjZS51Y2kuZWR1MB4XDTAxMDYxMTE3MjI0MVoX
+DTExMDYwOTE3MjI0MVowgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyFiCRDUH
+nGJqQG9jT/2PhZUAgfwXvIwfDM8m/WujCt/buDcrOz767shBsk4HZhW91Vm4mE03
+K1zfCzojRigf28uyB/rlp60p2Fq0wvZBNNU5Muia6esleR4unb4QslOpcFhct/9n
+UPnlnnsZOTaGWaELNKEjYfHqPh8PQ0lYurECAwEAAaOB7DCB6TAdBgNVHQ4EFgQU
+0Y6IZjkLbLbtZ5aoKLcfd7Yc/kYwgbkGA1UdIwSBsTCBroAU0Y6IZjkLbLbtZ5ao
+KLcfd7Yc/kahgZKkgY8wgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GB
+AHYi8ulIzUI3p3+Ma16rumZxvKcmkJJbU6fpAv4ZvK6AWyy+6Ja0GD5N3SGEx+xU
+nMffTR+LePa9PAZiR7dNkF6ikPxXZu4jn8KY2zFT3SB/VjCoEetR9i9QI//O0Fea
+3yZ0NygNWe5cyVDLCb4meucJpsClfyL28DWzMwD2liX3
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Callback/client.conf b/TAO/orbsvcs/tests/Security/Callback/client.conf
new file mode 100644
index 00000000000..5847fa22a03
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/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:client_key.pem -SSLCertificate PEM:client_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Callback/client.conf.xml b/TAO/orbsvcs/tests/Security/Callback/client.conf.xml
new file mode 100644
index 00000000000..c82a523bd48
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/client.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Callback/client.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:client_key.pem -SSLCertificate PEM:client_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Callback/client.cpp b/TAO/orbsvcs/tests/Security/Callback/client.cpp
new file mode 100644
index 00000000000..2ddfbc0be3d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/client.cpp
@@ -0,0 +1,135 @@
+#include "ace/Log_Msg.h"
+#include "serverC.h"
+#include "client_i.h"
+#include "ace/SString.h"
+
+ACE_RCSID (Callback,
+ client,
+ "$Id$")
+
+const char *cert_file = "cacert.pem";
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ //
+ // Initialize the ORB
+ //
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // Get the 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;
+
+ //
+ // Get a reference to the server.
+ //
+ obj = orb->string_to_object ("file://server.ior"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P) orb->string_to_object ")
+ ACE_TEXT ("(\"file://server.ior\") failed.\n")),
+ -1);
+ }
+
+ //
+ // Downcast the IOR to the appropriate object type.
+ //
+ server_var server_obj =
+ server::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server_obj.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P) server::_narrow(obj) failed.\n")),
+ -1);
+ }
+
+ //
+ // Create and activate the client.
+ //
+ client_i *servant = 0;
+ ACE_NEW_RETURN (servant,
+ client_i (server_obj.in ()),
+ -1);
+ PortableServer::ServantBase_var theClient = servant;
+
+ client_var client_ref = servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // Activate the 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;
+
+ //
+ // Set the server's callback and invoke the test request.
+ //
+ server_obj->set_client (client_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ server_obj->test_request ("first secure callback to client"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // Repeat the callback test.
+ //
+ server_obj->set_client (client_ref.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ server_obj->test_request ("second secure callback to client"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ server_obj->shutdown (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;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Caught exception\n"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Callback/client.idl b/TAO/orbsvcs/tests/Security/Callback/client.idl
new file mode 100644
index 00000000000..9ac07bd3cd5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/client.idl
@@ -0,0 +1,11 @@
+//
+// Client interface definition.
+//
+// $Id$
+//
+
+
+interface client
+{
+ void test_reply (in string msg);
+};
diff --git a/TAO/orbsvcs/tests/Security/Callback/client_cert.pem b/TAO/orbsvcs/tests/Security/Callback/client_cert.pem
new file mode 100644
index 00000000000..0bebb696cfc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/client_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQYwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExODEwMzRaFw0xMTA2
+MDkxODEwMzRaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEQMA4GA1UEChMHVEFPK09DSTEMMAoGA1UECxMDT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL6f8pBX7Mi3FPY/OYBOq+kb
+wQ3WX0Z8+nDxd7AiWDAx2AL5EaX8xnUiRi96OJ+CYPCYOUlavGVzZkRVMFdOuHAn
+RvY2sCpvU2rkKpEx9Pd50l7FLnXJuflnRc6zIEKOvuQcPJvsP4AaxaFxTnZExXQJ
+kDEiQP3mGID/eXtUzywbAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAuvSoOnMB6sxj
+ft9YbdLeyATTPzHbxAb6zQo72DUmM3roNowUrefHymU8jZoC6HeaROeKCU0MkVes
+l/jYlz/OwSYkbyGNIUkq4DHEWKzXEg8M603fsWK6IK3T5iPBHY+l/mYSEHJPfypZ
+fl/y4YSNJZlrz6kCIHTcwfHXDRC1mjM=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Callback/client_i.cpp b/TAO/orbsvcs/tests/Security/Callback/client_i.cpp
new file mode 100644
index 00000000000..ff5ecb97cb4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/client_i.cpp
@@ -0,0 +1,26 @@
+#include "ace/Log_Msg.h"
+#include "client_i.h"
+
+ACE_RCSID (Callback,
+ client_i,
+ "$Id$")
+
+client_i::client_i (server_ptr s)
+ : server_ (server::_duplicate (s))
+{
+}
+
+client_i::~client_i (void)
+{
+}
+
+void
+client_i::test_reply (const char *msg
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_DEBUG((LM_INFO,
+ ACE_TEXT("(%N) message received was ")
+ ACE_TEXT("(%s)\n"),
+ msg));
+}
diff --git a/TAO/orbsvcs/tests/Security/Callback/client_i.h b/TAO/orbsvcs/tests/Security/Callback/client_i.h
new file mode 100644
index 00000000000..e5d6603aca9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/client_i.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file client_i.h
+ *
+ * $Id$ *
+ * Header for the SSLIOP Callback test client callback implementation.
+ *
+ * @author Robert Martin <martin_r@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef CLIENT_I_H
+#define CLIENT_I_H
+
+#include "clientS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "serverC.h"
+
+class client_i
+ : public virtual POA_client
+{
+public:
+
+ client_i (server_ptr s);
+ virtual ~client_i (void);
+
+ virtual void test_reply (const char *msg
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ server_var server_;
+
+};
+
+#endif /* CLIENT_I_H */
diff --git a/TAO/orbsvcs/tests/Security/Callback/client_key.pem b/TAO/orbsvcs/tests/Security/Callback/client_key.pem
new file mode 100644
index 00000000000..1428b501712
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/client_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQC+n/KQV+zItxT2PzmATqvpG8EN1l9GfPpw8XewIlgwMdgC+RGl
+/MZ1IkYvejifgmDwmDlJWrxlc2ZEVTBXTrhwJ0b2NrAqb1Nq5CqRMfT3edJexS51
+ybn5Z0XOsyBCjr7kHDyb7D+AGsWhcU52RMV0CZAxIkD95hiA/3l7VM8sGwIDAQAB
+AoGABGaa6fwtqkCXykuRX0XxsBME9PXTA0SVX5AjjDxuvsYXz5HCd4uLZV7iMexn
+bD9NT6CkCe5/VPRCEyfIUuutVFc7lkPwuRw5FvNcf4gMH9ltufQfH/KeR7d2Jvge
+zrTOH7nicshy67mfOEOaoDphWoT9uy+7ayym+EsJLJU37VkCQQD6xLRu5r9tKX2/
+NfIQsGxF3TZyXgxcuxMh9JOq5E9nBwhr1JaXDbXktXfIK/F3XWHLFS8CIg6PhgGY
+i/+UtGzvAkEAwpoHp89U2jLdVRoIcwy5o7Ocwk3HCXem3UgFWXzzunGM1x+ozDFA
+uo5nyXiAO6Buka9C2czje275kE18BbqLlQJBAMJNf/EeYdzXdVOfHPzJdlt72CAt
+ty5y1ZRNyc10MgIGdQP4KObJ/NJFuZYkVmjCtm+A7neco+OZVcs5TsOOOYkCQBHQ
+6EKEyM/xODJCX+OolpZWK1PeqwpC2hQIM/Uta2L2Yl6Pl3SaTcLGptnbHmJXHchY
+s1YdW/ZBArgjX+dmXMECQApTKWbVLmNsEoOlHU/I/KhGsfuojrzBMMe3FKLiHpmu
+u86L3vu3OGZFcPgjazxWZcip8JekeJ7c+6suLNNRQ5I=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Callback/run_test.pl b/TAO/orbsvcs/tests/Security/Callback/run_test.pl
new file mode 100755
index 00000000000..910425441aa
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/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;
+
+# -*- perl -*-
+# $Id$
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$file = PerlACE::LocalFile ("server.ior");
+
+unlink $file;
+
+$status = 0;
+
+# Set the SSL environment
+# This doesn't work on Windows. For some reason,
+# environment variables aren't propagated to child processes.
+#$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+$SV = new PerlACE::Process ("server",
+ "-o $file -ORBSvcConf server$PerlACE::svcconf_ext");
+$CL = new PerlACE::Process ("client",
+ "-ORBSvcConf client$PerlACE::svcconf_ext");
+
+print STDERR "\n\n==== Running SSLIOP Callback test\n";
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($file, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+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 $file;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Security/Callback/server.conf b/TAO/orbsvcs/tests/Security/Callback/server.conf
new file mode 100644
index 00000000000..ee0ef1aa57c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/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:server_key.pem -SSLCertificate PEM:server_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Callback/server.conf.xml b/TAO/orbsvcs/tests/Security/Callback/server.conf.xml
new file mode 100644
index 00000000000..dab23b5d802
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/server.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Callback/server.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:server_key.pem -SSLCertificate PEM:server_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Callback/server.cpp b/TAO/orbsvcs/tests/Security/Callback/server.cpp
new file mode 100644
index 00000000000..881d7d2ca58
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/server.cpp
@@ -0,0 +1,110 @@
+#include "ace/Log_Msg.h"
+#include "server_i.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/SString.h"
+
+ACE_RCSID (Callback,
+ server,
+ "$Id$")
+
+const char *cert_file = "cacert.pem";
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ //
+ // Initialize the ORB
+ //
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, ""
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // Get the 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;
+
+ //
+ // Create the server, get object reference,
+ // and create "stringified" IOR.
+ //
+ server_i *tmp = 0;
+ ACE_NEW_RETURN (tmp,
+ server_i (orb.in ()),
+ -1);
+ PortableServer::ServantBase_var theServer = tmp;
+
+ PortableServer::ObjectId_var oid =
+ poa->activate_object (theServer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::Object_var server_obj =
+ poa->id_to_reference (oid.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::String_var server_IORString =
+ orb->object_to_string (server_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ //
+ // Write the IOR to a file.
+ //
+ // Output the IOR to the <ior_output_file>
+ FILE *output_file= ACE_OS::fopen ("server.ior", "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR\n"),
+ -1);
+ ACE_OS::fprintf (output_file, "%s", server_IORString.in ());
+ ACE_OS::fclose (output_file);
+
+ //
+ // Activate the 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;
+
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("(%P) calling orb->run () ...\n")));
+
+ 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;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_TEXT ("Caught exception\n"));
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Callback/server.idl b/TAO/orbsvcs/tests/Security/Callback/server.idl
new file mode 100644
index 00000000000..66e11c7fa4b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/server.idl
@@ -0,0 +1,14 @@
+//
+// Server interface definition.
+//
+// $Id$
+//
+
+#include "client.idl"
+
+interface server
+{
+ void set_client (in client c);
+ void test_request (in string msg);
+ oneway void shutdown ();
+};
diff --git a/TAO/orbsvcs/tests/Security/Callback/server_cert.pem b/TAO/orbsvcs/tests/Security/Callback/server_cert.pem
new file mode 100644
index 00000000000..0fc394c24d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/server_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQMwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExNzQ4NTVaFw0xMTA2
+MDkxNzQ4NTVaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEMMAoGA1UEChMDT0NJMRAwDgYDVQQLEwdUQU8rT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANKXmudWiLVu/zdBlSr0/dlr
+pRe+Ie26cPyMo5lKiYNY77tABTiOXe5qLUEryjQ/fZ74gmBe4AYFwb7nu/f58X4A
+0tzSg2M4spWM7N4tzf+YbcUipRt9sEISxwfUxNNWTKnLxvCmkzOsISisukdzTkqJ
+fdzEcPfhO2BZKOdmlg1hAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAjUl3ami01tPY
+P1vMp2642dsIKLZis0TmeWp6HNpm52TbiGZOCqDrvtSQ9+2vGz0BkHvGqWKtD+wv
+zJH23fNnqFuzy1C1xtjoeqhXECTsWVTVdoEox8hSWxPiYRE2dioraZQQ5ENDosh+
+V9YcqJJpnKDUOSGVGuyaU7DpR8yK0pc=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Callback/server_i.cpp b/TAO/orbsvcs/tests/Security/Callback/server_i.cpp
new file mode 100644
index 00000000000..f4a66db526f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/server_i.cpp
@@ -0,0 +1,38 @@
+#include "server_i.h"
+
+ACE_RCSID (Callback,
+ server_i,
+ "$Id$")
+
+server_i::server_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ client_ ()
+{
+}
+
+server_i::~server_i (void)
+{
+}
+
+void
+server_i::set_client (client_ptr c
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->client_ = client::_duplicate (c);
+}
+
+void
+server_i::test_request (const char *msg
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->client_->test_reply (msg ACE_ENV_ARG_PARAMETER);
+}
+
+void
+server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Security/Callback/server_i.h b/TAO/orbsvcs/tests/Security/Callback/server_i.h
new file mode 100644
index 00000000000..443bd091a04
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/server_i.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file server_i.h
+ *
+ * $Id$
+ *
+ * Header for the SSLIOP Callback test server implementation.
+ *
+ * @author Robert Martin <martin_r@ociweb.com>
+ */
+//=============================================================================
+
+#ifndef SERVER_I_H
+#define SERVER_I_H
+
+#include "serverS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+class server_i
+ : public virtual POA_server
+{
+public:
+
+ server_i (CORBA::ORB_ptr orb);
+ virtual ~server_i (void);
+
+ virtual void set_client (client_ptr c
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void test_request (const char *msg
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ CORBA::ORB_var orb_;
+
+ client_var client_;
+
+};
+
+#endif /* SERVER_I_H */
diff --git a/TAO/orbsvcs/tests/Security/Callback/server_key.pem b/TAO/orbsvcs/tests/Security/Callback/server_key.pem
new file mode 100644
index 00000000000..567a41da6dc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Callback/server_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDSl5rnVoi1bv83QZUq9P3Za6UXviHtunD8jKOZSomDWO+7QAU4
+jl3uai1BK8o0P32e+IJgXuAGBcG+57v3+fF+ANLc0oNjOLKVjOzeLc3/mG3FIqUb
+fbBCEscH1MTTVkypy8bwppMzrCEorLpHc05KiX3cxHD34TtgWSjnZpYNYQIDAQAB
+AoGAC/TxpZrjLjH8KZ3+oy6/zv1upTd1Y7MHQT+W9lgmEKAXFHGhGkHzEVtT8HRV
+CbxlHIaNmH0qiQ0AoB82K/E0BdIMvE+y2qQwlpMfBMX6/TACORReJN3NXGsXwHP4
+/pNlS4LX7/NZbxlReAlDNP+FO8sdKZTyM3VXHFWJbmm4wsECQQD06zQ4uthp0zI9
+WTZiiAUgYwOcnLnXwfWOLAr8RCnYgwiS7MBCcmhZAgWX5SZJYVCwEJ12DAHy02NJ
+EhiSgo+JAkEA3B7PcS5FqZFi6wVjEG6yF8OuSb/rl+FZfV6utZdCVdMPxacEVxlD
+q7H/dk23O4WwASBriU0PR9/KG3T/LvKBGQJAaYRn1EUTdcxKqcmkt6CYbNKbvL59
+BqqGq4DoHrUTPjd92ybq0fXOZQKM/Fr6OsUVaTVPUYtsz3wpG1MTiRN82QJACX6+
+vggb8yuVU8QAuPW9cu769q1zsTKEVLcf3C9xKhiXppQEyOkLFT3xYh4KGGQ06meG
+m/6Z+SS7KCIM2+6UCQJBANHIzgxDWtrLuWJviNh9EbCsdMioxBH+LGaqFKLC70xD
+Pyoqn+QJQu/ekT+FUb0BeFJfGPzFjh1mFYn4tXxWqMs=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/Makefile.am b/TAO/orbsvcs/tests/Security/Crash_Test/Makefile.am
new file mode 100644
index 00000000000..769f94456f8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/Makefile.am
@@ -0,0 +1,152 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Security_Crash_Test_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.Security_Crash_Test_Client.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+client_SOURCES = \
+ client.cpp \
+ testC.cpp \
+ test_i.h \
+ test_i.i
+
+client_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_SSLIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Security.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Security_Crash_Test_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+server_SOURCES = \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ test_i.h \
+ test_i.i
+
+server_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_SSLIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Security.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/README b/TAO/orbsvcs/tests/Security/Crash_Test/README
new file mode 100644
index 00000000000..e284c627fd1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/README
@@ -0,0 +1,20 @@
+#
+# $Id$
+#
+
+This test verifies that the ORB's connection management mechanism is
+functioning properly while using SSLIOP as inter-orb protocol.
+It does so by doing the following:
+
+ - Starting server with persisten POA.
+
+ - Starting client which makes series of invocations using
+ SSLIOP.
+
+ - Crashing the server.
+
+ - The client waits for the server to come back and
+ tries to connect using the same IOR.
+
+To run the test simply execute run_test.pl
+
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/Security_Crash_Test.mpc b/TAO/orbsvcs/tests/Security/Crash_Test/Security_Crash_Test.mpc
new file mode 100644
index 00000000000..7229bd380e4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/Security_Crash_Test.mpc
@@ -0,0 +1,31 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*server): taoexe, portableserver, ssliop, pi_server, codecfactory, interceptors {
+ after += *idl
+ Source_Files {
+ server.cpp
+ test_i.cpp
+ testS.cpp
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*client): taoexe, portableserver, ssliop, pi_server, codecfactory, interceptors {
+ after += *idl
+ Source_Files {
+ client.cpp
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/cacert.pem b/TAO/orbsvcs/tests/Security/Crash_Test/cacert.pem
new file mode 100644
index 00000000000..a9e905f4e6c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/cacert.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDfTCCAuagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBjDELMAkGA1UEBhMCVVMx
+CzAJBgNVBAgTAkNBMQ8wDQYDVQQHEwZJcnZpbmUxEjAQBgNVBAoTCURPQyBHcm91
+cDEQMA4GA1UECxYHVUNJX0RPQzERMA8GA1UEAxMIUHJpeWFua2ExJjAkBgkqhkiG
+9w0BCQEWF3Bnb250bGFAZG9jLmVjZS51Y2kuZWR1MB4XDTAxMDYxMTE3MjI0MVoX
+DTExMDYwOTE3MjI0MVowgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyFiCRDUH
+nGJqQG9jT/2PhZUAgfwXvIwfDM8m/WujCt/buDcrOz767shBsk4HZhW91Vm4mE03
+K1zfCzojRigf28uyB/rlp60p2Fq0wvZBNNU5Muia6esleR4unb4QslOpcFhct/9n
+UPnlnnsZOTaGWaELNKEjYfHqPh8PQ0lYurECAwEAAaOB7DCB6TAdBgNVHQ4EFgQU
+0Y6IZjkLbLbtZ5aoKLcfd7Yc/kYwgbkGA1UdIwSBsTCBroAU0Y6IZjkLbLbtZ5ao
+KLcfd7Yc/kahgZKkgY8wgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GB
+AHYi8ulIzUI3p3+Ma16rumZxvKcmkJJbU6fpAv4ZvK6AWyy+6Ja0GD5N3SGEx+xU
+nMffTR+LePa9PAZiR7dNkF6ikPxXZu4jn8KY2zFT3SB/VjCoEetR9i9QI//O0Fea
+3yZ0NygNWe5cyVDLCb4meucJpsClfyL28DWzMwD2liX3
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/client.conf b/TAO/orbsvcs/tests/Security/Crash_Test/client.conf
new file mode 100644
index 00000000000..5847fa22a03
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/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:client_key.pem -SSLCertificate PEM:client_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/client.cpp b/TAO/orbsvcs/tests/Security/Crash_Test/client.cpp
new file mode 100644
index 00000000000..dd70e280f98
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/client.cpp
@@ -0,0 +1,146 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/SString.h"
+#include "testC.h"
+
+ACE_RCSID (Send_File,
+ client,
+ "$Id$")
+
+const char *ior = "file://test.ior";
+const char *cert_file = "cacert.pem";
+
+CORBA::Boolean call_shutdown = 0;
+int wait_time = 10;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "sk:w:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ case 's':
+ call_shutdown = 1;
+ break;
+ case 'w':
+ wait_time = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CLIENT (%P): usage: %s "
+ "-k <ior> [-s] -w <wait-time>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CLIENT (%P): Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ for (CORBA::ULong i = 0; i < 2; i++)
+ {
+ ACE_TRY_EX(nested_try)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "CLIENT (%P): Connecting to the server...\n"));
+
+ // If we are retrying then make just one request.
+ do
+ {
+ server->send_line ("some data" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (nested_try);
+
+ }
+ while (i == 0);
+ }
+ ACE_CATCH (CORBA::COMM_FAILURE, ex)
+ {
+ // If this happens second time then we are done.
+ if (i != 0) ACE_RE_THROW;
+
+ // Waiting for server to come back
+ ACE_DEBUG ((LM_DEBUG,
+ "CLIENT (%P): Caught CORBA::COMM_FAILURE. "
+ "Assuming server crashed and will come up soon.\n"
+ "CLIENT (%P): Waiting for %d seconds...\n",
+ wait_time));
+ ACE_OS::sleep (wait_time);
+ }
+ ACE_ENDTRY;
+ ACE_TRY_CHECK;
+ }
+
+ if (call_shutdown)
+ {
+
+ // Let other clients to finish their task if any
+ ACE_OS::sleep (3);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "CLIENT (%P): Calling shutdown...\n"));
+
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "CLIENT (%P): Done.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "CLIENT (%P): Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/client_cert.pem b/TAO/orbsvcs/tests/Security/Crash_Test/client_cert.pem
new file mode 100644
index 00000000000..0bebb696cfc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/client_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQYwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExODEwMzRaFw0xMTA2
+MDkxODEwMzRaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEQMA4GA1UEChMHVEFPK09DSTEMMAoGA1UECxMDT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL6f8pBX7Mi3FPY/OYBOq+kb
+wQ3WX0Z8+nDxd7AiWDAx2AL5EaX8xnUiRi96OJ+CYPCYOUlavGVzZkRVMFdOuHAn
+RvY2sCpvU2rkKpEx9Pd50l7FLnXJuflnRc6zIEKOvuQcPJvsP4AaxaFxTnZExXQJ
+kDEiQP3mGID/eXtUzywbAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAuvSoOnMB6sxj
+ft9YbdLeyATTPzHbxAb6zQo72DUmM3roNowUrefHymU8jZoC6HeaROeKCU0MkVes
+l/jYlz/OwSYkbyGNIUkq4DHEWKzXEg8M603fsWK6IK3T5iPBHY+l/mYSEHJPfypZ
+fl/y4YSNJZlrz6kCIHTcwfHXDRC1mjM=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/client_key.pem b/TAO/orbsvcs/tests/Security/Crash_Test/client_key.pem
new file mode 100644
index 00000000000..1428b501712
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/client_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQC+n/KQV+zItxT2PzmATqvpG8EN1l9GfPpw8XewIlgwMdgC+RGl
+/MZ1IkYvejifgmDwmDlJWrxlc2ZEVTBXTrhwJ0b2NrAqb1Nq5CqRMfT3edJexS51
+ybn5Z0XOsyBCjr7kHDyb7D+AGsWhcU52RMV0CZAxIkD95hiA/3l7VM8sGwIDAQAB
+AoGABGaa6fwtqkCXykuRX0XxsBME9PXTA0SVX5AjjDxuvsYXz5HCd4uLZV7iMexn
+bD9NT6CkCe5/VPRCEyfIUuutVFc7lkPwuRw5FvNcf4gMH9ltufQfH/KeR7d2Jvge
+zrTOH7nicshy67mfOEOaoDphWoT9uy+7ayym+EsJLJU37VkCQQD6xLRu5r9tKX2/
+NfIQsGxF3TZyXgxcuxMh9JOq5E9nBwhr1JaXDbXktXfIK/F3XWHLFS8CIg6PhgGY
+i/+UtGzvAkEAwpoHp89U2jLdVRoIcwy5o7Ocwk3HCXem3UgFWXzzunGM1x+ozDFA
+uo5nyXiAO6Buka9C2czje275kE18BbqLlQJBAMJNf/EeYdzXdVOfHPzJdlt72CAt
+ty5y1ZRNyc10MgIGdQP4KObJ/NJFuZYkVmjCtm+A7neco+OZVcs5TsOOOYkCQBHQ
+6EKEyM/xODJCX+OolpZWK1PeqwpC2hQIM/Uta2L2Yl6Pl3SaTcLGptnbHmJXHchY
+s1YdW/ZBArgjX+dmXMECQApTKWbVLmNsEoOlHU/I/KhGsfuojrzBMMe3FKLiHpmu
+u86L3vu3OGZFcPgjazxWZcip8JekeJ7c+6suLNNRQ5I=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/run_test.pl b/TAO/orbsvcs/tests/Security/Crash_Test/run_test.pl
new file mode 100755
index 00000000000..512fc0883d9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/run_test.pl
@@ -0,0 +1,116 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+unlink $iorfile;
+
+$server_conf = PerlACE::LocalFile ("server$PerlACE::svcconf_ext");
+$client_conf = PerlACE::LocalFile ("client$PerlACE::svcconf_ext");
+
+$server_startup_wait_time = 5;
+$client_wait_time = 15;
+
+$client_args = "-ORBSvcConf $client_conf -w $client_wait_time -k file://$iorfile";
+
+# Set the SSL environment
+# This doesn't work on Windows. For some reason,
+# environment variables aren't propagated to child processes.
+#$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+$SV = new PerlACE::Process ("server",
+ "-o $iorfile " .
+ "-ORBSvcConf $server_conf " .
+ "-ORBdotteddecimaladdresses 1 " .
+ "-ORBEndpoint iiop://:/ssl_port=1235");
+
+$CL1 = new PerlACE::Process ("client", "-s $client_args");
+$CL2 = new PerlACE::Process ("client", "$client_args");
+$CL3 = new PerlACE::Process ("client", "$client_args");
+
+
+local $start_time = time();
+local $max_running_time = 500; # < 10 minutes
+local $elapsed = time() - $start_time;
+
+while($status == 0 && $elapsed < $max_running_time)
+{
+ # Start the server
+ $SV->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($iorfile, $server_startup_wait_time) == -1)
+ {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+ }
+
+ # Start all clients in parallel
+ $CL1->Spawn ();
+ $CL2->Spawn ();
+ $CL3->Spawn ();
+
+ # Let our clients to execute few requests
+ sleep (3);
+
+ # Now kill the server and start it again.
+ $SV->Kill ();
+ $SV->TimedWait (5);
+
+ unlink $iorfile;
+
+ $SV->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($iorfile, $server_startup_wait_time) == -1)
+ {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+ }
+
+ # Wait for the server and clients to finish
+
+ # Waiting for the first client longer because it waits for others and shutdowns the server.
+ $client1 = $CL1->WaitKill ($client_wait_time * 2);
+ $client2 = $CL2->WaitKill ($client_wait_time * 2);
+ $client3 = $CL3->WaitKill ($client_wait_time * 2);
+ $server = $SV->WaitKill (5); # should be down already
+
+ unlink $iorfile;
+
+ if ($client1)
+ {
+ print STDERR "ERROR: client #1 returned $client1\n";
+ $status = 1;
+ }
+
+ if ($client2)
+ {
+ print STDERR "ERROR: client #2 returned $client2\n";
+ $status = 1;
+ }
+
+ if ($client3)
+ {
+ print STDERR "ERROR: client #3 returned $client3\n";
+ $status = 1;
+ }
+
+ if ($server)
+ {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+ }
+
+ $elapsed = time() - $start_time;
+}
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/server.conf b/TAO/orbsvcs/tests/Security/Crash_Test/server.conf
new file mode 100644
index 00000000000..ee0ef1aa57c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/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:server_key.pem -SSLCertificate PEM:server_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp b/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp
new file mode 100644
index 00000000000..c880f1e4858
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp
@@ -0,0 +1,168 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/SString.h"
+#include "test_i.h"
+
+ACE_RCSID (Send_File,
+ server,
+ "$Id$")
+
+const char *ior_output_file = 0;
+const char *cert_file = "cacert.pem";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "SERVER (%P): usage: %s "
+ "-o <iorfile> -w <wait-time>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "SERVER (%P): Unable to initialize the POA.\n"),
+ 1);
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Simple_Server_i server_impl (orb.in ());
+
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ policies[1] =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var persistent_poa =
+ root_poa->create_POA ("PersistentPOA",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ObjectId_var oid =
+ PortableServer::string_to_ObjectId ("object1");
+ ACE_TRY_CHECK;
+
+ persistent_poa->activate_object_with_id (oid.in (),
+ &server_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ CORBA::Object_var server =
+ persistent_poa->create_reference_with_id (oid.in (),
+ "IDL:Simple_Server:1.0"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "SERVER (%P): Cannot open output file "
+ "for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "SERVER (%P): Activated as file://%s\n",
+ ior_output_file));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "SERVER (%P): Activated as <%s>\n",
+ ior.in ()));
+ }
+
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "SERVER (%P): Event loop finished.\n"));
+
+ persistent_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_OS::sleep (1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "SERVER (%P): Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/server_cert.pem b/TAO/orbsvcs/tests/Security/Crash_Test/server_cert.pem
new file mode 100644
index 00000000000..0fc394c24d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/server_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQMwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExNzQ4NTVaFw0xMTA2
+MDkxNzQ4NTVaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEMMAoGA1UEChMDT0NJMRAwDgYDVQQLEwdUQU8rT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANKXmudWiLVu/zdBlSr0/dlr
+pRe+Ie26cPyMo5lKiYNY77tABTiOXe5qLUEryjQ/fZ74gmBe4AYFwb7nu/f58X4A
+0tzSg2M4spWM7N4tzf+YbcUipRt9sEISxwfUxNNWTKnLxvCmkzOsISisukdzTkqJ
+fdzEcPfhO2BZKOdmlg1hAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAjUl3ami01tPY
+P1vMp2642dsIKLZis0TmeWp6HNpm52TbiGZOCqDrvtSQ9+2vGz0BkHvGqWKtD+wv
+zJH23fNnqFuzy1C1xtjoeqhXECTsWVTVdoEox8hSWxPiYRE2dioraZQQ5ENDosh+
+V9YcqJJpnKDUOSGVGuyaU7DpR8yK0pc=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/server_key.pem b/TAO/orbsvcs/tests/Security/Crash_Test/server_key.pem
new file mode 100644
index 00000000000..567a41da6dc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/server_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDSl5rnVoi1bv83QZUq9P3Za6UXviHtunD8jKOZSomDWO+7QAU4
+jl3uai1BK8o0P32e+IJgXuAGBcG+57v3+fF+ANLc0oNjOLKVjOzeLc3/mG3FIqUb
+fbBCEscH1MTTVkypy8bwppMzrCEorLpHc05KiX3cxHD34TtgWSjnZpYNYQIDAQAB
+AoGAC/TxpZrjLjH8KZ3+oy6/zv1upTd1Y7MHQT+W9lgmEKAXFHGhGkHzEVtT8HRV
+CbxlHIaNmH0qiQ0AoB82K/E0BdIMvE+y2qQwlpMfBMX6/TACORReJN3NXGsXwHP4
+/pNlS4LX7/NZbxlReAlDNP+FO8sdKZTyM3VXHFWJbmm4wsECQQD06zQ4uthp0zI9
+WTZiiAUgYwOcnLnXwfWOLAr8RCnYgwiS7MBCcmhZAgWX5SZJYVCwEJ12DAHy02NJ
+EhiSgo+JAkEA3B7PcS5FqZFi6wVjEG6yF8OuSb/rl+FZfV6utZdCVdMPxacEVxlD
+q7H/dk23O4WwASBriU0PR9/KG3T/LvKBGQJAaYRn1EUTdcxKqcmkt6CYbNKbvL59
+BqqGq4DoHrUTPjd92ybq0fXOZQKM/Fr6OsUVaTVPUYtsz3wpG1MTiRN82QJACX6+
+vggb8yuVU8QAuPW9cu769q1zsTKEVLcf3C9xKhiXppQEyOkLFT3xYh4KGGQ06meG
+m/6Z+SS7KCIM2+6UCQJBANHIzgxDWtrLuWJviNh9EbCsdMioxBH+LGaqFKLC70xD
+Pyoqn+QJQu/ekT+FUb0BeFJfGPzFjh1mFYn4tXxWqMs=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/test.idl b/TAO/orbsvcs/tests/Security/Crash_Test/test.idl
new file mode 100644
index 00000000000..a62d8becc91
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/test.idl
@@ -0,0 +1,10 @@
+/*
+ * $Id$
+ */
+
+interface Simple_Server
+{
+ void send_line (in string line);
+
+ oneway void shutdown ();
+};
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/test_i.cpp b/TAO/orbsvcs/tests/Security/Crash_Test/test_i.cpp
new file mode 100644
index 00000000000..f1eff4cd4bb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/test_i.cpp
@@ -0,0 +1,40 @@
+// $Id$
+
+#include "test_i.h"
+
+#if !defined(__ACE_INLINE__)
+#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (Send_File,
+ test_i,
+ "$Id$")
+
+void
+Simple_Server_i::send_line (const char *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+ /*
+ static unsigned long count = 0;
+
+ count++;
+
+ if (count == 1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Executed 128 requests. Now it's time to crash!\n"));
+ ACE_OS::abort ();
+ }
+ */
+
+ // ACE_DEBUG ((LM_DEBUG, "%s\n", line));
+}
+
+void
+Simple_Server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0);
+}
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/test_i.h b/TAO/orbsvcs/tests/Security/Crash_Test/test_i.h
new file mode 100644
index 00000000000..10b18e60116
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/test_i.h
@@ -0,0 +1,49 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/Send_File
+//
+// = FILENAME
+// test_i.h
+//
+// = AUTHOR
+// Carlos O'Ryan
+//
+// ============================================================================
+
+#ifndef TAO_SEND_FILE_TEST_I_H
+#define TAO_SEND_FILE_TEST_I_H
+
+#include "testS.h"
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ // = The Simple_Server methods.
+ void send_line (const char *line
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_SEND_FILE_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/test_i.i b/TAO/orbsvcs/tests/Security/Crash_Test/test_i.i
new file mode 100644
index 00000000000..97524552ff4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/test_i.i
@@ -0,0 +1,7 @@
+// $Id$
+
+ACE_INLINE
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.cpp b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.cpp
new file mode 100644
index 00000000000..ea6e49c399d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.cpp
@@ -0,0 +1,74 @@
+// $Id$
+
+#include "Client_Worker.h"
+#include "tao/debug.h"
+
+Client_Worker::Client_Worker (Simple_Server_ptr server,
+ int niterations)
+ : server_ (Simple_Server::_duplicate(server)),
+ niterations_ (niterations)
+{
+}
+
+void
+Client_Worker::validate_connection (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Ping the object 100 times, ignoring all exceptions.
+ // It would be better to use validate_connection() but the test must
+ // run on minimum CORBA builds too!
+
+ for (int j = 0; j != 100; ++j)
+ {
+ ACE_TRY
+ {
+ this->server_->ping (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if(TAO_debug_level > 0)
+ ACE_DEBUG (( LM_DEBUG,
+ "******** VALIDATED ******* \n"));
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ }
+}
+
+int
+Client_Worker::svc (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Validate connections befire doing any actual work..
+ this->validate_connection (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->server_->validate_protocol (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (int i = 0; i < this->niterations_; ++i)
+ {
+ this->server_->test_method (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ " (%P|%t) iteration = %d\n",
+ i));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) Got an exception \n"));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Client_Worker : Exception Raised");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.h b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.h
new file mode 100644
index 00000000000..c1f1015fb1b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Client_Worker.h
@@ -0,0 +1,62 @@
+// $Id$
+
+// ===========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Security/MT_SSLIOP
+//
+// = FILENAME
+// Client_Worker.h
+//
+// = AUTHOR
+// Anand Krishnan
+//
+// ===========================================================================
+
+#ifndef MT_SSLIOP_CLIENT_WORKER_H
+#define MT_SSLIOP_CLIENT_WORKER_H
+#include /**/ "ace/pre.h"
+#include "ace/Task.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+#include "testC.h"
+
+
+class Client_Worker : public ACE_Task_Base
+{
+ // = TITLE
+ // Run the Client_Worker Thread
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class to run the client threads
+ //
+
+public:
+ Client_Worker (Simple_Server_ptr server, int niterations);
+ // ctor
+
+ virtual int svc (void);
+ // thread entry point
+
+private:
+ void validate_connection (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Validate the connection
+
+private:
+ Simple_Server_var server_;
+ // The server.
+
+ int niterations_;
+ // The number of iterations on each client thread.
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* MT_SSLIOP_CLIENT_WORKER_H */
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/MT_IIOP_SSL.mpc b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/MT_IIOP_SSL.mpc
new file mode 100644
index 00000000000..9203ea80711
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/MT_IIOP_SSL.mpc
@@ -0,0 +1,33 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl) : taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*security server): orbsvcslib, portableserver, ssl, ssliop, pi_server, codecfactory, interceptors {
+ after += *idl
+ Source_Files {
+ Server_Worker.cpp
+ test_i.cpp
+ server.cpp
+ testS.cpp
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*security client): orbsvcslib {
+ after += *idl
+ Source_Files {
+ testC.cpp
+ Client_Worker.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Makefile.am b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Makefile.am
new file mode 100644
index 00000000000..68fcc5c24a8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Makefile.am
@@ -0,0 +1,130 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.MT_IIOP_SSL_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.MT_IIOP_SSL_Security_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ Client_Worker.cpp \
+ client.cpp \
+ testC.cpp \
+ Client_Worker.h \
+ test_i.inl
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.MT_IIOP_SSL_Security_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+server_SOURCES = \
+ Server_Worker.cpp \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ Server_Worker.h \
+ test_i.h \
+ test_i.inl
+
+server_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_SSLIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Security.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/README b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/README
new file mode 100644
index 00000000000..1c182b4983a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/README
@@ -0,0 +1,25 @@
+/**
+
+@page MT_IIOP_SSL Test README File
+
+ This is a stress test for the IIOP_SSL features. This test should
+serve as a stress test for
+
+http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1421
+
+ If SSL cannot be used (for whatever reason) we expect the
+communication to take place over an insecure TCP/IP port. This test
+just makes sure that the fallback port actually works!
+
+ To run the test use the run_test.pl script:
+
+$ ./run_test.pl
+
+ the script returns 0 if the test was successful.
+
+@NOTE:
+
+ This test links *and* loads the SSLIOP library. They are needed
+due to the way the test is setup.
+
+*/
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.cpp b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.cpp
new file mode 100644
index 00000000000..cad95255acd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.cpp
@@ -0,0 +1,23 @@
+// $Id$
+#include "Server_Worker.h"
+
+Server_Worker::Server_Worker (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+int
+Server_Worker::svc (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.h b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.h
new file mode 100644
index 00000000000..d2cb2b78e18
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/Server_Worker.h
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_Worker.h
+ *
+ * $Id$
+ *
+ * @author Anand Krishnan
+ */
+//=============================================================================
+
+#ifndef MT_SSLIOP_SERVER_WORKER_H
+#define MT_SSLIOP_SERVER_WORKER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Task.h"
+#include "tao/ORB.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class Server_Worker
+ *
+ * @brief Run a server thread
+ *
+ * Use the ACE_Task_Base class to run server threads.
+ */
+class Server_Worker : public ACE_Task_Base
+{
+public:
+
+ /// Constructor
+ Server_Worker (CORBA::ORB_ptr orb);
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+
+private:
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* MT_SSLIOP_SERVER_WORKER_H */
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf
new file mode 100644
index 00000000000..bf9048990f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf
@@ -0,0 +1,32 @@
+#$Id$
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLNoProtection -SSLAuthenticate NONE"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf.xml b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf.xml
new file mode 100644
index 00000000000..a39f09f3680
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/MT_SSLIOP/client.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLCertificate PEM:selfsigncert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.cpp b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.cpp
new file mode 100644
index 00000000000..5da628db89d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/client.cpp
@@ -0,0 +1,119 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "Client_Worker.h"
+
+
+const char *ior = "file://test.ior";
+int niterations = 5;
+int do_shutdown = 0;
+int nthreads = 5;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:n:i:x");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case 'n':
+ nthreads = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'i':
+ niterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'x':
+ do_shutdown = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-n <nthreads>"
+ "-i <niterations> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // Get Object Reference using IOR file
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Cast to Appropriate Type
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n", ior),
+ 1);
+ }
+
+
+ Client_Worker client (server.in (), niterations);
+
+ if (client.activate (THR_NEW_LWP | THR_JOINABLE, nthreads) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Cannot Activate Client Threads\n"),
+ 1);
+
+ client.thr_mgr ()->wait ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) threads finished \n"));
+
+ // Shut down the server if -x option given in command line
+ if (do_shutdown)
+ {
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Destroying the ORB..
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/pvtkey.pem b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/pvtkey.pem
new file mode 100644
index 00000000000..6facae6f3dd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/pvtkey.pem
@@ -0,0 +1,9 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBOwIBAAJBAPXZ7YNyFU8T8PVitNwZmdwuc4tG64V/lDYHnmzolmFPQ6gvI2uo
+KBQeHeJFPI6LJ5TGb8hCnypy+zbc+pve8vECAwEAAQJAE/fmZbW/a1PYT2X8AKCH
+sa2ILvjMqmQpWpYV1QyzIiYQPEmQ/5GMUj/t3PZd/17BOH8aPakBT/c1Gp+os6vR
+zQIhAP2RDmm6UyMrJhAtAcNC5s8nbfhKPG80Q0DZ2kiodjQfAiEA+DXqwEZlCh0j
+VPzEXY7vrdQa641zQ5XIX1S/+WbCdu8CIDT9m4V86uLuoYW/4h5sXM/t7Y119itH
+QMbMwFFu40UBAiEA9z+mN6An2BpMbsVXyiavREYMBuahkgprTeM7VHHzdssCIQCY
+QEgmpzGzfdZoREy9B7ooNeRO919lR9qvbte9vvJvWQ==
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/run_test.pl b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/run_test.pl
new file mode 100755
index 00000000000..79f5fefc606
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/run_test.pl
@@ -0,0 +1,86 @@
+
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$threads = '4';
+$iorfile = PerlACE::LocalFile ("test.ior");
+$sv_conf = PerlACE::LocalFile ("server$PerlACE::svcconf_ext");
+$cl_conf = PerlACE::LocalFile ("client$PerlACE::svcconf_ext");
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server", "-ORBsvcconf $sv_conf -o $iorfile -n $threads");
+
+$CL1 = new PerlACE::Process
+ ("client", "-k file://$iorfile -n $threads -i 100 -ORBSvcConf $cl_conf");
+$CL2 = new PerlACE::Process
+ ("client", "-k file://$iorfile -n $threads -i 100 -ORBSvcConf $cl_conf");
+$CL3 = new PerlACE::Process
+ ("client", "-k file://$iorfile -n $threads -i 100 -ORBSvcConf $cl_conf");
+
+$CLS = new PerlACE::Process
+ ("client", "-k file://$iorfile -n $threads -i 100 -ORBSvcConf $cl_conf -x");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$CL1->Spawn ();
+$CL2->Spawn ();
+$CL3->Spawn ();
+
+$client = $CL1->WaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client 1 returned $client\n";
+ $status = 1;
+}
+
+$client = $CL2->WaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client 2 returned $client\n";
+ $status = 1;
+}
+
+$client = $CL3->WaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client 3 returned $client\n";
+ $status = 1;
+}
+
+$client = $CLS->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client S 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/orbsvcs/tests/Security/MT_IIOP_SSL/selfsigncert.pem b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/selfsigncert.pem
new file mode 100644
index 00000000000..e616730ca63
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/selfsigncert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICeDCCAiKgAwIBAgIBADANBgkqhkiG9w0BAQQFADBjMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xDDAKBgNVBAcTA1NUTDELMAkGA1UEChMCV1UxDDAKBgNVBAsT
+A0RPQzELMAkGA1UEAxMCS0ExETAPBgkqhkiG9w0BCQEWAktBMB4XDTAxMDgyNzE2
+NTUxMVoXDTAxMDkyNjE2NTUxMVowYzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1P
+MQwwCgYDVQQHEwNTVEwxCzAJBgNVBAoTAldVMQwwCgYDVQQLEwNET0MxCzAJBgNV
+BAMTAktBMREwDwYJKoZIhvcNAQkBFgJLQTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC
+QQD12e2DchVPE/D1YrTcGZncLnOLRuuFf5Q2B55s6JZhT0OoLyNrqCgUHh3iRTyO
+iyeUxm/IQp8qcvs23Pqb3vLxAgMBAAGjgcAwgb0wHQYDVR0OBBYEFL8LnC8csuIX
++TUw6FCoReB27PHoMIGNBgNVHSMEgYUwgYKAFL8LnC8csuIX+TUw6FCoReB27PHo
+oWekZTBjMQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xDDAKBgNVBAcTA1NUTDEL
+MAkGA1UEChMCV1UxDDAKBgNVBAsTA0RPQzELMAkGA1UEAxMCS0ExETAPBgkqhkiG
+9w0BCQEWAktBggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADQQAZP9CT
+TVRxAz3Acxxxn32rsnwSeNJr1uTA4hew7f4QZ187oZia+rcFLOILrwgCmtqEmWVj
+dj6COUrqKo60BI5V
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf
new file mode 100644
index 00000000000..d486769062b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf
@@ -0,0 +1,7 @@
+#$Id$
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLNoProtection -SSLPrivateKey PEM:pvtkey.pem -SSLCertificate PEM:selfsigncert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+
+
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf.xml b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf.xml
new file mode 100644
index 00000000000..abff554e12c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/MT_SSLIOP/server.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLPrivateKey PEM:pvtkey.pem -SSLCertificate PEM:selfsigncert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.cpp b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.cpp
new file mode 100644
index 00000000000..29c53ecb7b8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/server.cpp
@@ -0,0 +1,121 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "test_i.h"
+#include "Server_Worker.h"
+
+const char *ior_output_file = 0;
+int nthreads = 4;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:n:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+
+ case 'n':
+ nthreads = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ // Get a Root POA reference
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Simple_Server_i server_impl (orb.in ());
+
+ Simple_Server_var server =
+ server_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Server_Worker worker (orb.in ());
+ if (worker.activate (THR_NEW_LWP | THR_JOINABLE,
+ nthreads) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot activate client threads\n"),
+ 1);
+
+ worker.thr_mgr ()->wait ();
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test.idl b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test.idl
new file mode 100644
index 00000000000..107fea38768
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test.idl
@@ -0,0 +1,23 @@
+//
+// $Id$
+//
+
+interface Simple_Server
+{
+ exception WrongProtocolType {};
+
+ /// A ping call to set up connections
+ void ping ();
+
+ /** Validate the connection to see whether we have used the right
+ * protocol type. A succesful validation would return nothing and
+ * an unsuccessful validation would return an exception.
+ */
+ void validate_protocol ()
+ raises (WrongProtocolType);
+
+ /// A simple call
+ long test_method (in long x);
+
+ oneway void shutdown ();
+};
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.cpp b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.cpp
new file mode 100644
index 00000000000..731adae0864
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.cpp
@@ -0,0 +1,91 @@
+// $Id$
+
+#include "test_i.h"
+#include "tao/debug.h"
+#include "tao/ORB_Core.h"
+#include "tao/Thread_Lane_Resources.h"
+#include "tao/Transport_Cache_Manager.h"
+#include "orbsvcs/SSLIOP/SSLIOP_Transport.h"
+#include "ace/OS_NS_unistd.h"
+
+#if !defined(__ACE_INLINE__)
+#include "test_i.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (MT_IIOP_SSL,
+ test_i,
+ "$Id$")
+
+void
+Simple_Server_i::ping (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return;
+}
+
+void
+Simple_Server_i::validate_protocol (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((Simple_Server::WrongProtocolType,
+ CORBA::SystemException))
+{
+ if (this->validated_ == NOT_VALIDATED)
+ {
+ ACE_MT (ACE_GUARD (TAO_SYNCH_MUTEX,
+ ace_mon,
+ this->mutex_));
+
+ if (this->validated_ != NOT_VALIDATED)
+ return;
+
+ TAO::Transport_Cache_Manager::HASH_MAP &map =
+ this->orb_->orb_core ()->lane_resources ().transport_cache ().map ();
+
+ TAO::Transport_Cache_Manager::HASH_MAP_ITER st_iter =
+ map.begin ();
+
+ TAO::Transport_Cache_Manager::HASH_MAP_ITER end_iter =
+ map.end ();
+
+ for (TAO::Transport_Cache_Manager::HASH_MAP_ITER iter = st_iter;
+ iter != end_iter;
+ ++iter)
+ {
+ TAO_Transport *t =
+ (*iter).int_id_.transport ();
+
+ // @@ Worst possible way to check. If SSLIOP had a tag
+ // things would have been a lot simpler.
+ TAO::SSLIOP::Transport *ssl_t =
+ dynamic_cast<TAO::SSLIOP::Transport *> (t);
+
+ // There should be no SSL Transport
+ if (ssl_t != 0)
+ {
+ this->validated_ = VALIDATED_NOSUCCESS;
+ break;
+ }
+ }
+
+ }
+
+ if (this->validated_ == VALIDATED_NOSUCCESS)
+ ACE_THROW (Simple_Server::WrongProtocolType ());
+}
+
+CORBA::Long
+Simple_Server_i::test_method (CORBA::Long x ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Request in thread [%t]\n"));
+ ACE_Time_Value tv (0, 15000);
+ ACE_OS::sleep (tv);
+ return x;
+}
+
+void
+Simple_Server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.h b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.h
new file mode 100644
index 00000000000..55a89d5ebf9
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.h
@@ -0,0 +1,68 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/MT_Server
+//
+// = FILENAME
+// test_i.h
+//
+// = AUTHOR
+// Carlos O'Ryan
+//
+// ============================================================================
+
+#ifndef TAO_MT_SERVER_TEST_I_H
+#define TAO_MT_SERVER_TEST_I_H
+
+#include "testS.h"
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ // = The Simple_Server methods.
+ void ping (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void validate_protocol (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((Simple_Server::WrongProtocolType,
+ CORBA::SystemException));
+
+ CORBA::Long test_method (CORBA::Long x ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+ /// Synchronizer
+ TAO_SYNCH_MUTEX mutex_;
+
+ enum
+ {
+ NOT_VALIDATED = 0,
+ VALIDATED_SUCCESS,
+ VALIDATED_NOSUCCESS
+ };
+ /// Flag to indicate status of validation
+ CORBA::Octet validated_;
+};
+
+#if defined(__ACE_INLINE__)
+#include "test_i.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_MT_SERVER_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.inl b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.inl
new file mode 100644
index 00000000000..51fb274230d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_IIOP_SSL/test_i.inl
@@ -0,0 +1,9 @@
+// $Id$
+
+ACE_INLINE
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ mutex_ (),
+ validated_ (Simple_Server_i::NOT_VALIDATED)
+{
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.cpp b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.cpp
new file mode 100644
index 00000000000..82fe2335212
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.cpp
@@ -0,0 +1,70 @@
+// $Id$
+
+#include "Client_Worker.h"
+#include "tao/debug.h"
+
+Client_Worker::Client_Worker (Simple_Server_ptr server,
+ Another_One_ptr another,
+ int niterations)
+ : server_ (Simple_Server::_duplicate(server)),
+ another_ (Another_One::_duplicate (another)),
+ niterations_ (niterations)
+{
+}
+
+void
+Client_Worker::validate_connection (ACE_ENV_SINGLE_ARG_DECL)
+{
+ // Ping the object 100 times, ignoring all exceptions.
+ // It would be better to use validate_connection() but the test must
+ // run on minimum CORBA builds too!
+
+ for (int j = 0; j != 100; ++j)
+ {
+ ACE_TRY
+ {
+ this->server_->test_method (j ACE_ENV_ARG_PARAMETER);
+ this->another_->test_method (j ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if(TAO_debug_level > 0)
+ ACE_DEBUG (( LM_DEBUG,
+ "******** VALIDATED ******* \n"));
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ }
+}
+
+int
+Client_Worker::svc (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Validate connections befire doing any actual work..
+ this->validate_connection (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (int i = 0; i < this->niterations_; ++i)
+ {
+ this->server_->test_method (i ACE_ENV_ARG_PARAMETER);
+ this->another_->test_method (i ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ " (%P|%t) iteration = %d\n",
+ i));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Client_Worker : Exception Raised");
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.h b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.h
new file mode 100644
index 00000000000..daae1a99760
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Client_Worker.h
@@ -0,0 +1,67 @@
+// $Id$
+
+// ===========================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests/Security/MT_SSLIOP
+//
+// = FILENAME
+// Client_Worker.h
+//
+// = AUTHOR
+// Anand Krishnan
+//
+// ===========================================================================
+
+#ifndef MT_SSLIOP_CLIENT_WORKER_H
+#define MT_SSLIOP_CLIENT_WORKER_H
+#include /**/ "ace/pre.h"
+#include "ace/Task.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+#include "testC.h"
+
+
+class Client_Worker : public ACE_Task_Base
+{
+ // = TITLE
+ // Run the Client_Worker Thread
+ //
+ // = DESCRIPTION
+ // Use the ACE_Task_Base class to run the client threads
+ //
+
+public:
+ Client_Worker (Simple_Server_ptr server,
+ Another_One_ptr another,
+ int niterations);
+ // ctor
+
+ virtual int svc (void);
+ // thread entry point
+
+private:
+ void validate_connection (ACE_ENV_SINGLE_ARG_DECL_NOT_USED);
+ // Validate the connection
+
+private:
+ Simple_Server_var server_;
+ // The server.
+
+ Another_One_var another_;
+ // Another object served by the same server as server_.
+
+ int niterations_;
+ // The number of iterations on each client thread.
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* MT_SSLIOP_CLIENT_WORKER_H */
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/MT_SSLIOP.mpc b/TAO/orbsvcs/tests/Security/MT_SSLIOP/MT_SSLIOP.mpc
new file mode 100644
index 00000000000..918a01648b2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/MT_SSLIOP.mpc
@@ -0,0 +1,33 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ test.idl
+ }
+ custom_only = 1
+}
+
+project(*security server): orbsvcsexe, portableserver, ssl, iortable {
+ after += *idl
+ Source_Files {
+ Server_Worker.cpp
+ server.cpp
+ test_i.cpp
+ testS.cpp
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*security client): orbsvcsexe, ssl {
+ after += *idl
+ Source_Files {
+ Client_Worker.cpp
+ client.cpp
+ testC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/Makefile.am b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Makefile.am
new file mode 100644
index 00000000000..22357d5505c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Makefile.am
@@ -0,0 +1,131 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.MT_SSLIOP_Idl.am
+
+BUILT_SOURCES = \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+CLEANFILES = \
+ test-stamp \
+ testC.cpp \
+ testC.h \
+ testC.inl \
+ testS.cpp \
+ testS.h \
+ testS.inl
+
+testC.cpp testC.h testC.inl testS.cpp testS.h testS.inl: test-stamp
+
+test-stamp: $(srcdir)/test.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/test.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ test.idl
+
+## Makefile.MT_SSLIOP_Security_Client.am
+
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+client_SOURCES = \
+ Client_Worker.cpp \
+ client.cpp \
+ testC.cpp \
+ Client_Worker.h \
+ test_i.i
+
+client_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+client_LDADD = \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+
+## Makefile.MT_SSLIOP_Security_Server.am
+
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+server_SOURCES = \
+ Server_Worker.cpp \
+ server.cpp \
+ testC.cpp \
+ testS.cpp \
+ test_i.cpp \
+ Server_Worker.h \
+ test_i.h \
+ test_i.i
+
+server_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/README b/TAO/orbsvcs/tests/Security/MT_SSLIOP/README
new file mode 100644
index 00000000000..7d695b35da7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/README
@@ -0,0 +1,25 @@
+# $Id$
+
+Description:
+
+ This is a simple test for a thread-pool server that can
+service multithreaded clients with the same object reference.
+It creates a server process with a variable number of threads,
+multiple (multithreaded) clients can send requests to it, the
+requests are handled in different threads.
+
+Expected output:
+
+The server prints the thread that handles each request. The Client
+prints the Validation info as well as the thread pid and iteration
+number.
+
+How to run:
+Use the run_test.pl.
+
+FOR SSL:-
+ Pvt Key File ( RSA ) = pvtkey.pem
+ Self Signed Certificate = selfsigncert.pem
+
+ ORB Svc Conf File for Server = server.conf
+ ORB Svc Conf File for Client = client.conf
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.cpp b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.cpp
new file mode 100644
index 00000000000..cad95255acd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.cpp
@@ -0,0 +1,23 @@
+// $Id$
+#include "Server_Worker.h"
+
+Server_Worker::Server_Worker (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+int
+Server_Worker::svc (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ }
+ ACE_ENDTRY;
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.h b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.h
new file mode 100644
index 00000000000..d2cb2b78e18
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/Server_Worker.h
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Server_Worker.h
+ *
+ * $Id$
+ *
+ * @author Anand Krishnan
+ */
+//=============================================================================
+
+#ifndef MT_SSLIOP_SERVER_WORKER_H
+#define MT_SSLIOP_SERVER_WORKER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/Task.h"
+#include "tao/ORB.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class Server_Worker
+ *
+ * @brief Run a server thread
+ *
+ * Use the ACE_Task_Base class to run server threads.
+ */
+class Server_Worker : public ACE_Task_Base
+{
+public:
+
+ /// Constructor
+ Server_Worker (CORBA::ORB_ptr orb);
+
+ /// The thread entry point.
+ virtual int svc (void);
+
+
+private:
+ /// The ORB
+ CORBA::ORB_var orb_;
+
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* MT_SSLIOP_SERVER_WORKER_H */
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf b/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf
new file mode 100644
index 00000000000..fc1422ac496
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf
@@ -0,0 +1,31 @@
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLCertificate PEM:selfsigncert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf.xml b/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf.xml
new file mode 100644
index 00000000000..a39f09f3680
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/MT_SSLIOP/client.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLCertificate PEM:selfsigncert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.cpp b/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.cpp
new file mode 100644
index 00000000000..8ef6242213a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/client.cpp
@@ -0,0 +1,139 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "Client_Worker.h"
+
+
+const char *ior = "file://test.ior";
+char *another_ior = 0;
+
+int niterations = 5;
+int do_shutdown = 0;
+int nthreads = 5;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:n:i:x");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case 'n':
+ nthreads = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'i':
+ niterations = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case 'x':
+ do_shutdown = 1;
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "-n <nthreads>"
+ "-i <niterations> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ int len = ACE_OS::strlen(ior) + 1;
+ another_ior = new char[len + 1];
+ ACE_OS::strcpy(another_ior, ior);
+ another_ior[len-1] = '1';
+ another_ior[len] = '\0';
+
+ // Get Object Reference using IOR file
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Cast to Appropriate Type
+ Simple_Server_var server =
+ Simple_Server::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n", ior),
+ 1);
+ }
+
+
+ object =
+ orb->string_to_object (another_ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Cast to Appropriate Type
+ Another_One_var another =
+ Another_One::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+
+ Client_Worker client (server.in (),
+ another.in (),
+ niterations);
+
+ if (client.activate (THR_NEW_LWP | THR_JOINABLE, nthreads) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Cannot Activate Client Threads\n"),
+ 1);
+
+ client.thr_mgr ()->wait ();
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) threads finished \n"));
+
+ // Shut down the server if -x option given in command line
+ if (do_shutdown)
+ {
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ // Destroying the ORB..
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/pvtkey.pem b/TAO/orbsvcs/tests/Security/MT_SSLIOP/pvtkey.pem
new file mode 100644
index 00000000000..6facae6f3dd
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/pvtkey.pem
@@ -0,0 +1,9 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBOwIBAAJBAPXZ7YNyFU8T8PVitNwZmdwuc4tG64V/lDYHnmzolmFPQ6gvI2uo
+KBQeHeJFPI6LJ5TGb8hCnypy+zbc+pve8vECAwEAAQJAE/fmZbW/a1PYT2X8AKCH
+sa2ILvjMqmQpWpYV1QyzIiYQPEmQ/5GMUj/t3PZd/17BOH8aPakBT/c1Gp+os6vR
+zQIhAP2RDmm6UyMrJhAtAcNC5s8nbfhKPG80Q0DZ2kiodjQfAiEA+DXqwEZlCh0j
+VPzEXY7vrdQa641zQ5XIX1S/+WbCdu8CIDT9m4V86uLuoYW/4h5sXM/t7Y119itH
+QMbMwFFu40UBAiEA9z+mN6An2BpMbsVXyiavREYMBuahkgprTeM7VHHzdssCIQCY
+QEgmpzGzfdZoREy9B7ooNeRO919lR9qvbte9vvJvWQ==
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test.pl b/TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test.pl
new file mode 100755
index 00000000000..24846ed2477
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test.pl
@@ -0,0 +1,65 @@
+
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$threads = '2';
+$iorfile = PerlACE::LocalFile ("test.ior");
+$sv_conf = PerlACE::LocalFile ("server$PerlACE::svcconf_ext");
+$cl_conf = PerlACE::LocalFile ("client$PerlACE::svcconf_ext");
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server", "-ORBsvcconf $sv_conf -o $iorfile -n $threads");
+
+$CL1 = new PerlACE::Process
+ ("client", "-k file://$iorfile -n 2 -i 100 -ORBSvcConf $cl_conf");
+
+$CLS = new PerlACE::Process
+ ("client", "-k file://$iorfile -n 2 -i 100 -ORBSvcConf $cl_conf -x");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$CL1->Spawn ();
+$client = $CL1->WaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$client = $CLS->SpawnWaitKill (60);
+
+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/orbsvcs/tests/Security/MT_SSLIOP/run_test_harsh.pl b/TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test_harsh.pl
new file mode 100755
index 00000000000..0bdb4fe461c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test_harsh.pl
@@ -0,0 +1,64 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$threads = '4';
+$iorfile = PerlACE::LocalFile ("test.ior");
+$sv_conf = PerlACE::LocalFile ("server$PerlACE::svcconf_ext");
+$cl_conf = PerlACE::LocalFile ("client$PerlACE::svcconf_ext");
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server", "-ORBsvcconf $sv_conf -o $iorfile -n $threads");
+
+$CL1 = new PerlACE::Process
+ ("client", "-k file://$iorfile -n 10 -i 1000 -ORBSvcConf $cl_conf");
+
+$CLS = new PerlACE::Process
+ ("client", "-k file://$iorfile -n 10 -i 1000 -ORBSvcConf $cl_conf -x");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$CL1->Spawn ();
+$client = $CL1->WaitKill (480);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$client = $CLS->SpawnWaitKill (480);
+
+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/orbsvcs/tests/Security/MT_SSLIOP/run_test_heavy.pl b/TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test_heavy.pl
new file mode 100644
index 00000000000..ad20195c287
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test_heavy.pl
@@ -0,0 +1,65 @@
+
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$threads = '100';
+$iorfile = PerlACE::LocalFile ("test.ior");
+$sv_conf = PerlACE::LocalFile ("server$PerlACE::svcconf_ext");
+$cl_conf = PerlACE::LocalFile ("client$PerlACE::svcconf_ext");
+
+unlink $iorfile;
+
+$SV = new PerlACE::Process ("server", "-ORBsvcconf $sv_conf -o $iorfile -n $threads");
+
+$CL1 = new PerlACE::Process
+ ("client", "-k file://$iorfile -n 20 -i 10000 -ORBSvcConf $cl_conf");
+
+$CLS = new PerlACE::Process
+ ("client", "-k file://$iorfile -n 20 -i 10000 -ORBSvcConf $cl_conf -x");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$CL1->Spawn ();
+$client = $CL1->WaitKill (600);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$client = $CLS->SpawnWaitKill (600);
+
+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/orbsvcs/tests/Security/MT_SSLIOP/selfsigncert.pem b/TAO/orbsvcs/tests/Security/MT_SSLIOP/selfsigncert.pem
new file mode 100644
index 00000000000..e616730ca63
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/selfsigncert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICeDCCAiKgAwIBAgIBADANBgkqhkiG9w0BAQQFADBjMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xDDAKBgNVBAcTA1NUTDELMAkGA1UEChMCV1UxDDAKBgNVBAsT
+A0RPQzELMAkGA1UEAxMCS0ExETAPBgkqhkiG9w0BCQEWAktBMB4XDTAxMDgyNzE2
+NTUxMVoXDTAxMDkyNjE2NTUxMVowYzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1P
+MQwwCgYDVQQHEwNTVEwxCzAJBgNVBAoTAldVMQwwCgYDVQQLEwNET0MxCzAJBgNV
+BAMTAktBMREwDwYJKoZIhvcNAQkBFgJLQTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC
+QQD12e2DchVPE/D1YrTcGZncLnOLRuuFf5Q2B55s6JZhT0OoLyNrqCgUHh3iRTyO
+iyeUxm/IQp8qcvs23Pqb3vLxAgMBAAGjgcAwgb0wHQYDVR0OBBYEFL8LnC8csuIX
++TUw6FCoReB27PHoMIGNBgNVHSMEgYUwgYKAFL8LnC8csuIX+TUw6FCoReB27PHo
+oWekZTBjMQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xDDAKBgNVBAcTA1NUTDEL
+MAkGA1UEChMCV1UxDDAKBgNVBAsTA0RPQzELMAkGA1UEAxMCS0ExETAPBgkqhkiG
+9w0BCQEWAktBggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADQQAZP9CT
+TVRxAz3Acxxxn32rsnwSeNJr1uTA4hew7f4QZ187oZia+rcFLOILrwgCmtqEmWVj
+dj6COUrqKo60BI5V
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf b/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf
new file mode 100644
index 00000000000..31d7b2979b8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf
@@ -0,0 +1,7 @@
+
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLPrivateKey PEM:pvtkey.pem -SSLCertificate PEM:selfsigncert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+
+
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf.xml b/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf.xml
new file mode 100644
index 00000000000..abff554e12c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/MT_SSLIOP/server.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLPrivateKey PEM:pvtkey.pem -SSLCertificate PEM:selfsigncert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.cpp b/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.cpp
new file mode 100644
index 00000000000..b05e356507c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/server.cpp
@@ -0,0 +1,187 @@
+// $Id$
+
+#include "ace/Get_Opt.h"
+#include "tao/IORTable/IORTable.h"
+#include "test_i.h"
+#include "Server_Worker.h"
+
+const char *ior_output_file = 0;
+char *another_output_file = 0;
+const char *ior_table_name = 0;
+char *another_table_name = 0;
+int nthreads = 4;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "i:o:n:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'i':
+ {
+ ior_table_name = get_opts.opt_arg ();
+ int len = ACE_OS::strlen(ior_table_name) + 1;
+ another_table_name = new char[len + 1];
+ ACE_OS::strcpy(another_table_name, ior_table_name);
+ another_table_name[len-1] = '1';
+ another_table_name[len] = '\0';
+ break;
+ }
+ case 'o':
+ {
+ ior_output_file = get_opts.opt_arg ();
+ int len = ACE_OS::strlen(ior_output_file) + 1;
+ another_output_file = new char[len + 1];
+ ACE_OS::strcpy(another_output_file, ior_output_file);
+ another_output_file[len-1] = '1';
+ another_output_file[len] = '\0';
+ break;
+ }
+ case 'n':
+ nthreads = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "[-i <iortable name>]"
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize the ORB
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ // Get a Root POA reference
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Simple_Server_i server_impl (orb.in ());
+ Another_One_i another_one_impl (orb.in());
+
+ Simple_Server_var server =
+ server_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Another_One_var another_one =
+ another_one_impl._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var another_ior =
+ orb->object_to_string (another_one.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ ACE_DEBUG ((LM_DEBUG, "Activated another one as <%s>\n", another_ior.in ()));
+
+ if (ior_table_name != 0)
+ {
+ CORBA::Object_var table_object =
+ orb->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ IORTable::Table_var adapter =
+ IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ if (CORBA::is_nil (adapter.in ()))
+ {
+ ACE_ERROR ((LM_ERROR, "Nil IORTable\n"));
+ return -1;
+ }
+
+ adapter->bind ( ior_table_name, ior.in () ACE_ENV_ARG_PARAMETER);
+ adapter->bind ( another_table_name, another_ior.in() ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+ }
+
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_DEBUG ((LM_DEBUG,"Wrote ior to %s\n",
+ ior_output_file));
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ output_file = ACE_OS::fopen (another_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ another_output_file),
+ 1);
+ ACE_DEBUG ((LM_DEBUG,"Wrote another ior to %s\n",
+ another_output_file));
+ ACE_OS::fprintf (output_file, "%s", another_ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Server_Worker worker (orb.in ());
+ if (worker.activate (THR_NEW_LWP | THR_JOINABLE,
+ nthreads) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot activate client threads\n"),
+ 1);
+
+ worker.thr_mgr ()->wait ();
+
+ ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/test.idl b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test.idl
new file mode 100644
index 00000000000..3191d2be3e5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test.idl
@@ -0,0 +1,15 @@
+//
+// $Id$
+//
+
+interface Simple_Server
+{
+ long test_method (in long x);
+
+ oneway void shutdown ();
+};
+
+interface Another_One
+{
+ long test_method (in long x);
+};
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.cpp b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.cpp
new file mode 100644
index 00000000000..ee3ebd33fa4
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.cpp
@@ -0,0 +1,43 @@
+// $Id$
+
+#include "test_i.h"
+#include "tao/debug.h"
+#include "ace/OS_NS_unistd.h"
+#if !defined(__ACE_INLINE__)
+#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (MT_Server,
+ test_i,
+ "$Id$")
+
+CORBA::Long
+Simple_Server_i::test_method (CORBA::Long x ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Simple_Server: Request in thread %t\n"));
+ ACE_Time_Value tv (0, 15000);
+ ACE_OS::sleep (tv);
+ return x;
+}
+
+void
+Simple_Server_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+//---------------------------------------------------------------------------
+
+CORBA::Long
+Another_One_i::test_method (CORBA::Long x ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "Another_One: Request in thread %t\n"));
+ ACE_Time_Value tv (0, 15000);
+ ACE_OS::sleep (tv);
+ return x;
+}
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.h b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.h
new file mode 100644
index 00000000000..e98f9db8850
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.h
@@ -0,0 +1,71 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/MT_Server
+//
+// = FILENAME
+// test_i.h
+//
+// = AUTHOR
+// Carlos O'Ryan
+//
+// ============================================================================
+
+#ifndef TAO_MT_SERVER_TEST_I_H
+#define TAO_MT_SERVER_TEST_I_H
+
+#include "testS.h"
+
+class Simple_Server_i : public POA_Simple_Server
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Simple_Server_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ // = The Simple_Server methods.
+ CORBA::Long test_method (CORBA::Long x ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+ // The ORB
+};
+
+
+class Another_One_i : public POA_Another_One
+{
+ // = TITLE
+ // Simpler Server implementation
+ //
+ // = DESCRIPTION
+ // Implements the Simple_Server interface in test.idl
+ //
+public:
+ Another_One_i (CORBA::ORB_ptr orb);
+ // ctor
+
+ // = The Simple_Server methods.
+ CORBA::Long test_method (CORBA::Long x ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ CORBA::ORB_var orb_;
+ // The ORB
+};
+
+#if defined(__ACE_INLINE__)
+#include "test_i.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* TAO_MT_SERVER_TEST_I_H */
diff --git a/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.i b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.i
new file mode 100644
index 00000000000..9a32e7ec527
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/MT_SSLIOP/test_i.i
@@ -0,0 +1,13 @@
+// $Id$
+
+ACE_INLINE
+Simple_Server_i::Simple_Server_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+ACE_INLINE
+Another_One_i::Another_One_i (CORBA::ORB_ptr orb)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
diff --git a/TAO/orbsvcs/tests/Security/Makefile.am b/TAO/orbsvcs/tests/Security/Makefile.am
new file mode 100644
index 00000000000..97c2e92a0ab
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Makefile.am
@@ -0,0 +1,20 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+SUBDIRS = \
+ BiDirectional \
+ Big_Request \
+ Callback \
+ Crash_Test \
+ MT_IIOP_SSL \
+ MT_SSLIOP \
+ Secure_Invocation \
+ ssliop_corbaloc
+
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl
new file mode 100644
index 00000000000..d52d94a51c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo.idl
@@ -0,0 +1,32 @@
+// -*- IDL -*-
+
+//=============================================================================
+/**
+ * @file Foo.idl
+ *
+ * $Id$
+ *
+ * IDL for the Secure_Invocation test.
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+module Foo
+{
+ interface Bar
+ {
+ /// Exception that indicates that no security attributes were
+ /// available during the upcall. If this exception is thrown,
+ /// then is most likely a problem with the underlying security
+ /// mechanism(s).
+ exception NoSecurityAttributes {};
+
+ /// Test method.
+ void baz () raises (NoSecurityAttributes);
+
+ /// Shutdown the server.
+ oneway void shutdown ();
+ };
+
+};
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp
new file mode 100644
index 00000000000..e7fb1763591
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.cpp
@@ -0,0 +1,46 @@
+// -*- C++ -*-
+
+#include "Foo_i.h"
+
+#include "ace/OS_NS_string.h"
+
+
+ACE_RCSID (Secure_Invocation,
+ Foo_i,
+ "$Id$")
+
+
+Foo_i::Foo_i (CORBA::ORB_ptr orb,
+ SecurityLevel3::SecurityCurrent_ptr current)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ current_ (SecurityLevel3::SecurityCurrent::_duplicate (current))
+{
+}
+
+void
+Foo_i::baz (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Foo::Bar::NoSecurityAttributes))
+{
+ SecurityLevel3::ClientCredentials_var credentials =
+ this->current_->client_credentials (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::String_var id =
+ credentials->creds_id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n"
+ "ClientCredentials ID\n"
+ "====================\n"
+ "%s\n",
+ id.in ()));
+}
+
+void
+Foo_i::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h
new file mode 100644
index 00000000000..c6acd255e3e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Foo_i.h
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Foo_i.h
+ *
+ * $Id$
+ *
+ * Implementation header for the Secure_Invocation test.
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef SECURE_INVOCATION_FOO_I_H
+#define SECURE_INVOCATION_FOO_I_H
+
+#include "FooS.h"
+#include "orbsvcs/SecurityLevel3C.h"
+
+class Foo_i : public virtual POA_Foo::Bar
+{
+public:
+
+ /// Constructor.
+ Foo_i (CORBA::ORB_ptr,
+ SecurityLevel3::SecurityCurrent_ptr current);
+
+ /// Test method.
+ virtual void baz (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ Foo::Bar::NoSecurityAttributes));
+
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// Reference to the ORB.
+ CORBA::ORB_var orb_;
+
+ /// Reference to the "SecurityCurrent" object.
+ SecurityLevel3::SecurityCurrent_var current_;
+
+};
+
+#endif /* SECURE_INVOCATION_FOO_I_H */
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Makefile.am b/TAO/orbsvcs/tests/Security/Secure_Invocation/Makefile.am
new file mode 100644
index 00000000000..3dadc41e4e1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Makefile.am
@@ -0,0 +1,137 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+noinst_PROGRAMS =
+
+## Makefile.Secure_Invocation_Idl.am
+
+BUILT_SOURCES = \
+ FooC.cpp \
+ FooC.h \
+ FooC.inl \
+ FooS.cpp \
+ FooS.h \
+ FooS.inl
+
+CLEANFILES = \
+ Foo-stamp \
+ FooC.cpp \
+ FooC.h \
+ FooC.inl \
+ FooS.cpp \
+ FooS.h \
+ FooS.inl
+
+FooC.cpp FooC.h FooC.inl FooS.cpp FooS.h FooS.inl: Foo-stamp
+
+Foo-stamp: $(srcdir)/Foo.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Foo.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ Foo.idl
+
+## Makefile.Secure_Invocation_Security_Client.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+
+noinst_PROGRAMS += client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ FooC.cpp \
+ client.cpp \
+ Foo_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Security.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+## Makefile.Secure_Invocation_Security_Server.am
+
+if BUILD_CORBA_MESSAGING
+if BUILD_INTERCEPTORS
+if BUILD_SSL
+if !BUILD_ACE_FOR_TAO
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DACE_HAS_SSL=1 \
+ @ACE_TLS_CPPFLAGS@
+
+server_SOURCES = \
+ FooC.cpp \
+ FooS.cpp \
+ Foo_i.cpp \
+ server.cpp \
+ Foo_i.h
+
+server_LDFLAGS = \
+ @ACE_TLS_LDFLAGS@
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_SSLIOP.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \
+ $(ACE_BUILDDIR)/ace/SSL/libACE_SSL.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Security.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la \
+ @ACE_TLS_LIBS@
+
+endif !BUILD_ACE_FOR_TAO
+endif BUILD_SSL
+endif BUILD_INTERCEPTORS
+endif BUILD_CORBA_MESSAGING
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/README b/TAO/orbsvcs/tests/Security/Secure_Invocation/README
new file mode 100644
index 00000000000..a4078c896d3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/README
@@ -0,0 +1,28 @@
+#
+# $Id$
+#
+
+This test verifies that the ORB's secure invocation mechanism is
+functioning properly. It does so by the doing the following:
+
+ - Invoking a request over standard (insecure) IIOP on a target
+ object that requires secure invocation (e.g. over SSLIOP).
+ The client should receive a CORBA::NO_PERMISSION exception.
+
+ - Invoking a request via a security mechanism, such as
+ SSLIOP. The AccessId associated with the given request is
+ obtained from the SecurityCurrent object, and displayed.
+
+The expected test output is the following (actual "certificate issuer"
+contents may differ):
+
+Activated as <IOR:...>
+(1768|1628) Received CORBA::NO_PERMISSION from server, as expected.
+
+ClientCredentials ID
+====================
+X509: 06
+
+Event loop finished.
+
+Secure_Invocation test passed.
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/Secure_Invocation.mpc b/TAO/orbsvcs/tests/Security/Secure_Invocation/Secure_Invocation.mpc
new file mode 100644
index 00000000000..2cab2208413
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/Secure_Invocation.mpc
@@ -0,0 +1,31 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl) : taoidldefaults {
+ IDL_Files {
+ Foo.idl
+ }
+ custom_only = 1
+}
+
+project(*security server): taoexe, portableserver, orbsvcslib, security, ssliop, pi_server, codecfactory, interceptors {
+ after += *idl
+ Source_Files {
+ Foo_i.cpp
+ FooS.cpp
+ FooC.cpp
+ server.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*security client): taoexe, orbsvcslib, security, pi, codecfactory, interceptors {
+ after += *idl
+ Source_Files {
+ FooC.cpp
+ client.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/cacert.pem b/TAO/orbsvcs/tests/Security/Secure_Invocation/cacert.pem
new file mode 100644
index 00000000000..a9e905f4e6c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/cacert.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDfTCCAuagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBjDELMAkGA1UEBhMCVVMx
+CzAJBgNVBAgTAkNBMQ8wDQYDVQQHEwZJcnZpbmUxEjAQBgNVBAoTCURPQyBHcm91
+cDEQMA4GA1UECxYHVUNJX0RPQzERMA8GA1UEAxMIUHJpeWFua2ExJjAkBgkqhkiG
+9w0BCQEWF3Bnb250bGFAZG9jLmVjZS51Y2kuZWR1MB4XDTAxMDYxMTE3MjI0MVoX
+DTExMDYwOTE3MjI0MVowgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyFiCRDUH
+nGJqQG9jT/2PhZUAgfwXvIwfDM8m/WujCt/buDcrOz767shBsk4HZhW91Vm4mE03
+K1zfCzojRigf28uyB/rlp60p2Fq0wvZBNNU5Muia6esleR4unb4QslOpcFhct/9n
+UPnlnnsZOTaGWaELNKEjYfHqPh8PQ0lYurECAwEAAaOB7DCB6TAdBgNVHQ4EFgQU
+0Y6IZjkLbLbtZ5aoKLcfd7Yc/kYwgbkGA1UdIwSBsTCBroAU0Y6IZjkLbLbtZ5ao
+KLcfd7Yc/kahgZKkgY8wgYwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEPMA0G
+A1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAOBgNVBAsWB1VDSV9E
+T0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkBFhdwZ29udGxhQGRv
+Yy5lY2UudWNpLmVkdYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GB
+AHYi8ulIzUI3p3+Ma16rumZxvKcmkJJbU6fpAv4ZvK6AWyy+6Ja0GD5N3SGEx+xU
+nMffTR+LePa9PAZiR7dNkF6ikPxXZu4jn8KY2zFT3SB/VjCoEetR9i9QI//O0Fea
+3yZ0NygNWe5cyVDLCb4meucJpsClfyL28DWzMwD2liX3
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client.conf b/TAO/orbsvcs/tests/Security/Secure_Invocation/client.conf
new file mode 100644
index 00000000000..5847fa22a03
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/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:client_key.pem -SSLCertificate PEM:client_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client.conf.xml b/TAO/orbsvcs/tests/Security/Secure_Invocation/client.conf.xml
new file mode 100644
index 00000000000..f68baa15979
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/client.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Secure_Invocation/client.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:client_key.pem -SSLCertificate PEM:client_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client.cpp b/TAO/orbsvcs/tests/Security/Secure_Invocation/client.cpp
new file mode 100644
index 00000000000..40877b8871f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/client.cpp
@@ -0,0 +1,189 @@
+// -*- C++ -*-
+
+#include "ace/Get_Opt.h"
+
+#include "FooC.h"
+#include "orbsvcs/SecurityC.h"
+#include "ace/SString.h"
+
+ACE_RCSID (Secure_Invocation,
+ client,
+ "$Id$")
+
+const char *ior = "file://test.ior";
+const char *cert_file = "cacert.pem";
+
+void
+insecure_invocation_test (CORBA::ORB_ptr orb,
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ // Disable protection for this insecure invocation test.
+
+ Security::QOP qop = Security::SecQOPNoProtection;
+
+ CORBA::Any no_protection;
+ no_protection <<= qop;
+
+ // Create the Security::QOPPolicy.
+ CORBA::Policy_var policy =
+ orb->create_policy (Security::SecQOPPolicy,
+ no_protection
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CORBA::PolicyList policy_list (1);
+ policy_list.length (1);
+ policy_list[0] = CORBA::Policy::_duplicate (policy.in ());
+
+ // Create an object reference that uses plain IIOP (i.e. no
+ // protection).
+ CORBA::Object_var object =
+ obj->_set_policy_overrides (policy_list,
+ CORBA::SET_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ Foo::Bar_var server =
+ Foo::Bar::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: Object reference <%s> is "
+ "nil.\n",
+ ior));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ ACE_TRY
+ {
+ // This invocation should result in a CORBA::NO_PERMISSION
+ // exception.
+ server->baz (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::NO_PERMISSION, exc)
+ {
+ ACE_DEBUG ((LM_INFO,
+ "(%P|%t) Received CORBA::NO_PERMISSION from "
+ "server, as expected.\n"));
+
+ return;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: CORBA::NO_PERMISSION was not thrown.\n"
+ "(%P|%t) ERROR: It should have been thrown.\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+}
+
+void
+secure_invocation_test (CORBA::Object_ptr object
+ ACE_ENV_ARG_DECL)
+{
+ Foo::Bar_var server =
+ Foo::Bar::_narrow (object ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (CORBA::is_nil (server.in ()))
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: Object reference <%s> is "
+ "nil.\n",
+ ior));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+
+ // This invocation should return successfully.
+ server->baz (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ server->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This test sets creates a Security::QOPPolicy with the
+ // Quality-of-Protection set to "no protection." It then
+ // invokes a method on the server (insecurely), which should
+ // then result in a CORBA::NO_PERMISSION exception.
+ //
+ // The server is not shutdown by this test.
+ insecure_invocation_test (orb.in (), object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // This test uses the default secure SSLIOP settings to securely
+ // invoke a method on the server. No exception should occur.
+ //
+ // The server *is* shutdown by this test.
+ secure_invocation_test (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n"
+ "Secure_Invocation test passed.\n"));
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client_cert.pem b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_cert.pem
new file mode 100644
index 00000000000..0bebb696cfc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQYwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExODEwMzRaFw0xMTA2
+MDkxODEwMzRaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEQMA4GA1UEChMHVEFPK09DSTEMMAoGA1UECxMDT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL6f8pBX7Mi3FPY/OYBOq+kb
+wQ3WX0Z8+nDxd7AiWDAx2AL5EaX8xnUiRi96OJ+CYPCYOUlavGVzZkRVMFdOuHAn
+RvY2sCpvU2rkKpEx9Pd50l7FLnXJuflnRc6zIEKOvuQcPJvsP4AaxaFxTnZExXQJ
+kDEiQP3mGID/eXtUzywbAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAuvSoOnMB6sxj
+ft9YbdLeyATTPzHbxAb6zQo72DUmM3roNowUrefHymU8jZoC6HeaROeKCU0MkVes
+l/jYlz/OwSYkbyGNIUkq4DHEWKzXEg8M603fsWK6IK3T5iPBHY+l/mYSEHJPfypZ
+fl/y4YSNJZlrz6kCIHTcwfHXDRC1mjM=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client_key.pem b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_key.pem
new file mode 100644
index 00000000000..1428b501712
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQC+n/KQV+zItxT2PzmATqvpG8EN1l9GfPpw8XewIlgwMdgC+RGl
+/MZ1IkYvejifgmDwmDlJWrxlc2ZEVTBXTrhwJ0b2NrAqb1Nq5CqRMfT3edJexS51
+ybn5Z0XOsyBCjr7kHDyb7D+AGsWhcU52RMV0CZAxIkD95hiA/3l7VM8sGwIDAQAB
+AoGABGaa6fwtqkCXykuRX0XxsBME9PXTA0SVX5AjjDxuvsYXz5HCd4uLZV7iMexn
+bD9NT6CkCe5/VPRCEyfIUuutVFc7lkPwuRw5FvNcf4gMH9ltufQfH/KeR7d2Jvge
+zrTOH7nicshy67mfOEOaoDphWoT9uy+7ayym+EsJLJU37VkCQQD6xLRu5r9tKX2/
+NfIQsGxF3TZyXgxcuxMh9JOq5E9nBwhr1JaXDbXktXfIK/F3XWHLFS8CIg6PhgGY
+i/+UtGzvAkEAwpoHp89U2jLdVRoIcwy5o7Ocwk3HCXem3UgFWXzzunGM1x+ozDFA
+uo5nyXiAO6Buka9C2czje275kE18BbqLlQJBAMJNf/EeYdzXdVOfHPzJdlt72CAt
+ty5y1ZRNyc10MgIGdQP4KObJ/NJFuZYkVmjCtm+A7neco+OZVcs5TsOOOYkCQBHQ
+6EKEyM/xODJCX+OolpZWK1PeqwpC2hQIM/Uta2L2Yl6Pl3SaTcLGptnbHmJXHchY
+s1YdW/ZBArgjX+dmXMECQApTKWbVLmNsEoOlHU/I/KhGsfuojrzBMMe3FKLiHpmu
+u86L3vu3OGZFcPgjazxWZcip8JekeJ7c+6suLNNRQ5I=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client_key_nopasswd.pem b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_key_nopasswd.pem
new file mode 100644
index 00000000000..35e449a2493
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_key_nopasswd.pem
@@ -0,0 +1,16 @@
+RSA key ok
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDBuQXJQhW75XZJfatysGHE3/RXFeMSB8TOk/geXhlUAQTaHj/0
++eQLNnz2ed8XFoyZFJYioUrcAHyC3LGv7CemhPAW0ZEBgXG8QX1eG8T+NlPh5pC8
+pMg8R67aVr/Rs3jvXsh7lI5rqCQ6Mr1fCg6qVdnJyH04gKKv4b0Iu29FDQIDAQAB
+AoGADRU7yM3HvfrPNENicspqr+sYC1GVFkCkD/d6SEK+nye6diiY1SiTOBaj9dlh
+MaP6NtRnF0uhTJ5TylqxPVpLixs6Dot/lX0Mu/bD80Zez1bWdQFivszOcDnxylHX
+j4z3Sv5nSPWoOgssDVxWNpI9QHcC2E7zII094drJEG/UZIECQQDy0axJBAahSgMX
+9CfpWJjXEMKD58RwddbiS2tGboLzdYXUVaE1qr4GN70jypGC4HmWZ6XV5HX4+fy3
+QltXF3GdAkEAzD0VpmOCan7jLty6+qklEwpyzMDJ9VH9QwfMyS5oSO4Dh08lC6WT
+Ss+nQlXFwFYszKxd6kznEECGPlKybiC+MQJBANFdsKuUaRMQ+fHhd7hfyAlITi/l
+2x8MvCeK2Ah2qTq6jpYy7zmS6x35WYBO3YB3hN8Gp5rxzjbLdfedo5xIfpECQGkk
+ASM5EwhT7gxP4YnszYMx28uAa/d4j9KUD156H4F71iEwIzgNsvfOUqKZmUXclw9+
+pJJbqI/7R6CJ3gVHoeECQGpfgurJz2V5Z2/qsZIDJXgxFoW6vY9rZbZU80ZYx3Cb
+RINCjB0G0ThsqH7FqCC3PAkEt0xThXqT2SM8ezVlENM=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf
new file mode 100644
index 00000000000..c485fa19f3a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate NONE -SSLPrivateKey PEM:client_key_nopasswd.pem -SSLCertificate PEM:client_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf.xml b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf.xml
new file mode 100644
index 00000000000..8060c28b75a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Secure_Invocation/client_nopasswd.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate NONE -SSLPrivateKey PEM:client_key_nopasswd.pem -SSLCertificate PEM:client_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl
new file mode 100755
index 00000000000..313d10bcfee
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl
@@ -0,0 +1,55 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+# $Id$
+
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+$file = PerlACE::LocalFile ("test.ior");
+
+unlink $file;
+
+$status = 0;
+
+# Set the SSL environment
+# This doesn't work on Windows. For some reason,
+# environment variables aren't propagated to child processes.
+#$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
+
+$SV = new PerlACE::Process ("server",
+ "-o $file -ORBSvcConf server$PerlACE::svcconf_ext");
+$CL = new PerlACE::Process ("client",
+ "-ORBSvcConf client$PerlACE::svcconf_ext -k file://$file");
+
+print STDERR "\n\n==== Running Secure_Invocation test\n";
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($file, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$file>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+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 $file;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server.conf b/TAO/orbsvcs/tests/Security/Secure_Invocation/server.conf
new file mode 100644
index 00000000000..ee0ef1aa57c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/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:server_key.pem -SSLCertificate PEM:server_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server.conf.xml b/TAO/orbsvcs/tests/Security/Secure_Invocation/server.conf.xml
new file mode 100644
index 00000000000..e4acefdf26a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Secure_Invocation/server.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:server_key.pem -SSLCertificate PEM:server_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server.cpp b/TAO/orbsvcs/tests/Security/Secure_Invocation/server.cpp
new file mode 100644
index 00000000000..8b7ff656577
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server.cpp
@@ -0,0 +1,167 @@
+// -*- C++ -*-
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "Foo_i.h"
+#include "ace/SString.h"
+
+ACE_RCSID (Secure_Invocation,
+ server,
+ "$Id$")
+
+const char *ior_output_file = 0;
+const char *cert_file = "cacert.pem";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ ACE_TString env ("SSL_CERT_FILE=");
+ env += cert_file;
+ ACE_OS::putenv (env.c_str ());
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) ERROR: Unable to initialize the "
+ "POA.\n"),
+ 1);
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ obj =
+ orb->resolve_initial_references ("SecurityLevel3:SecurityCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ SecurityLevel3::SecurityCurrent_var security_current =
+ SecurityLevel3::SecurityCurrent::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (security_current.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%P|%t) ERROR: SecurityCurrent reference "
+ "is nil.\n"),
+ 1);
+
+ Foo_i *server_impl = 0;
+
+ ACE_NEW_RETURN (server_impl,
+ Foo_i (orb.in (),
+ security_current.in ()),
+ -1);
+
+ PortableServer::ServantBase_var owner_transfer (server_impl);
+
+ Foo::Bar_var server =
+ server_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Sanity check on SSLIOP profile equivalence.
+ // Since the POA is reference counting the servants, this
+ // implementation must still exist when the POA is destroyed.
+ Foo_i server_impl2 (orb.in (), security_current.in ());
+ Foo::Bar_var server2 =
+ server_impl2._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ const CORBA::Boolean equivalent =
+ server->_is_equivalent (server2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (equivalent)
+ {
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) ERROR: SSLIOP profile equivalence "
+ "check failed.\n"));
+ }
+
+ CORBA::String_var ior =
+ orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ()));
+
+ // If the ior_output_file exists, output the ior to it
+ if (ior_output_file != 0)
+ {
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+ }
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "\n"
+ "Event loop finished.\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server_cert.pem b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_cert.pem
new file mode 100644
index 00000000000..0fc394c24d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICgzCCAewCAQMwDQYJKoZIhvcNAQEEBQAwgYwxCzAJBgNVBAYTAlVTMQswCQYD
+VQQIEwJDQTEPMA0GA1UEBxMGSXJ2aW5lMRIwEAYDVQQKEwlET0MgR3JvdXAxEDAO
+BgNVBAsWB1VDSV9ET0MxETAPBgNVBAMTCFByaXlhbmthMSYwJAYJKoZIhvcNAQkB
+FhdwZ29udGxhQGRvYy5lY2UudWNpLmVkdTAeFw0wMTA2MTExNzQ4NTVaFw0xMTA2
+MDkxNzQ4NTVaMIGGMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExDzANBgNVBAcT
+BklydmluZTEMMAoGA1UEChMDT0NJMRAwDgYDVQQLEwdUQU8rT0NJMREwDwYDVQQD
+EwhQcml5YW5rYTEmMCQGCSqGSIb3DQEJARYXcGdvbnRsYUBkb2MuZWNlLnVjaS5l
+ZHUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANKXmudWiLVu/zdBlSr0/dlr
+pRe+Ie26cPyMo5lKiYNY77tABTiOXe5qLUEryjQ/fZ74gmBe4AYFwb7nu/f58X4A
+0tzSg2M4spWM7N4tzf+YbcUipRt9sEISxwfUxNNWTKnLxvCmkzOsISisukdzTkqJ
+fdzEcPfhO2BZKOdmlg1hAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAjUl3ami01tPY
+P1vMp2642dsIKLZis0TmeWp6HNpm52TbiGZOCqDrvtSQ9+2vGz0BkHvGqWKtD+wv
+zJH23fNnqFuzy1C1xtjoeqhXECTsWVTVdoEox8hSWxPiYRE2dioraZQQ5ENDosh+
+V9YcqJJpnKDUOSGVGuyaU7DpR8yK0pc=
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server_key.pem b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_key.pem
new file mode 100644
index 00000000000..567a41da6dc
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_key.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDSl5rnVoi1bv83QZUq9P3Za6UXviHtunD8jKOZSomDWO+7QAU4
+jl3uai1BK8o0P32e+IJgXuAGBcG+57v3+fF+ANLc0oNjOLKVjOzeLc3/mG3FIqUb
+fbBCEscH1MTTVkypy8bwppMzrCEorLpHc05KiX3cxHD34TtgWSjnZpYNYQIDAQAB
+AoGAC/TxpZrjLjH8KZ3+oy6/zv1upTd1Y7MHQT+W9lgmEKAXFHGhGkHzEVtT8HRV
+CbxlHIaNmH0qiQ0AoB82K/E0BdIMvE+y2qQwlpMfBMX6/TACORReJN3NXGsXwHP4
+/pNlS4LX7/NZbxlReAlDNP+FO8sdKZTyM3VXHFWJbmm4wsECQQD06zQ4uthp0zI9
+WTZiiAUgYwOcnLnXwfWOLAr8RCnYgwiS7MBCcmhZAgWX5SZJYVCwEJ12DAHy02NJ
+EhiSgo+JAkEA3B7PcS5FqZFi6wVjEG6yF8OuSb/rl+FZfV6utZdCVdMPxacEVxlD
+q7H/dk23O4WwASBriU0PR9/KG3T/LvKBGQJAaYRn1EUTdcxKqcmkt6CYbNKbvL59
+BqqGq4DoHrUTPjd92ybq0fXOZQKM/Fr6OsUVaTVPUYtsz3wpG1MTiRN82QJACX6+
+vggb8yuVU8QAuPW9cu769q1zsTKEVLcf3C9xKhiXppQEyOkLFT3xYh4KGGQ06meG
+m/6Z+SS7KCIM2+6UCQJBANHIzgxDWtrLuWJviNh9EbCsdMioxBH+LGaqFKLC70xD
+Pyoqn+QJQu/ekT+FUb0BeFJfGPzFjh1mFYn4tXxWqMs=
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server_key_nopasswd.pem b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_key_nopasswd.pem
new file mode 100644
index 00000000000..2381bdcc6df
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_key_nopasswd.pem
@@ -0,0 +1,16 @@
+RSA key ok
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDOtfLxhcWktrjY/U9Mdsy9WaUeqFZGWkz2gknKMNrfJnKAdmuU
+RaP2G9X565FhgyrEpb5bYJUC3aTLhdr5NsDFt3V1hhs9rev6WSeONmiAlOrUrKCB
+cpF3K0HyU4bVp06/FgtWFUp8ja88B8zLhwak6KAGYBUQZXVtMsaJliYLNQIDAQAB
+AoGAXIqghPg6j48uGhbtlXHqHysu/Ran6T8sDYAuwNI2aoiv4kshxnOW/+teVFDd
++SXb08XP/uCyVWIdEPCQI9obWppALzQhF5kALhchnlEATkVxkdx6T5PyGnFq5rpc
+NCfb3Q68T5bcFvsgup9Lt8JpGBQGvjYJZYkJuMvWmH6Bc9ECQQD4TwB+p5MjRALX
+lcMI8pURt6CKxpWLyFUUkQi6HksXzxeh4PDErLxsyFexKec7TOap5xnWZMPkjl76
+BdW65abrAkEA1R0XSCfu3B4LnX4zlDi+nUXG8YvquuZ21TRrNg3YmVcyF+jvkM1f
+4MGRPRF3hnTuZhnlD+wEubpmpcoNnNTOXwJBAIfZOQ0SAzblC6UE42puxU2nJ+ck
+1EZgeOPCoYKp9i11eJlw5mjDlGbziL59jWttHDlSHVmlUWMm3SFutcsFv7cCQQCK
+i+UM5dklhOrsMpV5sQJK4IgblGi/pQBwTym79HhyB/vrC2ZjbwD77xtq5iYcZXxv
+KDqAhWH1FLeS5K7A3KBlAkEAqwIhKyV1kK0EtvpNMprfIGNccRjNX8TJEQsN49EE
+luhKkAam4CoA1R2wZc0VHfWqilK0qhrezXxlo4OeElxiRg==
+-----END RSA PRIVATE KEY-----
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf
new file mode 100644
index 00000000000..e445c19615f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate NONE -SSLPrivateKey PEM:server_key.pem -SSLCertificate PEM:server_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf.xml b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf.xml
new file mode 100644
index 00000000000..2b61ce1d547
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_none.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Secure_Invocation/server_none.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate NONE -SSLPrivateKey PEM:server_key.pem -SSLCertificate PEM:server_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf
new file mode 100644
index 00000000000..19cd88ba742
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf
@@ -0,0 +1,4 @@
+# $Id$
+
+dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate NONE -SSLPrivateKey PEM:server_key_nopasswd.pem -SSLCertificate PEM:server_cert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf.xml b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf.xml
new file mode 100644
index 00000000000..0b53b803d90
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from ./orbsvcs/tests/Security/Secure_Invocation/server_nopasswd.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- $Id$ -->
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLAuthenticate NONE -SSLPrivateKey PEM:server_key_nopasswd.pem -SSLCertificate PEM:server_cert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/Makefile.am b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/Makefile.am
new file mode 100644
index 00000000000..220499d6f56
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/Makefile.am
@@ -0,0 +1,88 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Corbaloc_Ssliop_Client.am
+
+BUILT_SOURCES = \
+ test_objectC.cpp \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.cpp \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.cpp \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+CLEANFILES = \
+ test_object-stamp \
+ test_objectC.cpp \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.cpp \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.cpp \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+test_objectC.cpp test_objectC.h test_objectC.inl test_objectS.cpp test_objectS.h test_objectS.inl test_objectS_T.cpp test_objectS_T.h test_objectS_T.inl: test_object-stamp
+
+test_object-stamp: $(srcdir)/test_object.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/test_object.idl
+ @touch $@
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp \
+ test_objectC.cpp \
+ test_objectS.cpp \
+ client.h \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/README b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/README
new file mode 100644
index 00000000000..6e28b065fb8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/README
@@ -0,0 +1,87 @@
+// $Id$
+
+These application tests address various features of TAO's
+Naming Service. The functionality is the same as in the
+Simple_Naming test, but the difference is that all the
+communication is done over SSLIOP and clients are using
+INS-style corbaloc URLs.
+
+To run all tests automatically -
+ execute Perl script run_test.pl
+
+To run tests manually -
+ start the Naming Service (see
+ TAO/orbsvcs/Naming_Service/README for valid options).
+ Make sure you use " -ORBSvcConf server.conf" and
+ "-ORBEndpoint iiop://localhost:23456/ssl_port=12345"
+
+ Then run ./client with one of the options below.
+ Make sure you add " -ORBSvcConf client.conf" and
+ "-ORBInitRef NameService=corbaloc:ssliop:localhost:12345/NameService"
+
+NOTE: if running tests manually, Naming Service has to be restarted
+before each test (this is due to some tests not 'cleaning up' bindings
+after themselves).
+
+The following options exist:
+---------------------------
+-s Run the Simple test of the Naming Service.
+
+-t Run the Tree test of the Naming Service.
+
+-e Run the Exceptions test of the Naming Service
+
+-i Run the Iterator test of the Naming Service.
+
+-y Run the Destroy test of the Naming Service.
+
+Persistent test consists of two parts (below).
+
+-p <file_name>
+ Run the Persistent Naming Service test, part 1. Requires an
+ argument specifying the name of the file in which to store an ior for
+ use by Persistent Naming Service test, part 2. Note, in order
+ to test out persistent capabilities of the Naming Service, the
+ Naming Service must be started with -f and -ORBendpoint options.
+ The values for these options must be the same for both runs of
+ the Naming Service (i.e., for part 1 and part 2 of persistent test).
+
+-c <ior>
+ Run the Persistent Naming Service test, part 2. Requires an
+ argument specifying the ior, which was produced in part 1 of
+ the test. Note, in order to test out persistent capabilities
+ of the Naming Service, the Naming Service must be started with
+ -f and -ORBendpoint options. The values for these options
+ must remain the same for both runs of the Naming Service (i.e.,
+ for part 1 and part 2 of persistent test).
+
+ Example of testing persistence on a Unix system:
+ $ ../../Naming_Service -f log -ORBendpoint iiop://localhost:20000
+ $ ./client -p ior_file
+ kill the Naming_Service process
+ $ ../../Naming_Service -f log -ORBendpoint iiop://localhost:20000
+ $ ./client -c file://ior_file
+
+ where the steps correspond to 1)starting the Naming Service on
+ port 20000 in persistent mode, with persistent state being
+ stored in file called "log", 2) running the first part of the
+ client persistent naming test, and sending its data to file
+ called "ior_file", 3) killing the Naming Service process, 4)
+ restarting the Naming Service on the same port with the same
+ persistent state storage file, and 5) running the second part
+ of the client persistence test by specifying the ior from part
+ 1 in the file format.
+
+ We kill the Naming Service process between 2 client runs to
+ make sure it can recreate its state from persistent storage.
+ It is necessary to restart the Naming Service on the same
+ host/port in order for the persistent IORs from the first
+ run to be valid for the second run.
+
+If no option is specified, Simple test is run. If more than one
+option is specified, only one test runs.
+
+
+DESCRIPTION AND EXPECTED OUTPUT FOR EACH TEST
+*******************************************
+Please see $TAO_ROOT/orbsvcs/tests/Simple_Naming/README
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf
new file mode 100644
index 00000000000..880c1b7d372
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf
@@ -0,0 +1,5 @@
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLPrivateKey PEM:pvtkey-client.pem -SSLCertificate PEM:selfsigncert-client.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf.xml b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf.xml
new file mode 100644
index 00000000000..50bb24f73ee
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.conf.xml
@@ -0,0 +1,9 @@
+<?xml version='1.0'?>
+<!-- Converted from client.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLPrivateKey PEM:pvtkey-client.pem -SSLCertificate PEM:selfsigncert-client.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
+
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.cpp b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.cpp
new file mode 100644
index 00000000000..904a68a489b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.cpp
@@ -0,0 +1,1279 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/Naming_Service/
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// This class implements a simple CORBA client for the CosNaming
+// example using stubs generated by the TAO ORB IDL compiler.
+//
+// = AUTHORS
+// Sergio Flores-Gaitan <sergio@cs.wustl.edu>,
+// Marina Spivak <marina@cs.wustl.edu>, and
+// Douglas C. Schmidt <schmidt@cs.wustl.edu>
+// ============================================================================
+
+#include "client.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID(Simple_Naming, client, "$Id$")
+
+#if defined (_MSC_VER)
+# pragma warning (disable : 4250)
+#endif /* _MSC_VER */
+
+class My_Test_Object :
+ public virtual POA_Test_Object
+{
+public:
+ // = Initialization and termination methods.
+ My_Test_Object (CORBA::Short id = 0);
+ // Constructor.
+
+ ~My_Test_Object (void);
+ // Destructor.
+
+ // = Interface implementation accessor methods.
+
+ void id (CORBA::Short id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Sets id.
+
+ CORBA::Short id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Gets id.
+
+private:
+ short id_;
+};
+
+My_Test_Object::My_Test_Object (CORBA::Short id)
+ : id_ (id)
+{
+}
+
+My_Test_Object::~My_Test_Object (void)
+{
+}
+
+CORBA::Short
+My_Test_Object::id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return id_;
+}
+
+void
+My_Test_Object::id (CORBA::Short id ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ id_ = id;
+}
+
+// Constructor.
+
+CosNaming_Client::CosNaming_Client (void)
+ : argc_ (0),
+ argv_ (0),
+ test_ (0)
+{
+}
+
+// Parses the command line arguments and returns an error status.
+
+int
+CosNaming_Client::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "p:dstieym:c:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case 's':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Simple_Test,
+ -1);
+ break;
+ case 'm':
+ if (this->test_ == 0)
+ {
+ int size = ACE_OS::atoi (get_opts.opt_arg ());
+ if (size <= 0)
+ size = 10;
+
+ ACE_NEW_RETURN (this->test_,
+ MT_Test (this->orbmgr_.orb (), size),
+ -1);
+ }
+
+ break;
+ case 't':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Tree_Test,
+ -1);
+ break;
+ case 'i':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Iterator_Test,
+ -1);
+ break;
+ case 'e':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Exceptions_Test,
+ -1);
+ break;
+ case 'y':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Destroy_Test,
+ -1);
+ break;
+ case 'p':
+ if (this->test_ == 0)
+ {
+ FILE * ior_output_file =
+ ACE_OS::fopen (get_opts.opt_arg (), "w");
+
+ if (ior_output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ get_opts.opt_arg ()), -1);
+
+ ACE_NEW_RETURN (this->test_,
+ Persistent_Test_Begin (this->orbmgr_.orb (),
+ ior_output_file),
+ -1);
+ }
+ break;
+ case 'c':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Persistent_Test_End (this->orbmgr_.orb (),
+ get_opts.opt_arg ()),
+ -1);
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Argument %c \n usage: %s"
+ " [-d]"
+ " [-s or -e or -t or -i or -y or -p or -c<ior> or -m<size>]"
+ "\n",
+ c,
+ this->argv_ [0]),
+ -1);
+ }
+
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Simple_Test,
+ -1);
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Execute client example code.
+
+int
+CosNaming_Client::run (void)
+{
+ return test_->execute (naming_client_);
+}
+
+CosNaming_Client::~CosNaming_Client (void)
+{
+ delete test_;
+}
+
+int
+CosNaming_Client::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize ORB.
+ this->orbmgr_.init (this->argc_,
+ this->argv_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orbmgr_.activate_poa_manager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse command line and verify parameters.
+ if (this->parse_args () == -1)
+ return -1;
+
+ CORBA::ORB_var orb = this->orbmgr_.orb ();
+ return this->naming_client_.init (orb.in ());
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "init");
+ // and return -1 below . . .
+ }
+ ACE_ENDTRY;
+
+ return -1;
+}
+
+MT_Test::MT_Test (CORBA::ORB_ptr orb,
+ int size)
+ :size_ (size),
+ orb_ (orb),
+ name_service_ior_ (0)
+{
+}
+
+int
+MT_Test::svc (void)
+{
+ // Obtain object reference to the Naming Service (create new stub.)
+
+ CosNaming::NamingContext_var name_service;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_EX (SETUP)
+ {
+ CORBA::Object_var name_service_obj =
+ orb_->string_to_object (name_service_ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SETUP);
+
+ name_service =
+ CosNaming::NamingContext::_narrow (name_service_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SETUP);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test setup");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ if (name_service.in () == 0)
+ return -1;
+
+ // Bind the object.
+ ACE_TRY_EX (BIND)
+ {
+ name_service->bind (test_name_,
+ test_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (BIND);
+ ACE_DEBUG ((LM_DEBUG,
+ "Bound name OK in thread %t\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unable to bind in thread %t\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test bind");
+ // This debug statement works around a IRIX/MIPSPro 7.3 bug (it
+ // fails with optimize=1 debug=0; but works with any other
+ // settings for those flags).
+ ACE_DEBUG ((LM_DEBUG, "MT_Test(%t) - bind[3] %d\n",
+ test_name_.length ()));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Resolve the object from the Naming Context.
+ ACE_TRY_EX (RESOLVE)
+ {
+ CORBA::Object_var result_obj_ref =
+ name_service->resolve (test_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (RESOLVE);
+
+ Test_Object_var result_object =
+ Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (RESOLVE);
+
+ if (!CORBA::is_nil (result_object.in ()))
+ {
+ CORBA::Short id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (RESOLVE);
+
+ if (id == CosNaming_Client::OBJ1_ID)
+ ACE_DEBUG ((LM_DEBUG,
+ "Resolved name OK in thread %t\n"));
+ }
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unable to resolve in thread %t\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test resolve");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Unbind the object from the Naming Context.
+ ACE_TRY_EX (UNBIND)
+ {
+ name_service->unbind (test_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (UNBIND);
+ ACE_DEBUG ((LM_DEBUG,
+ "Unbound name OK in thread %t\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unable to unbind in thread %t\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test unbind");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+MT_Test::execute (TAO_Naming_Client &root_context)
+{
+ if (CORBA::is_nil (this->orb_.in ()))
+ return -1;
+
+ // Create data which will be used by all threads.
+
+ // Dummy object instantiation.
+ My_Test_Object *test_obj_impl =
+ new My_Test_Object (CosNaming_Client::OBJ1_ID);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ test_ref_ =
+ test_obj_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ test_obj_impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the IOR for the Naming Service. Each thread can use it
+ // in <string_to_object> to create its own stub for the Naming
+ // Service. This 'trick' is necessary, because multiple threads
+ // cannot be using the same stub - bad things happen... This is
+ // just a way to give each thread its own stub.
+
+ CosNaming::NamingContext_var context =
+ root_context.get_context ();
+
+ name_service_ior_ =
+ orb_->object_to_string (context.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception while instantiating dummy");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Create a name for dummy.
+ test_name_.length (1);
+ test_name_[0].id = CORBA::string_dup ("Foo");
+
+ // Spawn threads, each of which will be executing svc ().
+ int status = this->activate (THR_NEW_LWP | THR_JOINABLE,
+ size_);
+
+ if (status == -1)
+ return -1;
+
+ status = this->wait ();
+ return status;
+}
+
+int
+Simple_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Dummy object instantiation.
+ My_Test_Object *test_obj_impl = new My_Test_Object (CosNaming_Client::OBJ1_ID);
+ Test_Object_var test_obj_ref =
+ test_obj_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Give ownership of this object to POA.
+ test_obj_impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind an object to the Naming Context.
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("Foo");
+ root_context->bind (test_name,
+ test_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "Bound name OK\n"));
+
+ // Resolve the object from the Naming Context.
+ CORBA::Object_var result_obj_ref =
+ root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ Test_Object_var result_object =
+ Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!CORBA::is_nil (result_object.in ()))
+ {
+ CORBA::Short id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (id == CosNaming_Client::OBJ1_ID)
+ ACE_DEBUG ((LM_DEBUG, "Resolved name OK\n"));
+ }
+
+ // Unbind the object from the Naming Context.
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "Unbound name OK\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Simple test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Tree_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a tree of contexts: root->level1->level2. Bind object
+ // foo under context level2.
+
+ // Bind level1 context under root.
+ CosNaming::Name level1;
+ level1.length (1);
+ level1[0].id = CORBA::string_dup ("level1_context");
+ CosNaming::NamingContext_var level1_context;
+ level1_context = root_context->bind_new_context (level1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create a new context.
+ CosNaming::NamingContext_var level2_context;
+ level2_context = root_context->new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Instantiate a dummy object and bind it under the new context.
+ My_Test_Object *impl1 =
+ new My_Test_Object (CosNaming_Client::OBJ1_ID);
+ Test_Object_var obj1 = impl1->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl1->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name obj_name;
+ obj_name.length (1);
+ obj_name[0].id = CORBA::string_dup ("foo");
+ level2_context->bind (obj_name, obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind the context we just created under level1.
+ CosNaming::Name level2 (level1);
+ level2.length (2);
+ level2[1].id = CORBA::string_dup ("level2_context");
+ root_context->bind_context (level2,
+ level2_context.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Resolve and unbind level1/level2/foo, and bind it back.
+ CosNaming::Name test_name (level2);
+ test_name.length (3);
+ test_name[2].id = obj_name[0].id;
+ CORBA::Object_var result_obj_ref =
+ root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ Test_Object_var result_object =
+ Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (result_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems with resolving foo in Tree Test - nil object ref.\n"),
+ -1);
+
+ CORBA::Short id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (id != CosNaming_Client::OBJ1_ID)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems with resolving foo in Tree Test - wrong id.\n"),
+ -1);
+
+ // Unbind the object from the Naming Context and bind it back
+ // in.
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (test_name,
+ obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create new context and rebind under the name level1/level2.
+ CosNaming::NamingContext_var new_level2_context;
+ new_level2_context =
+ root_context->new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->rebind_context (level2,
+ new_level2_context.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind, resolve, rebind, and resolve foo under level1/level2.
+ root_context->bind (test_name,
+ obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_obj_ref = root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_object = Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Short obj_id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (result_object.in ())
+ || !(obj_id == CosNaming_Client::OBJ1_ID))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems in the Tree Test\n"),
+ -1);
+
+ My_Test_Object *impl2 =
+ new My_Test_Object (CosNaming_Client::OBJ2_ID);
+ Test_Object_var obj2 = impl2->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ impl2->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_context->rebind (test_name,
+ obj2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_obj_ref = root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_object = Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj_id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (result_object.in ())
+ || !( obj_id == CosNaming_Client::OBJ2_ID))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems with rebind in Tree Test\n"),
+ -1);
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Tree test");
+ return -1;
+ }
+
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "All functions work properly \n"));
+ return 0;
+}
+
+int
+Exceptions_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Set things up.
+
+ // Create a tree of contexts root->level1->level2.
+ CosNaming::Name context_name;
+ context_name.length (1);
+ context_name[0].id = CORBA::string_dup ("level1_context");
+ CosNaming::NamingContext_var level1_context;
+ level1_context = root_context->bind_new_context (context_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ context_name[0].id = CORBA::string_dup ("level2_context");
+ CosNaming::NamingContext_var level2_context;
+ level2_context = level1_context->bind_new_context (context_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind a dummy object foo under each context.
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name object_name;
+ object_name.length (1);
+ object_name[0].id = CORBA::string_dup ("foo");
+ root_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ level1_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ level2_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run exceptions tests.
+ invalid_name_test (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ already_bound_test (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ already_bound_test2 (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ not_found_test (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ not_found_test2 (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ not_found_test3 (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Exceptions test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+Exceptions_Test::invalid_name_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (0);
+
+ root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Invalid name test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::InvalidName, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "InvalidName exception works properly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Invalid name test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::already_bound_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("foo");
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_context->bind (test_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 1) test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "AlreadyBound exception (case 1) works properly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 1) test failed\n"));
+ ACE_RE_THROW;
+ }
+
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::already_bound_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (2);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("foo");
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_context->bind (test_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 2) test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "AlreadyBound exception (case 2) works properly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 2) test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::not_found_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (3);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("level2_context");
+ test_name[2].id = CORBA::string_dup ("bar");
+
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Not found test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ if (ex.why == CosNaming::NamingContext::missing_node &&
+ ex.rest_of_name.length () == 1
+ && ACE_OS::strcmp (ex.rest_of_name[0].id.in (),
+ "bar") == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 1) works properly\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 1)"
+ " - parameters aren't set correctly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Not found test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::not_found_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (3);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("level3_context");
+ test_name[2].id = CORBA::string_dup ("foo");
+
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Unbind test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ if (ex.why == CosNaming::NamingContext::missing_node
+ && ex.rest_of_name.length () == 2
+ && ACE_OS::strcmp (ex.rest_of_name[0].id.in (),
+ "level3_context") == 0
+ && ACE_OS::strcmp (ex.rest_of_name[1].id.in (),
+ "foo") == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 2) works properly\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 2)"
+ " - parameters aren't set correctly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Unbind test failed\n"));
+ ACE_RE_THROW;
+ }
+
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::not_found_test3 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (3);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("foo");
+ test_name[2].id = CORBA::string_dup ("foo");
+
+ root_context->unbind (test_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Not found (case 3) test failed - no exception was thrown\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ if (ex.why == CosNaming::NamingContext::not_context
+ && ex.rest_of_name.length () == 2
+ && ACE_OS::strcmp (ex.rest_of_name[0].id.in (),
+ "foo") == 0
+ && ACE_OS::strcmp (ex.rest_of_name[1].id.in (),
+ "foo") == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 3) works properly\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 3)"
+ " - parameters aren't set correctly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Not found (case 3) test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+int
+Iterator_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Instantiate four dummy objects.
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind objects to the naming context.
+ CosNaming::Name name1;
+ name1.length (1);
+ name1[0].id = CORBA::string_dup ("foo1");
+ CosNaming::Name name2;
+ name2.length (1);
+ name2[0].id = CORBA::string_dup ("foo2");
+ CosNaming::Name name3;
+ name3.length (1);
+ name3[0].id = CORBA::string_dup ("foo3");
+ CosNaming::Name name4;
+ name4.length (1);
+ name4[0].id = CORBA::string_dup ("foo4");
+ root_context->bind (name1,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (name2,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (name3,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (name4,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // List the content of the Naming Context.
+ CosNaming::BindingIterator_var iter;
+ CosNaming::BindingList_var bindings_list;
+ root_context->list (1,
+ bindings_list.out (),
+ iter.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (iter.in ())
+ || bindings_list->length () != 1
+ || bindings_list[0u].binding_type != CosNaming::nobject)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::list does not function properly\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "First binding: %s\n",
+ bindings_list[0u].binding_name[0u].id.in ()));
+
+ // Invoke operations on the iterator.
+ CosNaming::Binding_var binding;
+ iter->next_one (binding.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (binding->binding_type != CosNaming::nobject)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::next_one does not function properly\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Second binding: %s\n",
+ binding->binding_name[0].id.in ()));
+
+ iter->next_n (2, bindings_list.out () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (bindings_list->length () != 2
+ || bindings_list[0u].binding_type != CosNaming::nobject
+ || bindings_list[1u].binding_type != CosNaming::nobject)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::BindingIterator does not function properly\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Third binding: %s\n"
+ "Fourth binding: %s\n",
+ bindings_list[0u].binding_name[0].id.in (),
+ bindings_list[1u].binding_name[0].id.in ()));
+
+ // We already iterated over all the bindings, so the following
+ // should return false.
+ CORBA::Boolean result = iter->next_one (binding.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (result)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::BindingIterator does not function properly\n"),
+ -1);
+ iter->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Iterator test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Destroy_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a context and bind an object under it.
+
+ CosNaming::NamingContext_var my_context;
+ my_context = root_context->new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind a dummy object foo under my_context.
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name object_name;
+ object_name.length (1);
+ object_name[0].id = CORBA::string_dup ("foo");
+ my_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Do the testing.
+ not_empty_test (my_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ my_context->unbind (object_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ my_context->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ not_exist_test (my_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Destroy test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+Destroy_Test::not_empty_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ ref->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCH (CosNaming::NamingContext::NotEmpty, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "NotEmpty exception works properly\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Destroy_Test::not_exist_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ ref->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Destroy works properly\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+Persistent_Test_Begin::Persistent_Test_Begin (CORBA::ORB_ptr orb,
+ FILE * ior_output_file)
+ : orb_ (orb),
+ file_ (ior_output_file)
+{
+}
+
+Persistent_Test_Begin::~Persistent_Test_Begin (void)
+{
+}
+
+int
+Persistent_Test_Begin::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a name structure we will reuse.
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("level1");
+
+ // Create and bind a naming context under the <root> context.
+ CosNaming::NamingContext_var level1_context =
+ root_context->bind_new_context (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create and bind a naming context under <level1> context.
+ test_name[0].id = CORBA::string_dup ("level2");
+ CosNaming::NamingContext_var level2_context =
+ level1_context->bind_new_context (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Log the ior of <level1_context> for use by <Persistent_Test_End>.
+ CORBA::String_var ior =
+ orb_->object_to_string (level1_context.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_OS::fprintf (this->file_,
+ "%s",
+ ior.in ());
+ ACE_OS::fclose (this->file_);
+
+ ACE_DEBUG ((LM_DEBUG, "Persistent Naming test (part 1) OK.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception in Persistent Test (part 1)");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+Persistent_Test_End::Persistent_Test_End (CORBA::ORB_ptr orb,
+ const char *ior)
+ : orb_ (orb),
+ ior_ (ior)
+{
+}
+
+Persistent_Test_End::~Persistent_Test_End (void)
+{
+}
+
+int
+Persistent_Test_End::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a name structure we will reuse.
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("level2");
+
+ // Convert stringified ior we got from <Persistent_Test_Begin>
+ // for <level1> Naming Context to Naming Context reference.
+ CORBA::Object_var obj =
+ orb_->string_to_object (ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var level1_context =
+ CosNaming::NamingContext::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (level1_context.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot narrow object to Naming Context\n"),
+ -1);
+
+ // Resolve for <level2> context through the persistent ior we
+ // got from part 1 of this test.
+ obj = level1_context->resolve (test_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Now, resolve for <level2> context using the <root> context
+ // reference which we obtained through <resolve_initial_references>.
+ test_name.length (2);
+ test_name[0].id = CORBA::string_dup ("level1");
+ test_name[1].id = CORBA::string_dup ("level2");
+ CORBA::Object_var obj2 =
+ root_context->resolve (test_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Make sure we got the same answer through both methods.
+ if (obj2->_is_equivalent (obj.in ()))
+ ACE_DEBUG ((LM_DEBUG, "Persistent Naming test (part 2) OK.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception in Persistent Test (part 2)");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+// This function runs the test.
+
+int
+main (int argc, char **argv)
+{
+ CosNaming_Client cosnaming_client;
+
+ if (cosnaming_client.init (argc, argv) == -1)
+ return 1;
+
+ return cosnaming_client.run ();
+}
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.h b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.h
new file mode 100644
index 00000000000..e8fe27385c1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/client.h
@@ -0,0 +1,335 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests
+//
+// = FILENAME
+// client.h
+//
+// = DESCRIPTION
+// This class tests the facilities to connect to the naming service.
+//
+// = AUTHORS
+// Marina Spivak <marina@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "test_objectS.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "ace/Task.h"
+
+class Naming_Test
+{
+ // = TITLE
+ // This is an abstract class which is subclassed
+ // to create different Naming Service tests.
+ //
+ // = DESCRIPTION
+ // This is a basic example of the "Strategy" pattern. This class
+ // provides a common interface for different tests (or
+ // "strategies"), so that a specific test to be used can be
+ // chosen at runtime.
+
+public:
+ virtual ~Naming_Test (void) {}
+ virtual int execute (TAO_Naming_Client &root_context) = 0;
+ // Execute the test code. <root_context> is the context to assume
+ // as the root for all tests operations.
+};
+
+class Simple_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a simple Naming Service test.
+ //
+ // = DESCRIPTION
+ // The test binds(), resolves(), and unbinds() an object
+ // reference from the given Naming Context.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the simple test code.
+};
+
+class MT_Test : public Naming_Test, public ACE_Task_Base
+{
+ // = TITLE
+ // This class implements a simple Multithreaded (multiclient) Naming Service test.
+ //
+ // = DESCRIPTION
+ // The test spawns multiple threads: each attempts to
+ // bind(), resolve(), and unbind() an object
+ // reference using the same name, and the same Naming Context.
+public:
+ // = Initialization and termination methods.
+
+ MT_Test (CORBA::ORB_ptr orb,
+ int size = 10);
+ // Constructor. Takes in an orb pointer and number of threads to spawn.
+
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the MT test code.
+
+ virtual int svc (void);
+ // This code is executed by each thread.
+
+private:
+ int size_;
+ // Number of threads to spawn. By default is set to 10.
+
+ CORBA::ORB_var orb_;
+ // A pointer to our ORB.
+
+ char* name_service_ior_;
+ // IOR in the string format for Naming Service we are to deal with.
+ // Each thread will use string_to_object() and this IOR to create
+ // its own NamingContext stub for invoking operations on the
+ // Naming Service. If all threads try to use the same stub, bad things
+ // happen...
+
+ // This can be replaced with CORBA::String_var when <string_to_object>
+ // is fixed - this will clean up the memory properly.
+
+ CosNaming::Name test_name_;
+ // Holds name used for registering the object with Naming Service.
+
+ Test_Object_var test_ref_;
+ // Holds object to be registered with the Naming Service by each thread.
+
+};
+
+class Tree_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of all Naming Service functions
+ // on a tree of Naming Contexts.
+ //
+ // = DESCRIPTION
+ // Bind_context() under the root context with the name level1.
+ // Create_new_context(), bind() foo object into it, and
+ // bind the context into root/level1 under the name level2.
+ // Resolve (root/level1/level2/foo).
+ // Unbind (root/level1/level2/foo).
+ // Bind (root/level1/level2/foo, obj)
+ // Create_new_context()
+ // and invoke rebind_context() to substitute it for the current
+ // level2 context.
+ // Bind (root/level1/level2/foo, obj)
+ // Resolve (root/level1/level2/foo).
+ // Rebind() to have a different object under the name bar.
+ // Resolve (root/level1/level2/foo) to make sure correct reference is returned.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the tree test code.
+};
+
+class Iterator_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of Naming Service functions
+ // which involve BindingIterator.
+ //
+ // = DESCRIPTION
+ // The test binds foo1, foo2, foo3, and foo4 objects to the
+ // Naming Context. It lists() one binding and receives
+ // BindingIterator to iterate over the rest of the bindings. It
+ // then invokes next_one(), next_n(2), next_one(), and destroy()
+ // on the iterator.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the iterator test code.
+};
+
+class Exceptions_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of exceptions in the Naming Service.
+ //
+ // = DESCRIPTION
+ // Makes sure that Naming Service throws exceptions as expected, and
+ // data inside exceptions is set correctly. The test creates a tree of
+ // of Naming Contexts: root context -> level1 -> level2. It then binds() an
+ // object with the name foo to each of Naming Contexts in the tree.
+ // Invoke resolve() with a Name of length 0 - make sure we get InvalidName exception.
+ // Invoke bind( foo, obj) on root context - make sure we get AlreadyBound exception.
+ // Invoke bind( level1/foo, obj) on root context - make sure we get AlreadyBound exc.
+ // Invoke unbind( level1/level2/bar) on root context - make sure we get NotFound exc.
+ // with why = not_object, rest_of_name = bar.
+ // Invoke unbind( level1/level3/foo) on root context - make sure we get NotFound exc.
+ // with why = missing_node, rest_of_name = level3/foo.
+ // Invoke unbind( level1/foo/foo) on root context - make sure we get NotFound exc.
+ // with why = not_context, rest_of_name = foo/foo.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the exceptions test code.
+
+private:
+ // the following functions isolate specific tests due to the
+ // limitation of only 1 TAO_TRY being allowed per function.
+
+ void invalid_name_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void already_bound_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void already_bound_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void not_found_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void not_found_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void not_found_test3 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+};
+
+class Destroy_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of destroy() function
+ // in the Naming Service.
+ //
+ // = DESCRIPTION
+ // Create a context and bind an object under it.
+ // Attempt to destroy the context - NotEmpty exception should be raised.
+ //
+ // Unbind the object and call destroy on the context.
+ // Attempt to call destroy on the object again - OBJECT_NOT_EXIST
+ // exception should be raised.
+ //
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the destroy test code.
+
+private:
+ // = The following functions isolate specific tests.
+ void not_empty_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL);
+ void not_exist_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL);
+};
+
+class Persistent_Test_Begin : public Naming_Test
+{
+ // = TITLE
+ // This class implements the first part of the Persistent Naming
+ // Service test.
+ //
+ // = DESCRIPTION
+ // This test creates the Naming Context hierarchy:
+ // root -> level1_context -> level2_context,
+ // and prints out the ior of the <level1_context>.
+public:
+ // = Initialization and termination methods.
+
+ Persistent_Test_Begin (CORBA::ORB_ptr orb,
+ FILE * ior_output_file);
+ // Constructor. Takes in an orb pointer.
+
+ virtual ~Persistent_Test_Begin (void);
+ // Destructor.
+
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the persistent test (part 1) code.
+
+private:
+
+ CORBA::ORB_var orb_;
+ // A pointer to our ORB (needed for object/string conversion).
+
+ FILE *file_;
+ // File where we output the ior for use by part 2 of persistent test.
+};
+
+class Persistent_Test_End : public Naming_Test
+{
+ // = TITLE
+ // This class implements the second part of the Persistent Naming
+ // Service test.
+ //
+ // = DESCRIPTION
+ // This test attempts to resolve <level2_context> both through the
+ // <root> Naming Context, which it gets from <resolve_initial_references>, and
+ // through <level1_context> stringified ior, which it gets from part 1 of
+ // the persistent test. The results of both methods are then
+ // compared for equality.
+public:
+ // = Initialization and termination methods.
+
+ Persistent_Test_End (CORBA::ORB_ptr orb,
+ const char * ior);
+ // Constructor. Takes in an orb pointer and the ior received from
+ // <Persistent_Test_Begin>.
+
+ virtual ~Persistent_Test_End (void);
+ // Destructor.
+
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the persistent test (part 2).
+
+private:
+
+ CORBA::ORB_var orb_;
+ // A pointer to our ORB (used for string/object conversion).
+
+ const char* ior_;
+ // IOR of <level1_context> recorded during the run of part 1 of
+ // persistent test.
+};
+
+class CosNaming_Client
+{
+ // = TITLE,
+ // Defines a class that encapsulates behaviour of the CosNaming
+ // client example. Provides a better understanding of the logic
+ // in an object-oriented way.
+ //
+ // = DESCRIPTION
+ // This class declares an interface to run the example client for
+ // CosNaming CORBA server. All the complexity for initializing
+ // the server is hidden in the class. Just the <run> interface
+ // is needed.
+public:
+ // = Initialization and termination methods.
+
+ CosNaming_Client (void);
+ // Constructor.
+
+ ~CosNaming_Client (void);
+ // Destructor.
+
+ int run (void);
+ // Execute client example code.
+
+ int init (int argc, char **argv);
+ // Initialize the client communication endpoint with server.
+
+ // = Symbolic ids.
+ enum OBJ_ID
+ {
+ OBJ1_ID = 5,
+ OBJ2_ID = 6
+ };
+
+private:
+ int parse_args (void);
+ // Parses the arguments passed on the command line.
+
+ int argc_;
+ // # of arguments on the command line.
+
+ char **argv_;
+ // arguments from command line.
+
+ Naming_Test *test_;
+ // A pointer to the specific Naming Service test a client will
+ // execute.
+
+ TAO_ORB_Manager orbmgr_;
+ // Our ORB manager helper class.
+
+ TAO_Naming_Client naming_client_;
+ // Our naming client helper class.
+};
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/corbaloc_ssliop.mpc b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/corbaloc_ssliop.mpc
new file mode 100644
index 00000000000..22d615b4010
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/corbaloc_ssliop.mpc
@@ -0,0 +1,9 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client) : namingexe, portableserver, utils {
+ Source_Files {
+ client.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey-client.pem b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey-client.pem
new file mode 100644
index 00000000000..cf53308cae2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey-client.pem
@@ -0,0 +1,16 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXwIBAAKBgQD3LcZOo8tF7BHEYMsm5pn3zYV+u6NhhvPC5G5bErY8qi8Xt4CZ
+PSQPm4JmVFvLsY2H6Eme8Oe7j4bCquRuB1D/U5auKdINQ1aG2CgKqPtBy1SliHE3
+FD1Ht43O+z2mRzGHtqLowhEvFEpEVHcJLUQ7HVHPJaRNQkn80DA/nN9+5wIDAQAB
+AoGBANpBJPWTU43uINIR1dAHlrRkWRfKfz1CeEMCiR8JqrhuXR7H/VlRz2Goor/Q
+hS2bHal/xmH9veCznv6M/x7Yfv74hhUJxyqngNxbwGI4G+LfR3/x1fqVcweDGmv6
+LYLL4JWyDLEL5I3PEZP/dUnT6+bmmuXWU5z83itqYw8VRbsBAkEA/MnqXFlWl1KF
+jTee5pijKOXGAvllrpN8MkTKM2MdjltzOkuhC1OEwhXYy86e90gRQvXAs3t7A4dT
+Q5/eUYHgYQJBAPpRnYcqqDP0Rj/JqMDapwIVjMoMDQP+thB4Ey6fSRC7dYiX4+Qo
+cyX8j0YnF0RYl426+Qv2O6egmOmzrQwQxEcCQQDAfUBocd7t+3iWv/PPxAr56X2O
+Zjp3ZPb9kEQoPSEUda6YhV5sMXy2Dcy35O5Hfikmw9uo0C4r0bAlnma7yhoBAkEA
+tI0/6ansDyVnskTbktdj1Q4EMgxFKxeC7RgfBebghdAg87hTKVO/0qt8EGbL0oFw
+N0ugrW8bEkq1YQQ3kldZqwJBAJPIe/NE+NhSOoSo3kEQ70SkjU5EB2sbVxhjq6ci
+UdXa+EOAna5JS5ZFMDq4AI+qU8OoSgI26hdH5S8lf10fIDo=
+-----END RSA PRIVATE KEY-----
+
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey.pem b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey.pem
new file mode 100644
index 00000000000..81ba8e3f968
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/pvtkey.pem
@@ -0,0 +1,10 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBOwIBAAJBAPXZ7YNyFU8T8PVitNwZmdwuc4tG64V/lDYHnmzolmFPQ6gvI2uo
+KBQeHeJFPI6LJ5TGb8hCnypy+zbc+pve8vECAwEAAQJAE/fmZbW/a1PYT2X8AKCH
+sa2ILvjMqmQpWpYV1QyzIiYQPEmQ/5GMUj/t3PZd/17BOH8aPakBT/c1Gp+os6vR
+zQIhAP2RDmm6UyMrJhAtAcNC5s8nbfhKPG80Q0DZ2kiodjQfAiEA+DXqwEZlCh0j
+VPzEXY7vrdQa641zQ5XIX1S/+WbCdu8CIDT9m4V86uLuoYW/4h5sXM/t7Y119itH
+QMbMwFFu40UBAiEA9z+mN6An2BpMbsVXyiavREYMBuahkgprTeM7VHHzdssCIQCY
+QEgmpzGzfdZoREy9B7ooNeRO919lR9qvbte9vvJvWQ==
+-----END RSA PRIVATE KEY-----
+
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/run_test.pl b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/run_test.pl
new file mode 100755
index 00000000000..a63768a2dc3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/run_test.pl
@@ -0,0 +1,161 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs some Naming Service tests.
+# It runs all the tests that will run with min CORBA.
+# It starts all the servers and clients as necessary.
+
+use lib '../../../../../bin';
+use PerlACE::Run_Test;
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+
+# The default host name.
+$TARGETHOSTNAME = "localhost";
+
+$quiet = 0;
+$use_ssl = 1;
+$debug_level = 0;
+
+while (my $argument = shift) {
+ if ($argument eq '-q') {
+ $quiet = 1;
+ next;
+ }
+ if ($argument eq '-d') {
+ $debug_level = shift;
+ next;
+ }
+ print STDERR "Unknown: $argument\nUsage $0 [-q] [-d n]\n";
+ exit(-1);
+}
+
+# Variables for command-line arguments to client and server
+# executables.
+$ns_multicast_port = 10001 + PerlACE::uniqueid (); # Can not be 10000 on Chorus 4.0
+$ns_orb_port = 12000 + PerlACE::uniqueid ();
+$ns_ssl_port = 14000 + PerlACE::uniqueid ();
+$iorfile = PerlACE::LocalFile ("ns.ior");
+$persistent_ior_file = PerlACE::LocalFile ("pns.ior");
+$persistent_log_file = PerlACE::LocalFile ("test_log");
+$data_file = PerlACE::LocalFile ("test_run.data");
+
+$status = 0;
+
+sub name_server
+{
+ my $args = "-ORBNameServicePort $ns_multicast_port -o $iorfile -m 1 @_";
+ my $prog = "../../../Naming_Service/Naming_Service";
+ $NS = new PerlACE::Process ($prog, $args);
+
+ unlink $iorfile;
+
+ print STDERR "CommandLine: server " . $NS->Arguments() . "\n\n" unless $quiet;
+ $NS->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($iorfile, $sleeptime) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
+ $NS->Kill ();
+ exit 1;
+ }
+}
+
+sub client
+{
+ my $args = "@_"." ";
+ my $prog = "client";
+
+ $CL = new PerlACE::Process ($prog, $args);
+
+ print STDERR "CommandLine: client " . $CL->Arguments() . "\n\n" unless $quiet;
+ $client = $CL->SpawnWaitKill (60);
+
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
+}
+
+## The options below have been reordered due to a
+## initialization problem (within the Naming_Service)
+## that has only been seen on Windows XP.
+
+$orb_debug_level = ($quiet || $debug_level == 0) ? "" : "-ORBDebugLevel $debug_level";
+
+# Options for all simple tests recognized by the 'client' program.
+@opts = (
+ "-s -ORBInitRef NameService=corbaloc:ssliop:$TARGETHOSTNAME:$ns_ssl_port/NameService"
+ . " -ORBSvcConf client.conf $orb_debug_level",
+ "-t -ORBInitRef NameService=corbaloc:ssliop:$TARGETHOSTNAME:$ns_ssl_port/NameService"
+ . " -ORBSvcConf client.conf $orb_debug_level",
+ "-i -ORBInitRef NameService=corbaloc:ssliop:$TARGETHOSTNAME:$ns_ssl_port/NameService"
+ . " -ORBSvcConf client.conf $orb_debug_level",
+ "-e -ORBInitRef NameService=corbaloc:ssliop:$TARGETHOSTNAME:$ns_ssl_port/NameService"
+ . " -ORBSvcConf client.conf $orb_debug_level",
+ "-y -ORBInitRef NameService=corbaloc:ssliop:$TARGETHOSTNAME:$ns_ssl_port/NameService"
+ . " -ORBSvcConf client.conf $orb_debug_level",
+
+ );
+
+@server_opts = (
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port/ssl_port=$ns_ssl_port"
+ . " -ORBSvcConf server.conf $orb_debug_level",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port/ssl_port=$ns_ssl_port"
+ . " -ORBSvcConf server.conf $orb_debug_level",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port/ssl_port=$ns_ssl_port"
+ . " -ORBSvcConf server.conf $orb_debug_level",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port/ssl_port=$ns_ssl_port"
+ . " -ORBSvcConf server.conf $orb_debug_level",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port/ssl_port=$ns_ssl_port"
+ . " -ORBSvcConf server.conf $orb_debug_level",
+
+ );
+
+@comments = (
+ "(SSL) Simple Test:",
+ "(SSL) Tree Test:",
+ "(SSL) Iterator Test:",
+ "(SSL) Exceptions Test:",
+ "(SSL) Destroy Test:",
+ );
+
+$test_number = 0;
+
+unlink ($persistent_ior_file, $persistent_log_file);
+
+# Run server and client for each of the tests. Client uses ior in a
+# file to bootstrap to the server.
+foreach $o (@opts) {
+
+ print STDERR "\n " . $comments[$test_number];
+ if ($use_ssl == 0 && $comments[$test_number] =~ /SSL/) {
+ print STDERR " - Skipping, use -s to run the SSL tests";
+ next;
+ }
+
+ print STDERR "\n";
+ name_server ($server_opts[$test_number]);
+ client ($o);
+
+ $NS->Kill ();
+
+ ## For some reason, only on Windows XP, we need to
+ ## wait before starting another Naming_Service when
+ ## the mmap persistence option is used
+ if ($^O eq "MSWin32") {
+ sleep(1);
+ }
+
+ $test_number++;
+}
+
+unlink ($persistent_ior_file, $persistent_log_file);
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert-client.pem b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert-client.pem
new file mode 100644
index 00000000000..dc0a69d76e6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert-client.pem
@@ -0,0 +1,24 @@
+-----BEGIN CERTIFICATE-----
+MIID3zCCA0igAwIBAgIBADANBgkqhkiG9w0BAQUFADCBrDELMAkGA1UEBhMCVVMx
+ETAPBgNVBAgTCE1pc3NvdXJpMRMwEQYDVQQHEwpDcmV2ZSBDb3JlMR4wHAYDVQQK
+ExVPYmplY3QgQ29tcHV0aW5nIEluYy4xETAPBgNVBAsTCFRBTyBUZWFtMRswGQYD
+VQQDExJvY2kxMTc5Lm9jaXdlYi5jb20xJTAjBgkqhkiG9w0BCQEWFmplbGlhemtv
+dl9pQG9jaXdlYi5jb20wHhcNMDQwOTEwMTY0MjMwWhcNMDUwOTEwMTY0MjMxWjCB
+rDELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE1pc3NvdXJpMRMwEQYDVQQHEwpDcmV2
+ZSBDb3JlMR4wHAYDVQQKExVPYmplY3QgQ29tcHV0aW5nIEluYy4xETAPBgNVBAsT
+CFRBTyBUZWFtMRswGQYDVQQDExJvY2kxMTc5Lm9jaXdlYi5jb20xJTAjBgkqhkiG
+9w0BCQEWFmplbGlhemtvdl9pQG9jaXdlYi5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBAPctxk6jy0XsEcRgyybmmffNhX67o2GG88LkblsStjyqLxe3gJk9
+JA+bgmZUW8uxjYfoSZ7w57uPhsKq5G4HUP9Tlq4p0g1DVobYKAqo+0HLVKWIcTcU
+PUe3jc77PaZHMYe2oujCES8USkRUdwktRDsdUc8lpE1CSfzQMD+c337nAgMBAAGj
+ggENMIIBCTAdBgNVHQ4EFgQUgtnhUdIQh1ESq81PL+urdJj1LRkwgdkGA1UdIwSB
+0TCBzoAUgtnhUdIQh1ESq81PL+urdJj1LRmhgbKkga8wgawxCzAJBgNVBAYTAlVT
+MREwDwYDVQQIEwhNaXNzb3VyaTETMBEGA1UEBxMKQ3JldmUgQ29yZTEeMBwGA1UE
+ChMVT2JqZWN0IENvbXB1dGluZyBJbmMuMREwDwYDVQQLEwhUQU8gVGVhbTEbMBkG
+A1UEAxMSb2NpMTE3OS5vY2l3ZWIuY29tMSUwIwYJKoZIhvcNAQkBFhZqZWxpYXpr
+b3ZfaUBvY2l3ZWIuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
+gYEAVZSDOJ40+iAJPb1GZWmmh5y5Y1DVXsQF5vRENYq15Pi5Y9GBhHaYFn3qjN2U
++zyO2Cp2IJJG4HNazhBoDEj7EhDsxEyOYZiG2pd6BLe1dPl/viy6ysvdijjpcXw7
+bFPbXpCIa5rg8VKQsGYscWerLxvi79uoo+p6DrOU1FxDcYo=
+-----END CERTIFICATE-----
+
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert.pem b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert.pem
new file mode 100644
index 00000000000..e616730ca63
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/selfsigncert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICeDCCAiKgAwIBAgIBADANBgkqhkiG9w0BAQQFADBjMQswCQYDVQQGEwJVUzEL
+MAkGA1UECBMCTU8xDDAKBgNVBAcTA1NUTDELMAkGA1UEChMCV1UxDDAKBgNVBAsT
+A0RPQzELMAkGA1UEAxMCS0ExETAPBgkqhkiG9w0BCQEWAktBMB4XDTAxMDgyNzE2
+NTUxMVoXDTAxMDkyNjE2NTUxMVowYzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1P
+MQwwCgYDVQQHEwNTVEwxCzAJBgNVBAoTAldVMQwwCgYDVQQLEwNET0MxCzAJBgNV
+BAMTAktBMREwDwYJKoZIhvcNAQkBFgJLQTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC
+QQD12e2DchVPE/D1YrTcGZncLnOLRuuFf5Q2B55s6JZhT0OoLyNrqCgUHh3iRTyO
+iyeUxm/IQp8qcvs23Pqb3vLxAgMBAAGjgcAwgb0wHQYDVR0OBBYEFL8LnC8csuIX
++TUw6FCoReB27PHoMIGNBgNVHSMEgYUwgYKAFL8LnC8csuIX+TUw6FCoReB27PHo
+oWekZTBjMQswCQYDVQQGEwJVUzELMAkGA1UECBMCTU8xDDAKBgNVBAcTA1NUTDEL
+MAkGA1UEChMCV1UxDDAKBgNVBAsTA0RPQzELMAkGA1UEAxMCS0ExETAPBgkqhkiG
+9w0BCQEWAktBggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADQQAZP9CT
+TVRxAz3Acxxxn32rsnwSeNJr1uTA4hew7f4QZ187oZia+rcFLOILrwgCmtqEmWVj
+dj6COUrqKo60BI5V
+-----END CERTIFICATE-----
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf
new file mode 100644
index 00000000000..672a471014d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf
@@ -0,0 +1,6 @@
+dynamic SSLIOP_Factory Service_Object *
+ TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory()
+ "-SSLPrivateKey PEM:pvtkey.pem -SSLCertificate PEM:selfsigncert.pem"
+static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+
+
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf.xml b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf.xml
new file mode 100644
index 00000000000..5aa645eb3bf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/server.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from server.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <dynamic id="SSLIOP_Factory" type="Service_Object">
+ <initializer path="TAO_SSLIOP" init="_make_TAO_SSLIOP_Protocol_Factory" params="-SSLPrivateKey PEM:pvtkey.pem -SSLCertificate PEM:selfsigncert.pem"/>
+ </dynamic>
+ <static id="Resource_Factory" params="-ORBProtocolFactory SSLIOP_Factory"/>
+</ACE_Svc_Conf>
diff --git a/TAO/orbsvcs/tests/Security/ssliop_corbaloc/test_object.idl b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/test_object.idl
new file mode 100644
index 00000000000..4737f6dc6c8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Security/ssliop_corbaloc/test_object.idl
@@ -0,0 +1,11 @@
+// $Id$
+
+interface Test_Object
+{
+ // = TITLE
+ // This is a simple interface that tests the Naming Service.
+
+ attribute short id;
+ // This provides an easy way to differentiate objects if each
+ // objects is served by a separate servant.
+};
diff --git a/TAO/orbsvcs/tests/Simple_Naming/Makefile.am b/TAO/orbsvcs/tests/Simple_Naming/Makefile.am
new file mode 100644
index 00000000000..01c8adb2ce2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/Makefile.am
@@ -0,0 +1,88 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Simple_Naming_Client.am
+
+BUILT_SOURCES = \
+ test_objectC.cpp \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.cpp \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.cpp \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+CLEANFILES = \
+ test_object-stamp \
+ test_objectC.cpp \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.cpp \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.cpp \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+test_objectC.cpp test_objectC.h test_objectC.inl test_objectS.cpp test_objectS.h test_objectS.inl test_objectS_T.cpp test_objectS_T.h test_objectS_T.inl: test_object-stamp
+
+test_object-stamp: $(srcdir)/test_object.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT $(srcdir)/test_object.idl
+ @touch $@
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp \
+ test_objectC.cpp \
+ test_objectS.cpp \
+ client.h \
+ test_objectC.h \
+ test_objectC.inl \
+ test_objectS.h \
+ test_objectS.inl \
+ test_objectS_T.h \
+ test_objectS_T.inl
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Simple_Naming/README b/TAO/orbsvcs/tests/Simple_Naming/README
new file mode 100644
index 00000000000..5e8c01ad0d3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/README
@@ -0,0 +1,262 @@
+// $Id$
+
+This application tests different features of TAO's Naming Service.
+
+To run all tests automatically -
+ execute Perl script run_test.pl
+
+To run tests manually -
+ start the Naming Service (see
+ TAO/orbsvcs/Naming_Service/README for valid options),
+ then run ./client with one of the options below.
+
+NOTE: if running tests manually, Naming Service has to be restarted
+before each test (this is due to some tests not 'cleaning up' bindings
+after themselves).
+
+The following options exist:
+---------------------------
+-s Run the Simple test of the Naming Service.
+
+-t Run the Tree test of the Naming Service.
+
+-e Run the Exceptions test of the Naming Service
+
+-i Run the Iterator test of the Naming Service.
+
+-y Run the Destroy test of the Naming Service.
+
+-m <n> Run the Multi-Threaded test of the Naming Service (multiple
+ client threads). Requires integer argument specifying number
+ of thread to spawn. (If running this test manually, its
+ output should be redirected to some file, say, "foo". Then,
+ "process-m-output.pl" script can be used to analyze the test
+ output and print out a diagnostic message. Invoke the output
+ processing script like so:
+ "process-m-output.pl foo number_of_threads",
+ where <foo> is the name of the file containing test output,
+ and <number_of_threads> is the argument that was supplied with
+ "-m" option to the client.)
+
+ Example (on a Unix system):
+ $ ../../Naming_Service &
+ $ ./client -m 10 >& foo
+ $ ./process-m-output.pl foo 10
+
+ where the steps correspond to 1)starting the Naming Service,
+ 2) running the client and redirecting the output to a file,
+ and 3) running the diagnostic script.
+ Don't forget to kill the Naming Service after you are done.
+
+Persistent test consists of two parts (below).
+
+-p <file_name>
+ Run the Persistent Naming Service test, part 1. Requires an
+ argument specifying the name of the file in which to store an ior for
+ use by Persistent Naming Service test, part 2. Note, in order
+ to test out persistent capabilities of the Naming Service, the
+ Naming Service must be started with -f and -ORBendpoint options.
+ The values for these options must be the same for both runs of
+ the Naming Service (i.e., for part 1 and part 2 of persistent test).
+
+-c <ior>
+ Run the Persistent Naming Service test, part 2. Requires an
+ argument specifying the ior, which was produced in part 1 of
+ the test. Note, in order to test out persistent capabilities
+ of the Naming Service, the Naming Service must be started with
+ -f and -ORBendpoint options. The values for these options
+ must remain the same for both runs of the Naming Service (i.e.,
+ for part 1 and part 2 of persistent test).
+
+ Example of testing persistence on a Unix system:
+ $ ../../Naming_Service -f log -ORBendpoint iiop://localhost:20000
+ $ ./client -p ior_file
+ kill the Naming_Service process
+ $ ../../Naming_Service -f log -ORBendpoint iiop://localhost:20000
+ $ ./client -c file://ior_file
+
+ where the steps correspond to 1)starting the Naming Service on
+ port 20000 in persistent mode, with persistent state being
+ stored in file called "log", 2) running the first part of the
+ client persistent naming test, and sending its data to file
+ called "ior_file", 3) killing the Naming Service process, 4)
+ restarting the Naming Service on the same port with the same
+ persistent state storage file, and 5) running the second part
+ of the client persistence test by specifying the ior from part
+ 1 in the file format.
+
+ We kill the Naming Service process between 2 client runs to
+ make sure it can recreate its state from persistent storage.
+ It is necessary to restart the Naming Service on the same
+ host/port in order for the persistent IORs from the first
+ run to be valid for the second run.
+
+If no option is specified, Simple test is run. If more than one
+option is specified, only one test runs.
+
+
+DESCRIPTION AND EXPECTED OUTPUT FOR EACH TEST
+*******************************************
+
+Simple Test.
+
+Performs bind (), resolve (), and unbind () of an object reference in
+the root context.
+
+Expected Output:
+
+Bound name OK
+Resolved name OK
+Unbound name OK
+
+********************************************
+
+MT Test.
+
+Spawns a specified number of threads. Threads concurrently attempt to
+bind (), resolve (), and unbind () the object reference.
+
+Expected Output (produced by the output processing script):
+
+Multithreaded output is ok
+
+The output of the actual test varies from run to run, due to the
+variation in the thread scheduling. Correct output must have the
+following properties (these are the properties that the processing
+script checks for):
+1) number of bind () calls = number of resolve () calls = number of
+unbind () calls = number of threads specified for the test
+2) number of successful bind () calls = number of successful unbind () calls.
+
+*******************************************
+
+Tree Test.
+
+Checks all Naming Service functions with a tree of Naming Contexts.
+
+root->bind_new_context (level1)
+
+new = root->new_context (), new->bind (foo, obj), and
+ root->bind_context (level1/level2, new)
+
+We now have root->level1->level2->foo
+
+root->resolve (level1/level2/foo).
+root->unbind (level1/level2/foo).
+root->bind (level1/level2/foo, obj).
+
+new = root->new_context()
+root->rebind_context(level1/level2, new)
+
+root->bind (level1/level2/foo obj)
+root->resolve (level1/level2/foo)
+root->rebind (level1/level2/foo, obj2) to have a different object under the name bar.
+root->resolve (level1/level2/foo) to make sure correct reference is returned.
+
+
+Expected Output:
+
+All funtions work properly
+********************************************
+
+Exceptions Test.
+
+Makes sure that Naming Service throws exceptions as expected, and data
+inside exceptions is set correctly.
+
+Create a tree of Naming Contexts: root context -> level1 -> level2.
+
+Bind an object with the name foo into each of the Naming Contexts.
+
+root->resolve () (with a Name of length 0) - should get InvalidName exception.
+root->bind (foo, obj) - should get AlreadyBound exception.
+root->bind (level1/foo, obj) - should get AlreadyBound exception.
+root->unbind (level1/level2/bar) - should get NotFound exception
+ with why = missing_node, rest_of_name = bar.
+root->unbind (level1/level3/foo) - should get NotFound exception
+ with why = missing_node, rest_of_name = level3/foo.
+root->unbind (level1/foo/foo) -should get NotFound exception
+ with why = not_context, rest_of_name = foo/foo.
+
+
+Expected Output:
+
+AlreadyBound exception (case 1) works properly
+AlreadyBound exception (case 2) works properly
+NotFound exception (case 1) works properly
+NotFound exception (case 2) works properly
+NotFound exception (case 3) works properly
+
+*********************************************
+
+Iterator Test.
+
+Checks iterator functions.
+
+Bind () objects with the following names foo1, foo2, foo3, and foo4
+into the root Naming Context.
+
+root->lists (1, bl, iter)
+iter->next_one ()
+iter->next_n (2, bl)
+iter->next_one () - should return false
+iter->destroy ()
+
+
+Expected Output:
+
+First binding: foo1
+Second binding: foo2
+Third binding: foo3
+Fourth binding: foo4
+
+*********************************************
+
+Destroy Test.
+
+Makes sure destroy method is working properly.
+
+Create a context and bind an object under it.
+Attempt to destroy the context - NotEmpty exception should be raised.
+
+Unbind the object and call destroy on the context.
+Attempt to call destroy on the object again - OBJECT_NOT_EXIST
+exception should be raised.
+
+
+Expected Output:
+
+NotEmpty exception works properly
+Destroy works properly
+
+********************************************
+
+Persistent Test (part 1).
+
+Makes sure persistence mode of the Naming Service functions properly:
+this test sets things up for part 2
+
+Creates the Naming Context hierarchy:
+root -> level1_context -> level2_context,
+and prints out the ior of the <level1_context> to the specified file.
+
+
+Expected Output:
+
+Persistent Naming test (part 1) OK.
+
+********************************************
+Persistent Test (part 2).
+
+Makes sure persistence mode of the Naming Service functions properly.
+
+Attempts to resolve <level2_context> both through the ior obtained
+from part 1 of the test, and through the Naming Context obtained from
+<resolve_initial_references>. Compares the results of both resolve ()
+calls.
+
+Expected Output:
+
+Persistent Naming test (part 2) OK.
+
+********************************************
diff --git a/TAO/orbsvcs/tests/Simple_Naming/Simple_Naming.mpc b/TAO/orbsvcs/tests/Simple_Naming/Simple_Naming.mpc
new file mode 100644
index 00000000000..0a4a4f0b63a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/Simple_Naming.mpc
@@ -0,0 +1,9 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Client) : namingexe, utils, portableserver {
+ Source_Files {
+ client.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Simple_Naming/client.cpp b/TAO/orbsvcs/tests/Simple_Naming/client.cpp
new file mode 100644
index 00000000000..904a68a489b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/client.cpp
@@ -0,0 +1,1279 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/Naming_Service/
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// This class implements a simple CORBA client for the CosNaming
+// example using stubs generated by the TAO ORB IDL compiler.
+//
+// = AUTHORS
+// Sergio Flores-Gaitan <sergio@cs.wustl.edu>,
+// Marina Spivak <marina@cs.wustl.edu>, and
+// Douglas C. Schmidt <schmidt@cs.wustl.edu>
+// ============================================================================
+
+#include "client.h"
+#include "tao/debug.h"
+#include "ace/Get_Opt.h"
+
+ACE_RCSID(Simple_Naming, client, "$Id$")
+
+#if defined (_MSC_VER)
+# pragma warning (disable : 4250)
+#endif /* _MSC_VER */
+
+class My_Test_Object :
+ public virtual POA_Test_Object
+{
+public:
+ // = Initialization and termination methods.
+ My_Test_Object (CORBA::Short id = 0);
+ // Constructor.
+
+ ~My_Test_Object (void);
+ // Destructor.
+
+ // = Interface implementation accessor methods.
+
+ void id (CORBA::Short id ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Sets id.
+
+ CORBA::Short id (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Gets id.
+
+private:
+ short id_;
+};
+
+My_Test_Object::My_Test_Object (CORBA::Short id)
+ : id_ (id)
+{
+}
+
+My_Test_Object::~My_Test_Object (void)
+{
+}
+
+CORBA::Short
+My_Test_Object::id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return id_;
+}
+
+void
+My_Test_Object::id (CORBA::Short id ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ id_ = id;
+}
+
+// Constructor.
+
+CosNaming_Client::CosNaming_Client (void)
+ : argc_ (0),
+ argv_ (0),
+ test_ (0)
+{
+}
+
+// Parses the command line arguments and returns an error status.
+
+int
+CosNaming_Client::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "p:dstieym:c:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case 's':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Simple_Test,
+ -1);
+ break;
+ case 'm':
+ if (this->test_ == 0)
+ {
+ int size = ACE_OS::atoi (get_opts.opt_arg ());
+ if (size <= 0)
+ size = 10;
+
+ ACE_NEW_RETURN (this->test_,
+ MT_Test (this->orbmgr_.orb (), size),
+ -1);
+ }
+
+ break;
+ case 't':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Tree_Test,
+ -1);
+ break;
+ case 'i':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Iterator_Test,
+ -1);
+ break;
+ case 'e':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Exceptions_Test,
+ -1);
+ break;
+ case 'y':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Destroy_Test,
+ -1);
+ break;
+ case 'p':
+ if (this->test_ == 0)
+ {
+ FILE * ior_output_file =
+ ACE_OS::fopen (get_opts.opt_arg (), "w");
+
+ if (ior_output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Unable to open %s for writing: %p\n",
+ get_opts.opt_arg ()), -1);
+
+ ACE_NEW_RETURN (this->test_,
+ Persistent_Test_Begin (this->orbmgr_.orb (),
+ ior_output_file),
+ -1);
+ }
+ break;
+ case 'c':
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Persistent_Test_End (this->orbmgr_.orb (),
+ get_opts.opt_arg ()),
+ -1);
+ break;
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Argument %c \n usage: %s"
+ " [-d]"
+ " [-s or -e or -t or -i or -y or -p or -c<ior> or -m<size>]"
+ "\n",
+ c,
+ this->argv_ [0]),
+ -1);
+ }
+
+ if (this->test_ == 0)
+ ACE_NEW_RETURN (this->test_,
+ Simple_Test,
+ -1);
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Execute client example code.
+
+int
+CosNaming_Client::run (void)
+{
+ return test_->execute (naming_client_);
+}
+
+CosNaming_Client::~CosNaming_Client (void)
+{
+ delete test_;
+}
+
+int
+CosNaming_Client::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Initialize ORB.
+ this->orbmgr_.init (this->argc_,
+ this->argv_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->orbmgr_.activate_poa_manager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse command line and verify parameters.
+ if (this->parse_args () == -1)
+ return -1;
+
+ CORBA::ORB_var orb = this->orbmgr_.orb ();
+ return this->naming_client_.init (orb.in ());
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "init");
+ // and return -1 below . . .
+ }
+ ACE_ENDTRY;
+
+ return -1;
+}
+
+MT_Test::MT_Test (CORBA::ORB_ptr orb,
+ int size)
+ :size_ (size),
+ orb_ (orb),
+ name_service_ior_ (0)
+{
+}
+
+int
+MT_Test::svc (void)
+{
+ // Obtain object reference to the Naming Service (create new stub.)
+
+ CosNaming::NamingContext_var name_service;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY_EX (SETUP)
+ {
+ CORBA::Object_var name_service_obj =
+ orb_->string_to_object (name_service_ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SETUP);
+
+ name_service =
+ CosNaming::NamingContext::_narrow (name_service_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (SETUP);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test setup");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ if (name_service.in () == 0)
+ return -1;
+
+ // Bind the object.
+ ACE_TRY_EX (BIND)
+ {
+ name_service->bind (test_name_,
+ test_ref_.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (BIND);
+ ACE_DEBUG ((LM_DEBUG,
+ "Bound name OK in thread %t\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unable to bind in thread %t\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test bind");
+ // This debug statement works around a IRIX/MIPSPro 7.3 bug (it
+ // fails with optimize=1 debug=0; but works with any other
+ // settings for those flags).
+ ACE_DEBUG ((LM_DEBUG, "MT_Test(%t) - bind[3] %d\n",
+ test_name_.length ()));
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Resolve the object from the Naming Context.
+ ACE_TRY_EX (RESOLVE)
+ {
+ CORBA::Object_var result_obj_ref =
+ name_service->resolve (test_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (RESOLVE);
+
+ Test_Object_var result_object =
+ Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (RESOLVE);
+
+ if (!CORBA::is_nil (result_object.in ()))
+ {
+ CORBA::Short id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (RESOLVE);
+
+ if (id == CosNaming_Client::OBJ1_ID)
+ ACE_DEBUG ((LM_DEBUG,
+ "Resolved name OK in thread %t\n"));
+ }
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unable to resolve in thread %t\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test resolve");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Unbind the object from the Naming Context.
+ ACE_TRY_EX (UNBIND)
+ {
+ name_service->unbind (test_name_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK_EX (UNBIND);
+ ACE_DEBUG ((LM_DEBUG,
+ "Unbound name OK in thread %t\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Unable to unbind in thread %t\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in MT test unbind");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+MT_Test::execute (TAO_Naming_Client &root_context)
+{
+ if (CORBA::is_nil (this->orb_.in ()))
+ return -1;
+
+ // Create data which will be used by all threads.
+
+ // Dummy object instantiation.
+ My_Test_Object *test_obj_impl =
+ new My_Test_Object (CosNaming_Client::OBJ1_ID);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ test_ref_ =
+ test_obj_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ test_obj_impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the IOR for the Naming Service. Each thread can use it
+ // in <string_to_object> to create its own stub for the Naming
+ // Service. This 'trick' is necessary, because multiple threads
+ // cannot be using the same stub - bad things happen... This is
+ // just a way to give each thread its own stub.
+
+ CosNaming::NamingContext_var context =
+ root_context.get_context ();
+
+ name_service_ior_ =
+ orb_->object_to_string (context.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception while instantiating dummy");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ // Create a name for dummy.
+ test_name_.length (1);
+ test_name_[0].id = CORBA::string_dup ("Foo");
+
+ // Spawn threads, each of which will be executing svc ().
+ int status = this->activate (THR_NEW_LWP | THR_JOINABLE,
+ size_);
+
+ if (status == -1)
+ return -1;
+
+ status = this->wait ();
+ return status;
+}
+
+int
+Simple_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Dummy object instantiation.
+ My_Test_Object *test_obj_impl = new My_Test_Object (CosNaming_Client::OBJ1_ID);
+ Test_Object_var test_obj_ref =
+ test_obj_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Give ownership of this object to POA.
+ test_obj_impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind an object to the Naming Context.
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("Foo");
+ root_context->bind (test_name,
+ test_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "Bound name OK\n"));
+
+ // Resolve the object from the Naming Context.
+ CORBA::Object_var result_obj_ref =
+ root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ Test_Object_var result_object =
+ Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (!CORBA::is_nil (result_object.in ()))
+ {
+ CORBA::Short id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (id == CosNaming_Client::OBJ1_ID)
+ ACE_DEBUG ((LM_DEBUG, "Resolved name OK\n"));
+ }
+
+ // Unbind the object from the Naming Context.
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG,
+ "Unbound name OK\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Simple test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Tree_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a tree of contexts: root->level1->level2. Bind object
+ // foo under context level2.
+
+ // Bind level1 context under root.
+ CosNaming::Name level1;
+ level1.length (1);
+ level1[0].id = CORBA::string_dup ("level1_context");
+ CosNaming::NamingContext_var level1_context;
+ level1_context = root_context->bind_new_context (level1
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create a new context.
+ CosNaming::NamingContext_var level2_context;
+ level2_context = root_context->new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Instantiate a dummy object and bind it under the new context.
+ My_Test_Object *impl1 =
+ new My_Test_Object (CosNaming_Client::OBJ1_ID);
+ Test_Object_var obj1 = impl1->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl1->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name obj_name;
+ obj_name.length (1);
+ obj_name[0].id = CORBA::string_dup ("foo");
+ level2_context->bind (obj_name, obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind the context we just created under level1.
+ CosNaming::Name level2 (level1);
+ level2.length (2);
+ level2[1].id = CORBA::string_dup ("level2_context");
+ root_context->bind_context (level2,
+ level2_context.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Resolve and unbind level1/level2/foo, and bind it back.
+ CosNaming::Name test_name (level2);
+ test_name.length (3);
+ test_name[2].id = obj_name[0].id;
+ CORBA::Object_var result_obj_ref =
+ root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ Test_Object_var result_object =
+ Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (result_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems with resolving foo in Tree Test - nil object ref.\n"),
+ -1);
+
+ CORBA::Short id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (id != CosNaming_Client::OBJ1_ID)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems with resolving foo in Tree Test - wrong id.\n"),
+ -1);
+
+ // Unbind the object from the Naming Context and bind it back
+ // in.
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (test_name,
+ obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create new context and rebind under the name level1/level2.
+ CosNaming::NamingContext_var new_level2_context;
+ new_level2_context =
+ root_context->new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->rebind_context (level2,
+ new_level2_context.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind, resolve, rebind, and resolve foo under level1/level2.
+ root_context->bind (test_name,
+ obj1.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_obj_ref = root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_object = Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Short obj_id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (result_object.in ())
+ || !(obj_id == CosNaming_Client::OBJ1_ID))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems in the Tree Test\n"),
+ -1);
+
+ My_Test_Object *impl2 =
+ new My_Test_Object (CosNaming_Client::OBJ2_ID);
+ Test_Object_var obj2 = impl2->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ impl2->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_context->rebind (test_name,
+ obj2.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_obj_ref = root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ result_object = Test_Object::_narrow (result_obj_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ obj_id = result_object->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (result_object.in ())
+ || !( obj_id == CosNaming_Client::OBJ2_ID))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Problems with rebind in Tree Test\n"),
+ -1);
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Tree test");
+ return -1;
+ }
+
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "All functions work properly \n"));
+ return 0;
+}
+
+int
+Exceptions_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Set things up.
+
+ // Create a tree of contexts root->level1->level2.
+ CosNaming::Name context_name;
+ context_name.length (1);
+ context_name[0].id = CORBA::string_dup ("level1_context");
+ CosNaming::NamingContext_var level1_context;
+ level1_context = root_context->bind_new_context (context_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ context_name[0].id = CORBA::string_dup ("level2_context");
+ CosNaming::NamingContext_var level2_context;
+ level2_context = level1_context->bind_new_context (context_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind a dummy object foo under each context.
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name object_name;
+ object_name.length (1);
+ object_name[0].id = CORBA::string_dup ("foo");
+ root_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ level1_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ level2_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run exceptions tests.
+ invalid_name_test (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ already_bound_test (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ already_bound_test2 (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ not_found_test (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ not_found_test2 (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ not_found_test3 (root_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Exceptions test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+Exceptions_Test::invalid_name_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (0);
+
+ root_context->resolve (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Invalid name test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::InvalidName, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "InvalidName exception works properly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Invalid name test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::already_bound_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("foo");
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_context->bind (test_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 1) test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "AlreadyBound exception (case 1) works properly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 1) test failed\n"));
+ ACE_RE_THROW;
+ }
+
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::already_bound_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (2);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("foo");
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ root_context->bind (test_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 2) test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "AlreadyBound exception (case 2) works properly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Already bound (case 2) test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::not_found_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (3);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("level2_context");
+ test_name[2].id = CORBA::string_dup ("bar");
+
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Not found test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ if (ex.why == CosNaming::NamingContext::missing_node &&
+ ex.rest_of_name.length () == 1
+ && ACE_OS::strcmp (ex.rest_of_name[0].id.in (),
+ "bar") == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 1) works properly\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 1)"
+ " - parameters aren't set correctly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Not found test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::not_found_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (3);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("level3_context");
+ test_name[2].id = CORBA::string_dup ("foo");
+
+ root_context->unbind (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Unbind test failed\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ if (ex.why == CosNaming::NamingContext::missing_node
+ && ex.rest_of_name.length () == 2
+ && ACE_OS::strcmp (ex.rest_of_name[0].id.in (),
+ "level3_context") == 0
+ && ACE_OS::strcmp (ex.rest_of_name[1].id.in (),
+ "foo") == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 2) works properly\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 2)"
+ " - parameters aren't set correctly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Unbind test failed\n"));
+ ACE_RE_THROW;
+ }
+
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Exceptions_Test::not_found_test3 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ CosNaming::Name test_name;
+ test_name.length (3);
+ test_name[0].id = CORBA::string_dup ("level1_context");
+ test_name[1].id = CORBA::string_dup ("foo");
+ test_name[2].id = CORBA::string_dup ("foo");
+
+ root_context->unbind (test_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "Not found (case 3) test failed - no exception was thrown\n"));
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ if (ex.why == CosNaming::NamingContext::not_context
+ && ex.rest_of_name.length () == 2
+ && ACE_OS::strcmp (ex.rest_of_name[0].id.in (),
+ "foo") == 0
+ && ACE_OS::strcmp (ex.rest_of_name[1].id.in (),
+ "foo") == 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 3) works properly\n"));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "NotFound exception (case 3)"
+ " - parameters aren't set correctly\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Not found (case 3) test failed\n"));
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+int
+Iterator_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Instantiate four dummy objects.
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind objects to the naming context.
+ CosNaming::Name name1;
+ name1.length (1);
+ name1[0].id = CORBA::string_dup ("foo1");
+ CosNaming::Name name2;
+ name2.length (1);
+ name2[0].id = CORBA::string_dup ("foo2");
+ CosNaming::Name name3;
+ name3.length (1);
+ name3[0].id = CORBA::string_dup ("foo3");
+ CosNaming::Name name4;
+ name4.length (1);
+ name4[0].id = CORBA::string_dup ("foo4");
+ root_context->bind (name1,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (name2,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (name3,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ root_context->bind (name4,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // List the content of the Naming Context.
+ CosNaming::BindingIterator_var iter;
+ CosNaming::BindingList_var bindings_list;
+ root_context->list (1,
+ bindings_list.out (),
+ iter.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (CORBA::is_nil (iter.in ())
+ || bindings_list->length () != 1
+ || bindings_list[0u].binding_type != CosNaming::nobject)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::list does not function properly\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "First binding: %s\n",
+ bindings_list[0u].binding_name[0u].id.in ()));
+
+ // Invoke operations on the iterator.
+ CosNaming::Binding_var binding;
+ iter->next_one (binding.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (binding->binding_type != CosNaming::nobject)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::next_one does not function properly\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Second binding: %s\n",
+ binding->binding_name[0].id.in ()));
+
+ iter->next_n (2, bindings_list.out () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (bindings_list->length () != 2
+ || bindings_list[0u].binding_type != CosNaming::nobject
+ || bindings_list[1u].binding_type != CosNaming::nobject)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::BindingIterator does not function properly\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "Third binding: %s\n"
+ "Fourth binding: %s\n",
+ bindings_list[0u].binding_name[0].id.in (),
+ bindings_list[1u].binding_name[0].id.in ()));
+
+ // We already iterated over all the bindings, so the following
+ // should return false.
+ CORBA::Boolean result = iter->next_one (binding.out ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (result)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "CosNaming::BindingIterator does not function properly\n"),
+ -1);
+ iter->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Iterator test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+Destroy_Test::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a context and bind an object under it.
+
+ CosNaming::NamingContext_var my_context;
+ my_context = root_context->new_context (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind a dummy object foo under my_context.
+ My_Test_Object *impl = new My_Test_Object;
+ Test_Object_var obj = impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ impl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::Name object_name;
+ object_name.length (1);
+ object_name[0].id = CORBA::string_dup ("foo");
+ my_context->bind (object_name,
+ obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Do the testing.
+ not_empty_test (my_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ my_context->unbind (object_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ my_context->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ not_exist_test (my_context
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception in Destroy test");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+void
+Destroy_Test::not_empty_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ ref->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCH (CosNaming::NamingContext::NotEmpty, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "NotEmpty exception works properly\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+void
+Destroy_Test::not_exist_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL)
+{
+ ACE_TRY
+ {
+ ref->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Destroy works properly\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+}
+
+Persistent_Test_Begin::Persistent_Test_Begin (CORBA::ORB_ptr orb,
+ FILE * ior_output_file)
+ : orb_ (orb),
+ file_ (ior_output_file)
+{
+}
+
+Persistent_Test_Begin::~Persistent_Test_Begin (void)
+{
+}
+
+int
+Persistent_Test_Begin::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a name structure we will reuse.
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("level1");
+
+ // Create and bind a naming context under the <root> context.
+ CosNaming::NamingContext_var level1_context =
+ root_context->bind_new_context (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create and bind a naming context under <level1> context.
+ test_name[0].id = CORBA::string_dup ("level2");
+ CosNaming::NamingContext_var level2_context =
+ level1_context->bind_new_context (test_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Log the ior of <level1_context> for use by <Persistent_Test_End>.
+ CORBA::String_var ior =
+ orb_->object_to_string (level1_context.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_OS::fprintf (this->file_,
+ "%s",
+ ior.in ());
+ ACE_OS::fclose (this->file_);
+
+ ACE_DEBUG ((LM_DEBUG, "Persistent Naming test (part 1) OK.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception in Persistent Test (part 1)");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+Persistent_Test_End::Persistent_Test_End (CORBA::ORB_ptr orb,
+ const char *ior)
+ : orb_ (orb),
+ ior_ (ior)
+{
+}
+
+Persistent_Test_End::~Persistent_Test_End (void)
+{
+}
+
+int
+Persistent_Test_End::execute (TAO_Naming_Client &root_context)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // Create a name structure we will reuse.
+ CosNaming::Name test_name;
+ test_name.length (1);
+ test_name[0].id = CORBA::string_dup ("level2");
+
+ // Convert stringified ior we got from <Persistent_Test_Begin>
+ // for <level1> Naming Context to Naming Context reference.
+ CORBA::Object_var obj =
+ orb_->string_to_object (ior_ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosNaming::NamingContext_var level1_context =
+ CosNaming::NamingContext::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (level1_context.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot narrow object to Naming Context\n"),
+ -1);
+
+ // Resolve for <level2> context through the persistent ior we
+ // got from part 1 of this test.
+ obj = level1_context->resolve (test_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Now, resolve for <level2> context using the <root> context
+ // reference which we obtained through <resolve_initial_references>.
+ test_name.length (2);
+ test_name[0].id = CORBA::string_dup ("level1");
+ test_name[1].id = CORBA::string_dup ("level2");
+ CORBA::Object_var obj2 =
+ root_context->resolve (test_name ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Make sure we got the same answer through both methods.
+ if (obj2->_is_equivalent (obj.in ()))
+ ACE_DEBUG ((LM_DEBUG, "Persistent Naming test (part 2) OK.\n"));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Unexpected exception in Persistent Test (part 2)");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+// This function runs the test.
+
+int
+main (int argc, char **argv)
+{
+ CosNaming_Client cosnaming_client;
+
+ if (cosnaming_client.init (argc, argv) == -1)
+ return 1;
+
+ return cosnaming_client.run ();
+}
diff --git a/TAO/orbsvcs/tests/Simple_Naming/client.h b/TAO/orbsvcs/tests/Simple_Naming/client.h
new file mode 100644
index 00000000000..e8fe27385c1
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/client.h
@@ -0,0 +1,335 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/tests
+//
+// = FILENAME
+// client.h
+//
+// = DESCRIPTION
+// This class tests the facilities to connect to the naming service.
+//
+// = AUTHORS
+// Marina Spivak <marina@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "test_objectS.h"
+#include "orbsvcs/CosNamingC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "ace/Task.h"
+
+class Naming_Test
+{
+ // = TITLE
+ // This is an abstract class which is subclassed
+ // to create different Naming Service tests.
+ //
+ // = DESCRIPTION
+ // This is a basic example of the "Strategy" pattern. This class
+ // provides a common interface for different tests (or
+ // "strategies"), so that a specific test to be used can be
+ // chosen at runtime.
+
+public:
+ virtual ~Naming_Test (void) {}
+ virtual int execute (TAO_Naming_Client &root_context) = 0;
+ // Execute the test code. <root_context> is the context to assume
+ // as the root for all tests operations.
+};
+
+class Simple_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a simple Naming Service test.
+ //
+ // = DESCRIPTION
+ // The test binds(), resolves(), and unbinds() an object
+ // reference from the given Naming Context.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the simple test code.
+};
+
+class MT_Test : public Naming_Test, public ACE_Task_Base
+{
+ // = TITLE
+ // This class implements a simple Multithreaded (multiclient) Naming Service test.
+ //
+ // = DESCRIPTION
+ // The test spawns multiple threads: each attempts to
+ // bind(), resolve(), and unbind() an object
+ // reference using the same name, and the same Naming Context.
+public:
+ // = Initialization and termination methods.
+
+ MT_Test (CORBA::ORB_ptr orb,
+ int size = 10);
+ // Constructor. Takes in an orb pointer and number of threads to spawn.
+
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the MT test code.
+
+ virtual int svc (void);
+ // This code is executed by each thread.
+
+private:
+ int size_;
+ // Number of threads to spawn. By default is set to 10.
+
+ CORBA::ORB_var orb_;
+ // A pointer to our ORB.
+
+ char* name_service_ior_;
+ // IOR in the string format for Naming Service we are to deal with.
+ // Each thread will use string_to_object() and this IOR to create
+ // its own NamingContext stub for invoking operations on the
+ // Naming Service. If all threads try to use the same stub, bad things
+ // happen...
+
+ // This can be replaced with CORBA::String_var when <string_to_object>
+ // is fixed - this will clean up the memory properly.
+
+ CosNaming::Name test_name_;
+ // Holds name used for registering the object with Naming Service.
+
+ Test_Object_var test_ref_;
+ // Holds object to be registered with the Naming Service by each thread.
+
+};
+
+class Tree_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of all Naming Service functions
+ // on a tree of Naming Contexts.
+ //
+ // = DESCRIPTION
+ // Bind_context() under the root context with the name level1.
+ // Create_new_context(), bind() foo object into it, and
+ // bind the context into root/level1 under the name level2.
+ // Resolve (root/level1/level2/foo).
+ // Unbind (root/level1/level2/foo).
+ // Bind (root/level1/level2/foo, obj)
+ // Create_new_context()
+ // and invoke rebind_context() to substitute it for the current
+ // level2 context.
+ // Bind (root/level1/level2/foo, obj)
+ // Resolve (root/level1/level2/foo).
+ // Rebind() to have a different object under the name bar.
+ // Resolve (root/level1/level2/foo) to make sure correct reference is returned.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the tree test code.
+};
+
+class Iterator_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of Naming Service functions
+ // which involve BindingIterator.
+ //
+ // = DESCRIPTION
+ // The test binds foo1, foo2, foo3, and foo4 objects to the
+ // Naming Context. It lists() one binding and receives
+ // BindingIterator to iterate over the rest of the bindings. It
+ // then invokes next_one(), next_n(2), next_one(), and destroy()
+ // on the iterator.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the iterator test code.
+};
+
+class Exceptions_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of exceptions in the Naming Service.
+ //
+ // = DESCRIPTION
+ // Makes sure that Naming Service throws exceptions as expected, and
+ // data inside exceptions is set correctly. The test creates a tree of
+ // of Naming Contexts: root context -> level1 -> level2. It then binds() an
+ // object with the name foo to each of Naming Contexts in the tree.
+ // Invoke resolve() with a Name of length 0 - make sure we get InvalidName exception.
+ // Invoke bind( foo, obj) on root context - make sure we get AlreadyBound exception.
+ // Invoke bind( level1/foo, obj) on root context - make sure we get AlreadyBound exc.
+ // Invoke unbind( level1/level2/bar) on root context - make sure we get NotFound exc.
+ // with why = not_object, rest_of_name = bar.
+ // Invoke unbind( level1/level3/foo) on root context - make sure we get NotFound exc.
+ // with why = missing_node, rest_of_name = level3/foo.
+ // Invoke unbind( level1/foo/foo) on root context - make sure we get NotFound exc.
+ // with why = not_context, rest_of_name = foo/foo.
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the exceptions test code.
+
+private:
+ // the following functions isolate specific tests due to the
+ // limitation of only 1 TAO_TRY being allowed per function.
+
+ void invalid_name_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void already_bound_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void already_bound_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void not_found_test (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void not_found_test2 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+ void not_found_test3 (TAO_Naming_Client &root_context
+ ACE_ENV_ARG_DECL);
+};
+
+class Destroy_Test : public Naming_Test
+{
+ // = TITLE
+ // This class implements a test of destroy() function
+ // in the Naming Service.
+ //
+ // = DESCRIPTION
+ // Create a context and bind an object under it.
+ // Attempt to destroy the context - NotEmpty exception should be raised.
+ //
+ // Unbind the object and call destroy on the context.
+ // Attempt to call destroy on the object again - OBJECT_NOT_EXIST
+ // exception should be raised.
+ //
+public:
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the destroy test code.
+
+private:
+ // = The following functions isolate specific tests.
+ void not_empty_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL);
+ void not_exist_test (CosNaming::NamingContext_var &ref
+ ACE_ENV_ARG_DECL);
+};
+
+class Persistent_Test_Begin : public Naming_Test
+{
+ // = TITLE
+ // This class implements the first part of the Persistent Naming
+ // Service test.
+ //
+ // = DESCRIPTION
+ // This test creates the Naming Context hierarchy:
+ // root -> level1_context -> level2_context,
+ // and prints out the ior of the <level1_context>.
+public:
+ // = Initialization and termination methods.
+
+ Persistent_Test_Begin (CORBA::ORB_ptr orb,
+ FILE * ior_output_file);
+ // Constructor. Takes in an orb pointer.
+
+ virtual ~Persistent_Test_Begin (void);
+ // Destructor.
+
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the persistent test (part 1) code.
+
+private:
+
+ CORBA::ORB_var orb_;
+ // A pointer to our ORB (needed for object/string conversion).
+
+ FILE *file_;
+ // File where we output the ior for use by part 2 of persistent test.
+};
+
+class Persistent_Test_End : public Naming_Test
+{
+ // = TITLE
+ // This class implements the second part of the Persistent Naming
+ // Service test.
+ //
+ // = DESCRIPTION
+ // This test attempts to resolve <level2_context> both through the
+ // <root> Naming Context, which it gets from <resolve_initial_references>, and
+ // through <level1_context> stringified ior, which it gets from part 1 of
+ // the persistent test. The results of both methods are then
+ // compared for equality.
+public:
+ // = Initialization and termination methods.
+
+ Persistent_Test_End (CORBA::ORB_ptr orb,
+ const char * ior);
+ // Constructor. Takes in an orb pointer and the ior received from
+ // <Persistent_Test_Begin>.
+
+ virtual ~Persistent_Test_End (void);
+ // Destructor.
+
+ virtual int execute (TAO_Naming_Client &root_context);
+ // Execute the persistent test (part 2).
+
+private:
+
+ CORBA::ORB_var orb_;
+ // A pointer to our ORB (used for string/object conversion).
+
+ const char* ior_;
+ // IOR of <level1_context> recorded during the run of part 1 of
+ // persistent test.
+};
+
+class CosNaming_Client
+{
+ // = TITLE,
+ // Defines a class that encapsulates behaviour of the CosNaming
+ // client example. Provides a better understanding of the logic
+ // in an object-oriented way.
+ //
+ // = DESCRIPTION
+ // This class declares an interface to run the example client for
+ // CosNaming CORBA server. All the complexity for initializing
+ // the server is hidden in the class. Just the <run> interface
+ // is needed.
+public:
+ // = Initialization and termination methods.
+
+ CosNaming_Client (void);
+ // Constructor.
+
+ ~CosNaming_Client (void);
+ // Destructor.
+
+ int run (void);
+ // Execute client example code.
+
+ int init (int argc, char **argv);
+ // Initialize the client communication endpoint with server.
+
+ // = Symbolic ids.
+ enum OBJ_ID
+ {
+ OBJ1_ID = 5,
+ OBJ2_ID = 6
+ };
+
+private:
+ int parse_args (void);
+ // Parses the arguments passed on the command line.
+
+ int argc_;
+ // # of arguments on the command line.
+
+ char **argv_;
+ // arguments from command line.
+
+ Naming_Test *test_;
+ // A pointer to the specific Naming Service test a client will
+ // execute.
+
+ TAO_ORB_Manager orbmgr_;
+ // Our ORB manager helper class.
+
+ TAO_Naming_Client naming_client_;
+ // Our naming client helper class.
+};
diff --git a/TAO/orbsvcs/tests/Simple_Naming/process-m-output.pl b/TAO/orbsvcs/tests/Simple_Naming/process-m-output.pl
new file mode 100755
index 00000000000..c9205bda74a
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/process-m-output.pl
@@ -0,0 +1,115 @@
+# $Id$
+# -*- perl -*-
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# This is a Perl script that processes the output of the multithreaded
+# client test. Usage: process-m-output.pl output-file-name number-of-threads
+
+# The following checks are performed:
+# 1) Number of sucessful binds equals to the number of sucessful
+# unbinds.
+# 2) Each thread id has 1 output line for each of the following: bind,
+# resolve and unbind.
+# 3) There are no unexpected output lines (e.g., more lines than
+# expected or with unexpected content like Exceptions, seg faults).
+
+# Open the output file.
+$input_file = $ARGV[0];
+if ($input_file and $ARGV[1])
+{
+ open (DATA, $input_file);
+}
+else
+{
+ die "Usage: process-m-output.pl output-file-name number-of-threads \n";
+}
+
+$errors = 0;
+
+$binds = 0;
+$unbinds = 0;
+
+while ($line = <DATA>)
+{
+ # Process the line.
+ chomp $line;
+ @words = split (/ /, $line);
+
+ # Ignore the empty line, the "CommandLine:" line and the "WARNING:" line
+ # from the orbsvcs/orbsvcs/Shutdown_Utilities.cpp.
+ if ($#words == -1 or
+ $words[0] eq "CommandLine:" or
+ $line =~ /WARNING: /) {
+ next;
+ }
+
+ # Make sure the line contains expected output.
+ if (not ($words[0] eq "Unbound" or
+ $words[0] eq "Bound" or
+ $words[0] eq "Resolved" or
+ $words[0] eq "Unable"))
+ {
+ close (DATA);
+ die "Error is detected in the output file <$input_file> \n";
+ }
+
+ # Keep track of sucessful binds/unbinds.
+ if ($words[0] eq "Bound")
+ {
+ ++$binds;
+ }
+ if ($words[0] eq "Unbound")
+ {
+ ++$unbinds;
+ }
+
+ # Keep track of output lines for each thread.
+ $count = $threads{$words[5]};
+
+ if ($count eq "" and
+ ($words[0] eq "Bound" or $words[2] eq "bind"))
+ {
+ ++$threads{$words[5]};
+ }
+ elsif ($count eq 1 and
+ ($words[0] eq "Resolved" or $words[2] eq "resolve"))
+ {
+ ++$threads{$words[5]};
+ }
+ elsif ($count eq 2 and
+ ($words[0] eq "Unbound" or $words[2] eq "unbind"))
+ {
+ ++$threads{$words[5]};
+ }
+ else
+ {
+ close (DATA);
+ die "Wrong output for thread $word[5]\n";
+ }
+}
+close (DATA);
+# Check that each thread performed 3 operations.
+if (grep {not $_ eq 3} values %threads)
+{
+ die "Some thread has performed a wrong number of operations\n";
+}
+$number = values %threads;
+if ($number ne $ARGV[1])
+{
+ die "Not all threads performed operations\n";
+}
+
+# Check that number of binds equals to those of unbinds.
+if ($binds == $unbinds)
+{
+ print "Multithreaded output is ok \n";
+}
+else
+{
+ print "Number of sucessfule binds is different from number of
+sucessful unbinds\n";
+}
+
+exit $errors;
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
new file mode 100755
index 00000000000..28ed2918ece
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
@@ -0,0 +1,196 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs some Naming Service tests.
+# It runs all the tests that will run with min CORBA.
+# It starts all the servers and clients as necessary.
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+use Cwd;
+
+## Save the starting directory
+$startdir = getcwd();
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+
+$quiet = 0;
+
+# check for -q flag
+if ($ARGV[0] eq '-q') {
+ $quiet = 1;
+}
+
+# Variables for command-line arguments to client and server
+# executables.
+$ns_multicast_port = 10001 + PerlACE::uniqueid (); # Can not be 10000 on Chorus 4.0
+$ns_orb_port = 12000 + PerlACE::uniqueid ();
+$iorfile = PerlACE::LocalFile ("ns.ior");
+$persistent_ior_file = PerlACE::LocalFile ("pns.ior");
+$persistent_log_file = PerlACE::LocalFile ("test_log");
+$data_file = PerlACE::LocalFile ("test_run.data");
+
+$status = 0;
+
+sub name_server
+{
+ my $args = "-ORBNameServicePort $ns_multicast_port -o $iorfile -m 1 @_";
+ my $prog = "$startdir/../../Naming_Service/Naming_Service";
+ $NS = new PerlACE::Process ($prog, $args);
+
+ unlink $iorfile;
+
+ $NS->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($iorfile, $sleeptime) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
+ $NS->Kill ();
+ exit 1;
+ }
+}
+
+sub client
+{
+ my $args = "@_"." ";
+ my $prog = "$startdir/client";
+
+ $CL = new PerlACE::Process ($prog, $args);
+
+ $client = $CL->SpawnWaitKill (60);
+
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
+}
+
+## The options below have been reordered due to a
+## initialization problem (within the Naming_Service)
+## that has only been seen on Windows XP.
+
+# Options for all simple tests recognized by the 'client' program.
+@opts = ("-s -ORBInitRef NameService=file://$iorfile",
+ "-p $persistent_ior_file -ORBInitRef NameService=file://$iorfile",
+ "-s -ORBInitRef NameService=mcast://:$ns_multicast_port\::/NameService",
+ "-t -ORBInitRef NameService=file://$iorfile",
+ "-i -ORBInitRef NameService=file://$iorfile",
+ "-e -ORBInitRef NameService=file://$iorfile",
+ "-y -ORBInitRef NameService=file://$iorfile",
+ "-c file://$persistent_ior_file -ORBInitRef NameService=file://$iorfile",
+ );
+
+@server_opts = ("-t 30",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
+ "", "", "", "", "",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
+ );
+
+@comments = ("Simple Test: \n",
+ "mmap() Persistent Test (Part 1): \n",
+ "Simple Test (using multicast to locate the server): \n",
+ "Tree Test: \n",
+ "Iterator Test: \n",
+ "Exceptions Test: \n",
+ "Destroy Test: \n",
+ "mmap() Persistent Test (Part 2): \n",
+ );
+
+$test_number = 0;
+
+## Allow the user to determine where the persistent file will be located
+## just in case the current directory is not suitable for locking.
+## We can't change the name of the persistent file because that is not
+## sufficient to work around locking problems for Tru64 when the current
+## directory is NFS mounted from a system that does not properly support
+## locking.
+foreach my $possible ($ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP}) {
+ if (defined $possible && -d $possible) {
+ if (chdir($possible)) {
+ last;
+ }
+ }
+}
+
+print "INFO: Running the test in ", getcwd(), "\n";
+
+unlink ($persistent_ior_file, $persistent_log_file);
+
+# Run server and client for each of the tests. Client uses ior in a
+# file to bootstrap to the server.
+foreach $o (@opts) {
+ name_server ($server_opts[$test_number]);
+
+ print STDERR "\n ".$comments[$test_number];
+
+ client ($o);
+
+ $NS->Kill ();
+
+ ## For some reason, only on Windows XP, we need to
+ ## wait before starting another Naming_Service when
+ ## the mmap persistence option is used
+ if ($^O eq "MSWin32") {
+ sleep(1);
+ }
+
+ $test_number++;
+}
+
+unlink ($persistent_ior_file, $persistent_log_file);
+
+# Now run the multithreaded test, sending output to the file.
+print STDERR "\n Multithreaded Test:\n";
+unlink $data_file;
+
+open (OLDOUT, ">&STDOUT");
+open (STDOUT, ">$data_file") or die "can't redirect stdout: $!";
+open (OLDERR, ">&STDERR");
+open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!";
+
+# just here to quiet warnings
+$fh = \*OLDOUT;
+$fh = \*OLDERR;
+
+name_server ();
+
+client ("-ORBInitRef NameService=file://$iorfile", "-m15");
+
+close (STDERR);
+close (STDOUT);
+open (STDOUT, ">&OLDOUT");
+open (STDERR, ">&OLDERR");
+
+$NS->Kill ();
+
+unlink $iorfile;
+
+
+$errors = system ("perl $startdir/process-m-output.pl $data_file 15") >> 8;
+
+if ($errors > 0) {
+ $status = 1;
+
+ if (!$quiet) {
+ print STDERR "Errors Detected, printing output\n";
+ if (open (DATA, "<$data_file")) {
+ print STDERR "================================= Begin\n";
+ print STDERR <DATA>;
+ print STDERR "================================= End\n";
+ close (DATA);
+ }
+ else {
+ print STDERR "ERROR: Could not open $data_file\n";
+ }
+ unlink $data_file;
+ }
+}
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
new file mode 100755
index 00000000000..068b5c66038
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
@@ -0,0 +1,131 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+# This is a Perl script that runs additional Naming Service tests.
+# It runs all the tests that will *not* run with min CORBA.
+# It starts all the servers and clients as necessary.
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+# Amount of delay (in seconds) between starting a server and a client
+# to allow proper server initialization.
+$sleeptime = 10;
+
+$quiet = 0;
+
+# check for -q flag
+if ($ARGV[0] eq '-q') {
+ $quiet = 1;
+}
+
+# Variables for command-line arguments to client and server
+# executables.
+$ns_multicast_port = 10001 + PerlACE::uniqueid (); # Can not be 10000 on Chorus 4.0
+$ns_orb_port = 12000 + PerlACE::uniqueid ();
+$iorfile = PerlACE::LocalFile ("ns.ior");
+$file_persistent_ior_file = PerlACE::LocalFile ("fpns.ior");
+
+$status = 0;
+
+sub name_server
+{
+ my $args = "-ORBNameServicePort $ns_multicast_port -o $iorfile -m 1 @_";
+ my $prog = "../../Naming_Service/Naming_Service";
+ $NS = new PerlACE::Process ($prog, $args);
+
+ unlink $iorfile;
+
+ $NS->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($iorfile, $sleeptime) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
+ $NS->Kill ();
+ exit 1;
+ }
+}
+
+sub client
+{
+ my $args = "@_"." ";
+ my $prog = "client";
+
+ $CL = new PerlACE::Process ($prog, $args);
+
+ $client = $CL->SpawnWaitKill (60);
+
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
+}
+
+## The options below have been reordered due to a
+## initialization problem (within the Naming_Service)
+## that has only been seen on Windows XP.
+
+# Options for all simple tests recognized by the 'client' program.
+@opts = ("-p $file_persistent_ior_file -ORBInitRef NameService=file://$iorfile",
+ "-c file://$file_persistent_ior_file -ORBInitRef NameService=file://$iorfile");
+
+@server_opts = ("-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -u NameService",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -u NameService");
+
+@comments = ("Flat File Persistent Test (Part 1): \n",
+ "Flat File Persistent Test (Part 2): \n");
+
+$test_number = 0;
+
+unlink ($file_persistent_ior_file);
+
+if ( ! -d "NameService" ) {
+ mkdir (NameService, 0777);
+ }
+else {
+ chdir "NameService";
+ opendir(THISDIR, ".");
+ @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+ closedir(THISDIR);
+ unlink @allfiles;
+ chdir "..";
+ }
+
+
+# Run server and client for each of the tests. Client uses ior in a
+# file to bootstrap to the server.
+foreach $o (@opts) {
+ name_server ($server_opts[$test_number]);
+
+ print STDERR "\n ".$comments[$test_number];
+
+ client ($o);
+
+ $NS->Kill ();
+
+ ## For some reason, only on Windows XP, we need to
+ ## wait before starting another Naming_Service when
+ ## the mmap persistence option is used
+ if ($^O eq "MSWin32") {
+ sleep(1);
+ }
+
+ $test_number++;
+}
+
+unlink ($file_persistent_ior_file);
+
+chdir "NameService";
+opendir(THISDIR, ".");
+@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+closedir(THISDIR);
+unlink @allfiles;
+chdir "..";
+rmdir "NameService";
+
+unlink $iorfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Simple_Naming/test_object.idl b/TAO/orbsvcs/tests/Simple_Naming/test_object.idl
new file mode 100644
index 00000000000..4737f6dc6c8
--- /dev/null
+++ b/TAO/orbsvcs/tests/Simple_Naming/test_object.idl
@@ -0,0 +1,11 @@
+// $Id$
+
+interface Test_Object
+{
+ // = TITLE
+ // This is a simple interface that tests the Naming Service.
+
+ attribute short id;
+ // This provides an easy way to differentiate objects if each
+ // objects is served by a separate servant.
+};
diff --git a/TAO/orbsvcs/tests/Time/Client_i.cpp b/TAO/orbsvcs/tests/Time/Client_i.cpp
new file mode 100644
index 00000000000..9a8d23a4996
--- /dev/null
+++ b/TAO/orbsvcs/tests/Time/Client_i.cpp
@@ -0,0 +1,453 @@
+// $Id$
+
+#include "Client_i.h"
+
+#include "tao/debug.h"
+
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_fcntl.h"
+#include "ace/os_include/os_netdb.h"
+
+ACE_RCSID(Time_Service, Client_i, "$Id$")
+
+// Constructor.
+
+Client_i::Client_i (void)
+ : ior_ (0),
+ loop_count_ (10),
+ shutdown_ (0),
+ clerk_ ()
+{
+}
+
+// The following test throws an exception that the operation
+// <secure_universal_time> has not been currently implemented in the
+// given server.
+
+void
+Client_i::test_for_secure_universal_time (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Testing secure_time()\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosTime::UTO_var UTO_server =
+ this->clerk_->secure_universal_time (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::SystemException, sysex)
+ {
+ ACE_PRINT_EXCEPTION (sysex, "System Exception");
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) test_for_secure_universal_time() successful !!\n"));
+ }
+ ACE_ENDTRY;
+}
+
+// The following test retrieves the current universal time as a UTO
+// from the clerk_ and prints out the various attributes of the UTO.
+
+void
+Client_i::test_for_universal_time (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Testing universal_time()\n"));
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosTime::UTO_var UTO_server =
+ this->clerk_->universal_time (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ ACE_TRY_CHECK;
+
+#ifndef ACE_LACKS_LONGLONG_T
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTime = %Q\nInaccuracy = %Q\nTimeDiff = %d\nstruct.time = %Q"
+ "\nstruct.inacclo = %d\nstruct.inacchi = %d\nstruct.Tdf = %d\n",
+ UTO_server->time (),
+ UTO_server->inaccuracy (),
+ UTO_server->tdf (),
+ (UTO_server->utc_time ()).time,
+ (UTO_server->utc_time ()).inacclo,
+ (UTO_server->utc_time ()).inacchi,
+ (UTO_server->utc_time ()).tdf));
+#else
+ ACE_DEBUG ((LM_DEBUG,
+ "\nTime = %u\nInaccuracy = %u\nTimeDiff = %d\nstruct.time = %u"
+ "\nstruct.inacclo = %d\nstruct.inacchi = %d\nstruct.Tdf = %d\n",
+ UTO_server->time ().lo(),
+ UTO_server->inaccuracy ().lo(),
+ UTO_server->tdf (),
+ (UTO_server->utc_time ()).time.lo(),
+ (UTO_server->utc_time ()).inacclo,
+ (UTO_server->utc_time ()).inacchi,
+ (UTO_server->utc_time ()).tdf));
+#endif
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Error:");
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) test_for_universal_time()\n"));
+ }
+ ACE_ENDTRY;
+}
+
+void
+Client_i::test_for_new_universal_time (void)
+{
+ TimeBase::TimeT time = 999999999;
+ TimeBase::InaccuracyT inaccuracy = 9999;
+ TimeBase::TdfT tdf = 99;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Testing new_universal_time()\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosTime::UTO_var UTO_server = this->clerk_->new_universal_time (time,
+ inaccuracy,
+ tdf
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_ASSERT (UTO_server->time (ACE_ENV_SINGLE_ARG_PARAMETER) == 999999999);
+ ACE_ASSERT (UTO_server->inaccuracy (ACE_ENV_SINGLE_ARG_PARAMETER) == 9999);
+ ACE_ASSERT (UTO_server->tdf (ACE_ENV_SINGLE_ARG_PARAMETER) == 99);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).time == 999999999);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).inacchi == 0);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).inacclo == 9999);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).tdf == 99);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Test new_universal_time () fails.\n"));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception :\n");
+ }
+ ACE_ENDTRY;
+}
+
+void
+Client_i::test_for_uto_from_utc (void)
+{
+ TimeBase::UtcT utc_struct;
+
+ utc_struct.time = 999999999;
+ utc_struct.inacclo = 50;
+ utc_struct.inacchi = 50;
+ utc_struct.tdf = 99;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Testing uto_from_utc ()\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosTime::UTO_var UTO_server = this->clerk_->uto_from_utc (utc_struct
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TimeBase::InaccuracyT inaccuracy = utc_struct.inacchi;
+ inaccuracy <<= 32;
+ inaccuracy |= utc_struct.inacclo;
+
+ ACE_ASSERT (UTO_server->time (ACE_ENV_SINGLE_ARG_PARAMETER) == 999999999);
+ ACE_ASSERT (UTO_server->inaccuracy (ACE_ENV_SINGLE_ARG_PARAMETER) == inaccuracy);
+ ACE_ASSERT (UTO_server->tdf (ACE_ENV_SINGLE_ARG_PARAMETER) == 99);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).time == 999999999);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).inacclo == 50);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).inacchi == 50);
+ ACE_ASSERT ((UTO_server->utc_time (ACE_ENV_SINGLE_ARG_PARAMETER)).tdf == 99);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Test uto_from_utc () fails.\n"));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception :\n");
+ }
+ ACE_ENDTRY;
+}
+
+void
+Client_i::test_for_new_interval (void)
+{
+ TimeBase::TimeT lower = 666666666;
+ TimeBase::TimeT upper = 999999999;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Testing new_interval ()\n"));
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ CosTime::TIO_var TIO_server = this->clerk_->new_interval (lower,
+ upper
+ ACE_ENV_ARG_PARAMETER);
+
+ ACE_ASSERT ((TIO_server->time_interval (ACE_ENV_SINGLE_ARG_PARAMETER)).lower_bound == 666666666);
+ ACE_ASSERT ((TIO_server->time_interval (ACE_ENV_SINGLE_ARG_PARAMETER)).upper_bound == 999999999);
+
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Test new_interval () fails.\n"));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception :\n");
+ }
+ ACE_ENDTRY;
+
+ return;
+}
+
+// Reads the Time Service Server ior from a file
+
+int
+Client_i::read_ior (char *filename)
+{
+ // Open the file for reading.
+ ACE_HANDLE f_handle = ACE_OS::open (filename, 0);
+
+ if (f_handle == ACE_INVALID_HANDLE)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "[CLIENT] Process/Thread Id : (%P/%t) Unable to open %s for writing: %p\n",
+ filename),
+ -1);
+
+ ACE_Read_Buffer ior_buffer (f_handle);
+ char *data = ior_buffer.read ();
+
+ if (data == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "[CLIENT] Process/Thread Id : (%P/%t) Unable to read ior: %p\n"),
+ -1);
+
+ this->ior_ = ACE_OS::strdup (data);
+ ior_buffer.alloc ()->free (data);
+
+ ACE_OS::close (f_handle);
+
+ return 0;
+}
+
+// Parses the command line arguments and returns an error status.
+
+int
+Client_i::parse_args (void)
+{
+ ACE_Get_Opt get_opts (argc_, argv_, "dn:f:xk:");
+ int c;
+ int result;
+
+ while ((c = get_opts ()) != -1)
+ // ACE_DEBUG((LM_DEBUG,"bal =1%c",c
+ // ));
+ switch (c)
+ {
+ case 'd': // debug flag
+ TAO_debug_level++;
+ break;
+ case 'n': // loop count
+ this->loop_count_ = (u_int) ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case 'k': // ior provide on command line
+ this->ior_ = ACE_OS::strdup (get_opts.opt_arg ());
+ break;
+ case 'f': // read the IOR from the file.
+ result = this->read_ior (get_opts.opt_arg ());
+ if (result < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "[CLIENT] Process/Thread Id : (%P/%t) Unable to read ior from %s : %p\n",
+ get_opts.opt_arg ()),
+ -1);
+ break;
+ case 'x':
+ this->shutdown_ = 1;
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s"
+ " [-d]"
+ " [-n loopcount]"
+ " [-f ior-file]"
+ " [-k ior]"
+ " [-x]"
+ "\n",
+ this->argv_ [0]),
+ -1);
+ }
+
+ // Indicates successful parsing of command line.
+ return 0;
+}
+
+// Execute client example code.
+
+int
+Client_i::run (void)
+{
+ // Retrieves the current universal time.
+ test_for_universal_time ();
+
+ // Asserts the validity of the new_universal_time.
+ test_for_new_universal_time ();
+
+ // Asserts the validity of the UTO created from a given UTC.
+ test_for_uto_from_utc ();
+
+ // Asserts the validity of the TIO created using the given
+ // bounds.
+ test_for_new_interval ();
+
+ // Throws an exception because the method has not been
+ // implemented currently.
+ test_for_secure_universal_time ();
+
+ return 0;
+}
+
+Client_i::~Client_i (void)
+{
+ ACE_OS::free (this->ior_);
+}
+
+int
+Client_i::obtain_initial_references (void)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Initialize the naming services.
+ if (my_name_client_.init (orb_.in ()) != 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "[CLIENT] Process/Thread Id : (%P/%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "DONE\n"));
+
+ char host_name[MAXHOSTNAMELEN];
+ char name[MAXHOSTNAMELEN];
+
+ ACE_OS::hostname (host_name, MAXHOSTNAMELEN);
+
+ CosNaming::Name clerk_name;
+ clerk_name.length (2);
+ clerk_name[0].id = CORBA::string_dup ("ClerkContext");
+ ACE_OS::strcpy (name, "Clerk:");
+ ACE_OS::strcat (name, host_name);
+ clerk_name[1].id = CORBA::string_dup (name);
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%s|\n",
+ name));
+
+ CORBA::Object_var temp_object =
+ my_name_client_->resolve (clerk_name
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ clerk_ = CosTime::TimeService::_narrow (temp_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (clerk_.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "[CLIENT] Process/Thread Id : (%P/%t) Unable to Resolve "
+ "Clerk Reference\n"),
+ -1);
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Client :: obtain_initial_references\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+// This method uses the IOR if specified on the command line or in a
+// file, else it uses the Naming Service
+
+int
+Client_i::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Retrieve the ORB.
+ this->orb_ = CORBA::ORB_init (this->argc_,
+ this->argv_,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Parse command line and verify parameters.
+ if (this->parse_args () == -1)
+ return -1;
+
+ if (this->ior_)
+ {
+ // An ior is specified for the client through a commandline
+ // option or a file.
+
+ CORBA::Object_var server_object =
+ this->orb_->string_to_object (this->ior_
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (server_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "invalid ior <%s>\n",
+ this->ior_),
+ -1);
+ this->clerk_ =
+ CosTime::TimeService::_narrow (server_object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Using the IOR provided\n"));
+ ACE_TRY_CHECK;
+ }
+ else
+ { // No IOR specified. Use the Naming Service
+ ACE_DEBUG((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Using the Naming Service\n"));
+
+ if (this->obtain_initial_references () == -1)
+ return -1;
+
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Client_i::init\n");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Time/Client_i.h b/TAO/orbsvcs/tests/Time/Client_i.h
new file mode 100644
index 00000000000..66062dace39
--- /dev/null
+++ b/TAO/orbsvcs/tests/Time/Client_i.h
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/orbsvcs/Time_Service
+//
+// = FILENAME
+// Client_i.h
+//
+// = DESCRIPTION
+// This class implements a simple CORBA client that accesses a Time Service
+// server.
+//
+// = AUTHORS
+// Vishal Kachroo <vishal@cs.wustl.edu>
+//
+// ============================================================================
+
+#include "orbsvcs/TimeServiceC.h"
+#include "orbsvcs/Naming/Naming_Client.h"
+
+class Client_i
+{
+ // = TITLE
+ // Client implementation to access the Time Service server.
+ //
+ // = DESCRIPTION
+ // Class wrapper for a client that gets the IOR of the clerk
+ // running on its machine and uses it to get the globally
+ // synchronized time
+public:
+ // = Initialization and termination methods.
+ Client_i (void);
+ // Constructor.
+
+ ~Client_i (void);
+ // Destructor.
+
+ int run (void);
+ // Execute client example code.
+
+ int init (int argc, char *argv[]);
+ // Initialize the client communication endpoint with server.
+
+ void test_for_secure_universal_time (void);
+ // This test throws an exception that the operation
+ // <secure_universal_time> has not been currently implemented in the
+ // given server.
+
+ void test_for_universal_time (void);
+ // Tests if the server returns a valid time.
+
+ void test_for_new_universal_time (void);
+ // Tests if the server returns a new UTO filled with the given time.
+
+ void test_for_uto_from_utc (void);
+ // Tests if the returned UTO has the same value as the given UTC.
+
+ void test_for_new_interval (void);
+ // Tests if a new TIO is created according to the given bounds.
+
+private:
+ int read_ior (char *filename);
+ // Function to read the server IOR from a file.
+
+ int parse_args (void);
+ // Parses the arguments passed on the command line.
+
+ int obtain_initial_references (void);
+ // To initialize the naming service and get a clerk IOR.
+
+ int argc_;
+ // # of arguments on the command line.
+
+ char **argv_;
+ // arguments from command line.
+
+ char *ior_;
+ // IOR of the obj ref of the server.
+
+ u_int loop_count_;
+ // Number of times to invoke the <time> operation.
+
+ int shutdown_;
+ // Flag for server shutdown.
+
+ CosTime::TimeService_var clerk_;
+ // Time Service Server object ptr.
+
+ TAO_Naming_Client my_name_client_;
+ // An instance of the name client used for resolving the Time
+ // Service object.
+
+ CORBA::ORB_var orb_;
+ // Remember our orb.
+
+};
diff --git a/TAO/orbsvcs/tests/Time/Makefile.am b/TAO/orbsvcs/tests/Time/Makefile.am
new file mode 100644
index 00000000000..1c540fee207
--- /dev/null
+++ b/TAO/orbsvcs/tests/Time/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Time_Orbsvcs_Client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ Client_i.cpp \
+ client.cpp \
+ Client_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTime.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Time/README b/TAO/orbsvcs/tests/Time/README
new file mode 100644
index 00000000000..aa47cd477fb
--- /dev/null
+++ b/TAO/orbsvcs/tests/Time/README
@@ -0,0 +1,46 @@
+$Id $
+
+=================== Time Service Test =====================================
+
+A sample run of the TimeService can be done as follows :
+
+* Using the Naming Service :
+
+1. Run TAO/orbsvcs/Time_Service/server on different machines.
+2. Run TAO/orbsvcs/Time_Service/clerk -t 5 on some machines.
+3. Run the TAO/orbsvcs/tests/Time/client on one of the machines where a clerk
+ is running.
+
+* Using Files :
+
+1. Run TAO/orbsvcs/Time_Service/server -o server_ior on different machines.
+2. Run TAO/orbsvcs/Time_Service/clerk -t 5 -f server_ior -o clerk_ior on some
+ machines.
+3. Run the TAO/orbsvcs/tests/Time/client -f clerk_ior on one of the machines
+ where a clerk is running.
+
+* Using the Implementation Repository :
+
+1. Run the Implementation Repository service as :
+
+ TAO/orbsvcs/Time_Service> ../ImplRepo_Service/ImplRepo_Service -ORBsvcconf
+ implrepo.conf -ORBobjrefstyle url -d 1
+
+2. Run the Server as
+
+ TAO/orbsvcs/Time_Service> server -o server_ior -r -i
+
+3. Run the Clerk as
+
+ TAO/orbsvcs/Time_Service> clerk -f server_ior -t 5 -o clerk_ior
+
+4. Run the client as
+
+ TAO/orbsvcs/tests/Time/client -f clerk_ior
+
+Algorithms
+----------
+
+Currently, updating the system time involves taking the average of all
+the times received from the servers. This can be extended by using a
+more elaborate distributed time synchronization algorithm.
diff --git a/TAO/orbsvcs/tests/Time/Time.mpc b/TAO/orbsvcs/tests/Time/Time.mpc
new file mode 100644
index 00000000000..94891b66225
--- /dev/null
+++ b/TAO/orbsvcs/tests/Time/Time.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project(*orbsvcs client): namingexe, time {
+ exename = client
+}
diff --git a/TAO/orbsvcs/tests/Time/client.cpp b/TAO/orbsvcs/tests/Time/client.cpp
new file mode 100644
index 00000000000..690b329a7d7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Time/client.cpp
@@ -0,0 +1,22 @@
+// $Id$
+
+#include "Client_i.h"
+#include "ace/Log_Msg.h"
+
+ACE_RCSID(Time, client, "$Id$")
+
+// This function runs the Time Service client test.
+
+int
+main (int argc, char *argv[])
+{
+ Client_i client;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "[CLIENT] Process/Thread Id : (%P/%t) Time Service Client\n"));
+
+ if (client.init (argc, argv) == -1)
+ return -1;
+ else
+ return client.run ();
+}
diff --git a/TAO/orbsvcs/tests/Time/run_test.pl b/TAO/orbsvcs/tests/Time/run_test.pl
new file mode 100755
index 00000000000..9c174e5f654
--- /dev/null
+++ b/TAO/orbsvcs/tests/Time/run_test.pl
@@ -0,0 +1,64 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../../bin";
+use PerlACE::Run_Test;
+
+$server_ior = PerlACE::LocalFile ("server_ior");
+$clerk_ior = PerlACE::LocalFile ("clerk_ior");
+
+$status = 0;
+
+# Make sure the files are gone, so we can wait on them.
+
+unlink $server_ior, $clerk_ior;
+
+$SV = new PerlACE::Process ("../../Time_Service/Time_Service_Server", "-o $server_ior");
+$CK = new PerlACE::Process ("../../Time_Service/Time_Service_Clerk", "-f $server_ior -o $clerk_ior -t 2");
+$CL = new PerlACE::Process ("client", "-f $clerk_ior");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($server_ior, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$server_ior>\n";
+ $SV->Kill ();
+ exit 1;
+}
+
+$CK->Spawn ();
+
+if (PerlACE::waitforfile_timed ($clerk_ior, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$clerk_ior>\n";
+ $SV->Kill ();
+ $CK->Kill ();
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+$clerk = $CK->TerminateWaitKill (5);
+
+if ($clerk != 0) {
+ print STDERR "ERROR: clerk returned $clerk\n";
+ $status = 1;
+}
+
+unlink $server_ior, $clerk_ior;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Trading/Makefile.am b/TAO/orbsvcs/tests/Trading/Makefile.am
new file mode 100644
index 00000000000..c07c73d2a91
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Makefile.am
@@ -0,0 +1,206 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.Trading_Test_Lib.am
+
+BUILT_SOURCES = \
+ TTestC.cpp \
+ TTestC.h \
+ TTestC.inl \
+ TTestS.cpp \
+ TTestS.h \
+ TTestS.inl \
+ TTestS_T.cpp \
+ TTestS_T.h \
+ TTestS_T.inl
+
+CLEANFILES = \
+ TTest-stamp \
+ TTestC.cpp \
+ TTestC.h \
+ TTestC.inl \
+ TTestS.cpp \
+ TTestS.h \
+ TTestS.inl \
+ TTestS_T.cpp \
+ TTestS_T.h \
+ TTestS_T.inl
+
+TTestC.cpp TTestC.h TTestC.inl TTestS.cpp TTestS.h TTestS.inl TTestS_T.cpp TTestS_T.h TTestS_T.inl: TTest-stamp
+
+TTest-stamp: $(srcdir)/TTest.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -I$(TAO_ROOT)/orbsvcs -GT -I..\..\.. -I..\..\..\orbsvcs -Sc -Wb,export_macro=TAO_TTest_Export -Wb,export_include=ttest_export.h $(srcdir)/TTest.idl
+ @touch $@
+
+noinst_LTLIBRARIES = libTTest.la
+
+libTTest_la_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs \
+ -DTAO_TTEST_BUILD_DLL
+
+libTTest_la_SOURCES = \
+ Offer_Exporter.cpp \
+ Offer_Importer.cpp \
+ Service_Type_Exporter.cpp \
+ Simple_Dynamic.cpp \
+ TT_Info.cpp \
+ TTestC.cpp \
+ TTestS.cpp
+
+noinst_HEADERS = \
+ Offer_Exporter.h \
+ Offer_Importer.h \
+ Service_Type_Exporter.h \
+ Simple_Dynamic.h \
+ TT_Info.h \
+ TTest.idl \
+ TTestC.h \
+ TTestC.inl \
+ TTestS.h \
+ TTestS.inl \
+ TTestS_T.cpp \
+ TTestS_T.h \
+ TTestS_T.inl \
+ ttest_export.h
+
+## Makefile.Trading_Colocated_Test.am
+
+noinst_PROGRAMS = colocated_test
+
+colocated_test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+colocated_test_SOURCES = \
+ colocated_test.cpp \
+ Offer_Exporter.h \
+ Offer_Importer.h \
+ Service_Type_Exporter.h \
+ Simple_Dynamic.h \
+ TT_Info.h \
+ ttest_export.h
+
+colocated_test_LDADD = \
+ libTTest.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.Trading_Export_Test.am
+
+noinst_PROGRAMS += export_test
+
+export_test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+export_test_SOURCES = \
+ export_test.cpp \
+ Offer_Exporter.h \
+ Offer_Importer.h \
+ Service_Type_Exporter.h \
+ Simple_Dynamic.h \
+ TT_Info.h \
+ ttest_export.h
+
+export_test_LDADD = \
+ libTTest.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.Trading_Import_Test.am
+
+noinst_PROGRAMS += import_test
+
+import_test_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+import_test_SOURCES = \
+ import_test.cpp \
+ Offer_Exporter.h \
+ Offer_Importer.h \
+ Service_Type_Exporter.h \
+ Simple_Dynamic.h \
+ TT_Info.h \
+ ttest_export.h
+
+import_test_LDADD = \
+ libTTest.la \
+ $(TAO_BUILDDIR)/tao/libTAO_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PI.la \
+ $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading_Serv.la \
+ $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_Svc_Utils.la \
+ $(TAO_BUILDDIR)/tao/libTAO_DynamicAny.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading_Skel.la \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosTrading.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp b/TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp
new file mode 100644
index 00000000000..7245e7ddcdf
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Offer_Exporter.cpp
@@ -0,0 +1,634 @@
+// $Id$
+
+#include "Offer_Exporter.h"
+#include "ace/INET_Addr.h"
+#include "ace/OS_NS_stdio.h"
+
+ACE_RCSID(Trading, Offer_Exporter, "$Id$")
+
+TAO_Offer_Exporter::
+TAO_Offer_Exporter (CosTrading::Lookup_ptr lookup_if,
+ CORBA::Boolean verbose
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ : verbose_ (verbose)
+{
+ // Initialize the offer sequences and structures.
+ this->create_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ // Obtain the necessary trading service interfaces.
+ this->register_ = lookup_if->register_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+ this->admin_ = lookup_if->admin_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ // ACE_CHECK;
+}
+
+TAO_Offer_Exporter::~TAO_Offer_Exporter (void)
+{
+ while (! this->clean_up_.is_empty ())
+ {
+ TAO_Dynamic_Property* dp = 0;
+ this->clean_up_.dequeue_head (dp);
+ dp->destroy ();
+ }
+}
+
+void
+TAO_Offer_Exporter::export_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::InvalidObjectRef,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::Register::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Exporting offers.\n"));
+
+ for (int i = 0; i < NUM_OFFERS; i++)
+ {
+ this->props_plotters_[i][4].value <<= "Default";
+ this->props_printers_[i][4].value <<= "Default";
+ this->props_fs_[i][4].value <<= "Default";
+ }
+
+ this->export_to (this->register_.in () ACE_ENV_ARG_PARAMETER);
+ // ACE_CHECK;
+}
+
+void
+TAO_Offer_Exporter::export_to (CosTrading::Register_ptr reg
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::InvalidObjectRef,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::Register::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName))
+{
+ ACE_TRY
+ {
+ for (int i = 0; i < NUM_OFFERS; i++)
+ {
+ CORBA::Object_ptr offer_obj= this->plotter_[i]._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTrading::OfferId_var offer_id =
+ reg->_cxx_export (offer_obj,
+ TT_Info::INTERFACE_NAMES[1],
+ this->props_plotters_[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Registered offer id: %s.\n", offer_id.in ()));
+ }
+
+ offer_obj = this->printer_[i]._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_id = reg->_cxx_export (offer_obj,
+ TT_Info::INTERFACE_NAMES[2],
+ this->props_printers_[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Registered offer id: %s.\n", offer_id.in ()));
+ }
+
+ offer_obj = this->fs_[i]._this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_id = reg->_cxx_export (offer_obj,
+ TT_Info::INTERFACE_NAMES[3],
+ this->props_fs_[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Registered offer id: %s.\n", offer_id.in ()));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Offer_Exporter::export_offers");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ // ACE_CHECK;
+}
+
+void
+TAO_Offer_Exporter::export_offers_to_all (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::InvalidObjectRef,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::Register::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Exporting to all.\n"));
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Obtaining link interface.\n"));
+ }
+
+ CosTrading::Link_var link_if = this->register_->link_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Obtaining references to traders directly"
+ " linked to the root trader.\n"));
+ }
+
+ CosTrading::LinkNameSeq_var link_name_seq = link_if->list_links (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Registering offers with each of the linked"
+ " traders.\n"));
+ }
+
+ for (CORBA::ULong i = link_name_seq->length () - 1; i > 0; i--)
+ {
+ ACE_TRY
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Getting link information for %s\n",
+ static_cast<const char*> (link_name_seq[i])));
+ }
+
+ CosTrading::Link::LinkInfo_var link_info =
+ link_if->describe_link (link_name_seq[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ for (int j = 0; j < NUM_OFFERS; j++)
+ {
+ this->props_plotters_[j][4].value <<= link_name_seq[i];
+ this->props_printers_[j][4].value <<= link_name_seq[i];
+ this->props_fs_[j][4].value <<= link_name_seq[i];
+ }
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Exporting offers to %s\n",
+ static_cast<const char*> (link_name_seq[i])));
+ }
+
+ this->export_to (link_info->target_reg.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ // @@ IGNORE??
+ }
+ ACE_ENDTRY;
+ }
+}
+
+
+void
+TAO_Offer_Exporter::withdraw_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Withdrawing all offers.\n"));
+
+ ACE_TRY
+ {
+ CORBA::ULong length;
+
+ CosTrading::OfferIdSeq_var offer_id_seq = this->grab_offerids (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (offer_id_seq.ptr () != 0)
+ {
+ length = offer_id_seq->length ();
+ for (CORBA::ULong i = 0; i < length; i++)
+ {
+ this->register_->withdraw (offer_id_seq[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Offer_Exporter::withdraw_offers");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Offer_Exporter::describe_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Describing all offers.\n"));
+
+ ACE_TRY
+ {
+ CORBA::ULong length;
+ CosTrading::OfferIdSeq_var offer_id_seq = this->grab_offerids (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (offer_id_seq.ptr () != 0)
+ {
+ length = offer_id_seq->length ();
+
+ if (this->verbose_)
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+
+ for (CORBA::ULong i = 0; i < length; i++)
+ {
+ CosTrading::Register::OfferInfo_var offer_info =
+ this->register_->describe (offer_id_seq[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Offer Id: %s\n", (const char *) offer_id_seq[i]));
+ ACE_DEBUG ((LM_DEBUG, "Service Type: %s\n", offer_info->type.in ()));
+ TT_Info::dump_properties (offer_info->properties, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Offer_Exporter::describe_offers");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Offer_Exporter::modify_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId,
+ CosTrading::IllegalPropertyName,
+ CosTrading::Register::UnknownPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::Register::MandatoryProperty,
+ CosTrading::Register::ReadonlyProperty,
+ CosTrading::DuplicatePropertyName))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Modifying all offers.\n"));
+
+ ACE_TRY
+ {
+ CosTrading::OfferIdSeq_var offer_id_seq = this->grab_offerids (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (offer_id_seq.ptr () != 0)
+ {
+ CORBA::ULong length = offer_id_seq->length ();
+ CosTrading::PropertyNameSeq del_list;
+ CosTrading::PropertySeq modify_list;
+
+ del_list.length (1);
+ modify_list.length (2);
+ del_list[0] = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::DESCRIPTION];
+ modify_list[0].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::LOCATION];
+ modify_list[0].value <<= "MODIFIED";
+ modify_list[1].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::MISCELLANEOUS];
+ modify_list[1].value <<= "MODIFIED";
+
+ for (CORBA::ULong i = 0; i < length; i++)
+ {
+ this->register_->modify (offer_id_seq[i],
+ del_list,
+ modify_list
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Offer_Exporter::modify_offers");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Offer_Exporter::
+withdraw_offers_using_constraints (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Register::NoMatchingOffers))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Exporter::Withdrawing with constraint.\n"));
+
+ const char* constraint =
+ "(not exist Description) and (Location == 'MODIFIED') and (exist Name)";
+
+ if (this->verbose_)
+ ACE_DEBUG ((LM_DEBUG, "Constraint: %s\n", constraint));
+
+ ACE_TRY
+ {
+ this->register_->
+ withdraw_using_constraint (TT_Info::INTERFACE_NAMES[TT_Info::PLOTTER],
+ constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->register_->
+ withdraw_using_constraint (TT_Info::INTERFACE_NAMES[TT_Info::PRINTER],
+ constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->register_->
+ withdraw_using_constraint (TT_Info::INTERFACE_NAMES[TT_Info::FILESYSTEM],
+ constraint
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Offer_Exporter::withdraw_using_constraint");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+CosTrading::OfferIdSeq*
+TAO_Offer_Exporter::grab_offerids (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented))
+{
+ if (this->verbose_)
+ ACE_DEBUG ((LM_DEBUG, "TAO_Offer_Exporter::Grabbing all offer ids.\n"));
+
+ CosTrading::OfferIdSeq *offer_id_seq;
+ ACE_TRY
+ {
+ CORBA::ULong length = NUM_OFFERS;
+ CosTrading::OfferIdIterator_ptr offer_id_iter;
+
+ this->admin_->list_offers (NUM_OFFERS,
+ CosTrading::OfferIdSeq_out (offer_id_seq),
+ CosTrading::OfferIdIterator_out (offer_id_iter)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if ((! CORBA::is_nil (offer_id_iter)) && offer_id_seq != 0)
+ {
+ CORBA::Boolean any_left = 0;
+ CosTrading::OfferIdSeq *id_seq;
+ CosTrading::OfferIdIterator_var offer_id_iter_var (offer_id_iter);
+
+ do
+ {
+ any_left =
+ offer_id_iter->next_n (length,
+ CosTrading::OfferIdSeq_out (id_seq)
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int offers = id_seq->length ();
+ int old_length = offer_id_seq->length ();
+ offer_id_seq->length (old_length + offers);
+
+ for (int i = 0; i < offers; i++)
+ (*offer_id_seq)[i + old_length] = (*id_seq)[i];
+
+ delete id_seq;
+ }
+ while (any_left);
+
+ offer_id_iter->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "The following offer ids are registered:\n"));
+ for (int len = offer_id_seq->length (), j = 0; j < len; j++)
+ ACE_DEBUG ((LM_DEBUG, "Offer Id: %s\n", (const char *)(*offer_id_seq)[j]));
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Offer_Exporter::grab_offerids");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ // @@ redundant.
+ // ACE_CHECK_RETURN (offer_id_seq);
+
+ return offer_id_seq;
+}
+
+void
+TAO_Offer_Exporter::create_offers (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ const int QUEUE_SIZE = 4;
+
+ int counter = 0, i = 0;
+ char name[BUFSIZ];
+ char description[BUFSIZ];
+ CORBA::Any extra_info;
+ TAO_Trader_Test::StringSeq string_seq (QUEUE_SIZE);
+ TAO_Trader_Test::ULongSeq ulong_seq (QUEUE_SIZE);
+
+ CosTradingDynamic::DynamicProp* dp_user_queue;
+ CosTradingDynamic::DynamicProp* dp_file_queue;
+ CosTradingDynamic::DynamicProp* dp_space_left;
+
+ ACE_INET_Addr addr ((u_short) 0);
+ const char* hostname = addr.get_host_name ();
+
+ // Initialize plotters
+ string_seq.length (QUEUE_SIZE);
+ ulong_seq.length (QUEUE_SIZE);
+ for (i = 0; i < NUM_OFFERS; i++)
+ {
+ ACE_OS::sprintf (name, "Plotter #%d", i);
+ ACE_OS::sprintf (description,
+ "%s is a plotter. It plots stuff.",
+ name);
+
+ for (int j = 0; j < QUEUE_SIZE; j++, counter = (counter + 1) % NUM_OFFERS)
+ {
+ string_seq[j] = TT_Info::USERS [counter];
+ ulong_seq[j] = counter * 10000;
+ }
+
+ TAO_Dynamic_Property* user_queue =
+ new TAO_Simple_Dynamic_Property<TAO_Trader_Test::StringSeq> (string_seq);
+ TAO_Dynamic_Property* file_sizes =
+ new TAO_Simple_Dynamic_Property<TAO_Trader_Test::ULongSeq> (ulong_seq);
+
+ this->clean_up_.enqueue_head (user_queue);
+ this->clean_up_.enqueue_head (file_sizes);
+
+ dp_user_queue = user_queue->construct_dynamic_prop
+ (TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_USER_QUEUE],
+ TAO_Trader_Test::_tc_StringSeq,
+ extra_info);
+
+ dp_file_queue = file_sizes->construct_dynamic_prop
+ (TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_FILE_SIZES_PENDING],
+ TAO_Trader_Test::_tc_ULongSeq,
+ extra_info);
+
+ this->props_plotters_[i].length (11);
+ this->props_plotters_[i][0].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::NAME];
+ this->props_plotters_[i][0].value <<= name;
+ this->props_plotters_[i][1].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::LOCATION];
+ this->props_plotters_[i][1].value <<= TT_Info::LOCATIONS[i];
+ this->props_plotters_[i][2].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::DESCRIPTION];
+ this->props_plotters_[i][2].value <<= description;
+ this->props_plotters_[i][3].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::HOST_NAME];
+ this->props_plotters_[i][3].value <<= hostname;
+ this->props_plotters_[i][4].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::TRADER_NAME];
+ this->props_plotters_[i][4].value <<= "Default";
+ this->props_plotters_[i][5].name = TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_NUM_COLORS];
+ this->props_plotters_[i][5].value <<= (CORBA::Long)(i * 2);
+ this->props_plotters_[i][6].name = TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_AUTO_LOADING];
+ this->props_plotters_[i][6].value <<= CORBA::Any::from_boolean ((CORBA::Boolean) (i % 2));
+ this->props_plotters_[i][7].name = TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_COST_PER_PAGE];
+ this->props_plotters_[i][7].value <<= (CORBA::Float) i;
+ this->props_plotters_[i][8].name = TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_MODEL_NUMBER];
+ this->props_plotters_[i][8].value <<= TT_Info::MODEL_NUMBERS[i];
+ this->props_plotters_[i][9].name = TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_USER_QUEUE];
+ this->props_plotters_[i][9].value <<= dp_user_queue;
+
+ this->props_plotters_[i][10].name = TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_FILE_SIZES_PENDING];
+ this->props_plotters_[i][10].value <<= dp_file_queue;
+ }
+
+ // Initialize printers
+ for (i = 0; i < NUM_OFFERS; i++)
+ {
+ ACE_OS::sprintf (name, "Printer #%d", i);
+ ACE_OS::sprintf (description,
+ "%s is a printer. It prints stuff.",
+ name);
+
+ for (int j = 0; j < QUEUE_SIZE; j++, counter = (counter + 1) % NUM_OFFERS)
+ {
+ string_seq[j] = TT_Info::USERS [counter];
+ ulong_seq[j] = counter * 10000;
+ }
+
+ TAO_Dynamic_Property* user_queue =
+ new TAO_Simple_Dynamic_Property<TAO_Trader_Test::StringSeq> (string_seq);
+ TAO_Dynamic_Property* file_sizes =
+ new TAO_Simple_Dynamic_Property<TAO_Trader_Test::ULongSeq> (ulong_seq);
+
+ this->clean_up_.enqueue_head (user_queue);
+ this->clean_up_.enqueue_head (file_sizes);
+
+ dp_user_queue = user_queue->construct_dynamic_prop
+ (TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PLOTTER_USER_QUEUE],
+ TAO_Trader_Test::_tc_StringSeq,
+ extra_info);
+
+ dp_file_queue = file_sizes->construct_dynamic_prop
+ (TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PLOTTER_FILE_SIZES_PENDING],
+ TAO_Trader_Test::_tc_ULongSeq,
+ extra_info);
+
+ this->props_printers_[i].length (12);
+ this->props_printers_[i][0].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::NAME];
+ this->props_printers_[i][0].value <<= name;
+ this->props_printers_[i][1].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::LOCATION];
+ this->props_printers_[i][1].value <<= TT_Info::LOCATIONS[i];
+ this->props_printers_[i][2].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::DESCRIPTION];
+ this->props_printers_[i][2].value <<= description;
+ this->props_printers_[i][3].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::HOST_NAME];
+ this->props_printers_[i][3].value <<= hostname;
+ this->props_printers_[i][4].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::TRADER_NAME];
+ this->props_printers_[i][4].value <<= "Default";
+ this->props_printers_[i][5].name = TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_COLOR];
+ this->props_printers_[i][5].value <<= CORBA::Any::from_boolean ((CORBA::Boolean) (i % 2));
+ this->props_printers_[i][6].name = TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_DOUBLE_SIDED];
+ this->props_printers_[i][6].value <<= CORBA::Any::from_boolean ((CORBA::Boolean) ((i + 1) % 2));
+ this->props_printers_[i][7].name = TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_COST_PER_PAGE];
+ this->props_printers_[i][7].value <<= (CORBA::Float) i;
+ this->props_printers_[i][8].name = TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_MODEL_NUMBER];
+ this->props_printers_[i][8].value <<= TT_Info::MODEL_NUMBERS[i];
+ this->props_printers_[i][9].name = TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_PAGES_PER_SEC];
+ this->props_printers_[i][9].value <<= (CORBA::UShort) i;
+ this->props_printers_[i][10].name = TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_USER_QUEUE];
+ this->props_printers_[i][10].value <<= dp_user_queue;
+ this->props_printers_[i][11].name = TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_FILE_SIZES_PENDING];
+ this->props_printers_[i][11].value <<= dp_file_queue;
+ }
+
+ // Initialize FileSystem
+ for (i = 0; i < NUM_OFFERS; i++)
+ {
+ ACE_OS::sprintf (name, "File System #%d", i);
+ ACE_OS::sprintf (description,
+ "%s is a File System. It stores stuff.",
+ name);
+
+ TAO_Dynamic_Property* space_left =
+ new TAO_Simple_Dynamic_Property<CORBA::ULong> (i * 4434343);
+
+ this->clean_up_.enqueue_head (space_left);
+
+ dp_space_left = space_left->construct_dynamic_prop
+ (TT_Info::FILESYSTEM_PROPERTY_NAMES[TT_Info::SPACE_REMAINING],
+ CORBA::_tc_ulong,
+ extra_info);
+
+ this->props_fs_[i].length (8);
+ this->props_fs_[i][0].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::NAME];
+ this->props_fs_[i][0].value <<= name;
+ this->props_fs_[i][1].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::LOCATION];
+ this->props_fs_[i][1].value <<= TT_Info::LOCATIONS[i];
+ this->props_fs_[i][2].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::DESCRIPTION];
+ this->props_fs_[i][2].value <<= description;
+ this->props_fs_[i][3].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::HOST_NAME];
+ this->props_fs_[i][3].value <<= hostname;
+ this->props_fs_[i][4].name = TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::TRADER_NAME];
+ this->props_fs_[i][4].value <<= "Default";
+ this->props_fs_[i][5].name = TT_Info::FILESYSTEM_PROPERTY_NAMES[TT_Info::DISK_SIZE];
+ this->props_fs_[i][5].value <<= (CORBA::ULong) (i * 2000000);
+ this->props_fs_[i][6].name = TT_Info::FILESYSTEM_PROPERTY_NAMES[TT_Info::PERMISSION_LEVEL];
+ this->props_fs_[i][6].value <<= (CORBA::UShort) (i + 1);
+ this->props_fs_[i][7].name = TT_Info::FILESYSTEM_PROPERTY_NAMES[TT_Info::SPACE_REMAINING];
+ this->props_fs_[i][7].value <<= dp_space_left;
+ }
+}
diff --git a/TAO/orbsvcs/tests/Trading/Offer_Exporter.h b/TAO/orbsvcs/tests/Trading/Offer_Exporter.h
new file mode 100644
index 00000000000..63389ae3a79
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Offer_Exporter.h
@@ -0,0 +1,143 @@
+// $Id$
+
+// ========================================================================
+//
+// = FILE
+// Offer_Exporter.h
+//
+// = DESCRIPTION
+// Class that tests the Trading Service's Register Interface
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// =======================================================================
+
+#ifndef TAO_OFFER_EXPORTER_H
+#define TAO_OFFER_EXPORTER_H
+
+#include "TT_Info.h"
+#include "Simple_Dynamic.h"
+#include "ttest_export.h"
+
+class TAO_TTest_Export TAO_Offer_Exporter
+{
+public:
+
+ TAO_Offer_Exporter (CosTrading::Lookup_ptr lookup_if,
+ CORBA::Boolean verbose
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ ~TAO_Offer_Exporter (void);
+
+ void export_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::InvalidObjectRef,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::Register::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName));
+ // Export a number of offers to the Trading Service.
+
+ void export_offers_to_all (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::InvalidObjectRef,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::Register::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName));
+ // Export a number of offers to all traders accessible by the
+ // bootstrapped trader.
+
+ void withdraw_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId));
+ // Withdraw all exported offers.
+
+ void describe_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId));
+ // Describe all the offers registered with the bootstrapped trader.
+
+ void modify_offers (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented,
+ CosTrading::IllegalOfferId,
+ CosTrading::UnknownOfferId,
+ CosTrading::Register::ProxyOfferId,
+ CosTrading::IllegalPropertyName,
+ CosTrading::Register::UnknownPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::Register::MandatoryProperty,
+ CosTrading::Register::ReadonlyProperty,
+ CosTrading::DuplicatePropertyName));
+ // Remove some properties and change some properties in each offer.
+
+ void withdraw_offers_using_constraints (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Register::NoMatchingOffers));
+ // Withdraw a number of offers based on a constraint string.
+
+private:
+
+ CosTrading::OfferIdSeq* grab_offerids (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::NotImplemented));
+
+ void create_offers (ACE_ENV_SINGLE_ARG_DECL);
+ // Fill in each of the offer structures.
+
+ void export_to (CosTrading::Register_ptr reg
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::Register::InvalidObjectRef,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::Register::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::PropertyTypeMismatch,
+ CosTrading::ReadonlyDynamicProperty,
+ CosTrading::MissingMandatoryProperty,
+ CosTrading::DuplicatePropertyName));
+ // Export the offers to the give Register interface.
+
+ typedef ACE_Unbounded_Queue<TAO_Dynamic_Property*> DP_Queue;
+
+ CORBA::Boolean verbose_;
+ // True if the user wants verbose output.
+
+ CosTrading::Register_var register_;
+ CosTrading::Admin_var admin_;
+
+ TT_Info::Printer printer_[NUM_OFFERS];
+ TT_Info::Plotter plotter_[NUM_OFFERS];
+ TT_Info::File_System fs_[NUM_OFFERS];
+ // The objects being exported.
+
+ CosTrading::PropertySeq props_plotters_[NUM_OFFERS];
+ CosTrading::PropertySeq props_printers_[NUM_OFFERS];
+ CosTrading::PropertySeq props_fs_[NUM_OFFERS];
+ // Property sequences describing each service.
+
+ DP_Queue clean_up_;
+ // A list of dynamic properties to clean up upon destruction.
+};
+
+#endif /* TAO_OFFER_EXPORTER_H */
diff --git a/TAO/orbsvcs/tests/Trading/Offer_Importer.cpp b/TAO/orbsvcs/tests/Trading/Offer_Importer.cpp
new file mode 100644
index 00000000000..13f5084d1f6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Offer_Importer.cpp
@@ -0,0 +1,304 @@
+// $Id$
+
+#include "Offer_Importer.h"
+
+ACE_RCSID(Trading, Offer_Importer, "$Id$")
+
+TAO_Offer_Importer::TAO_Offer_Importer (CosTrading::Lookup_ptr lookup_if,
+ CORBA::Boolean verbose)
+ : verbose_ (verbose),
+ lookup_ (lookup_if)
+{
+}
+
+void
+TAO_Offer_Importer::perform_queries (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Lookup::IllegalPreference,
+ CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Importer::Federated Query.\n"));
+
+ TAO_Policy_Creator policies;
+ policies.exact_type_match (0);
+ policies.search_card (16*NUM_OFFERS);
+ policies.match_card (16*NUM_OFFERS);
+ policies.return_card (16*NUM_OFFERS);
+ policies.link_follow_rule (CosTrading::always);
+
+ this->perform_queries_with_policies (policies ACE_ENV_ARG_PARAMETER);
+ // ACE_CHECK;
+}
+
+void
+TAO_Offer_Importer::perform_directed_queries (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Lookup::IllegalPreference,
+ CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Offer_Importer::Directed Query.\n"));
+
+ TAO_Policy_Creator policies;
+ policies.exact_type_match (0);
+ policies.search_card (16*NUM_OFFERS);
+ policies.match_card (16*NUM_OFFERS);
+ policies.return_card (16*NUM_OFFERS);
+ policies.link_follow_rule (CosTrading::local_only);
+
+ if (this->verbose_)
+ ACE_DEBUG ((LM_DEBUG, "Obtaining link interface.\n"));
+ CosTrading::Link_var link_if = this->lookup_->link_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Obtaining references to traders directly"
+ " linked to the root trader.\n"));
+ }
+ CosTrading::LinkNameSeq_var link_name_seq = link_if->list_links (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (link_name_seq->length () > 0)
+ {
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Getting link information for %s\n",
+ static_cast<const char*> (link_name_seq[0u])));
+ }
+
+ CosTrading::Link::LinkInfo_var link_info =
+ link_if->describe_link (link_name_seq[0u] ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosTrading::Lookup_ptr lookup_if = link_info->target.in ();
+ CosTrading::Link_var link_if2 = lookup_if->link_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosTrading::LinkNameSeq_var link_name_seq2 = link_if2->list_links (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (link_name_seq2->length () > 0)
+ {
+ CORBA::ULong i = 0;
+ CORBA::ULong length = link_name_seq2->length ();
+ for (i = 0; i < length; i++)
+ {
+ if (ACE_OS::strcmp (link_name_seq2[i], "Bootstrap") != 0)
+ break;
+ }
+
+ if (i < length)
+ {
+ CosTrading::LinkName* trader_name =
+ CosTrading::TraderName::allocbuf (2);
+
+ ACE_DEBUG ((LM_DEBUG, "*** Query through %s to destination %s.\n",
+ static_cast<const char*> (link_name_seq[0u]),
+ static_cast<const char*> (link_name_seq2[i])));
+
+ trader_name[0] = CORBA::string_dup (link_name_seq[0u]);
+ trader_name[1] = CORBA::string_dup (link_name_seq2[i]);
+ policies.starting_trader (new CosTrading::TraderName
+ (2, 2, trader_name, 1));
+
+ this->perform_queries_with_policies (policies ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "This test requires a complete"
+ " graph of three traders.\n"));
+ }
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "This test requires a complete"
+ " graph of three traders.\n"));
+ }
+}
+
+
+void
+TAO_Offer_Importer::perform_queries_with_policies (
+ const TAO_Policy_Creator& policies
+ ACE_ENV_ARG_DECL
+ )
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Lookup::IllegalPreference,
+ CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName))
+{
+ ACE_TRY
+ {
+ CosTrading::Lookup::SpecifiedProps desired_props;
+
+ char* props[] =
+ {
+ (char*) TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::NAME],
+ (char*) TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::DESCRIPTION],
+ (char*) TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::LOCATION],
+ (char*) TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::HOST_NAME]
+ };
+
+ CosTrading::PropertyNameSeq prop_name_seq (4, 4, props, 0);
+ desired_props.prop_names (prop_name_seq);
+
+ for (int i = 0; i < TT_Info::NUM_QUERIES; i++)
+ {
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ ACE_DEBUG ((LM_DEBUG, "*** Performing query for %s.\n", TT_Info::QUERIES[i][0]));
+ ACE_DEBUG ((LM_DEBUG, "*** Query: %s\n", TT_Info::QUERIES[i][1]));
+ ACE_DEBUG ((LM_DEBUG, "*** Preferences: %s\n", TT_Info::QUERIES[i][2]));
+ CosTrading::OfferSeq *offer_seq_ptr = 0;
+ CosTrading::OfferIterator_ptr offer_iterator_ptr = 0;
+ CosTrading::PolicyNameSeq *limits_applied_ptr = 0;
+
+ CosTrading::OfferSeq_out offer_seq_out (offer_seq_ptr);
+ CosTrading::OfferIterator_out offer_iterator_out (offer_iterator_ptr);
+ CosTrading::PolicyNameSeq_out limits_applied_out (limits_applied_ptr);
+
+ this->lookup_->query (TT_Info::QUERIES[i][0],
+ TT_Info::QUERIES[i][1],
+ TT_Info::QUERIES[i][2],
+ policies.policy_seq (),
+ desired_props,
+ 8,
+ offer_seq_out,
+ offer_iterator_out,
+ limits_applied_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTrading::OfferSeq_var offer_seq (offer_seq_ptr);
+ CosTrading::OfferIterator_var offer_iterator (offer_iterator_ptr);
+ CosTrading::PolicyNameSeq_var limits_applied (limits_applied_ptr);
+
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "*** Results:\n\n"));
+ this->display_results (*offer_seq_ptr,
+ offer_iterator_ptr
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (limits_applied_out->length () > 0)
+ ACE_DEBUG ((LM_DEBUG, "*** Limits Applied:\n\n"));
+
+ for (int length = limits_applied_out->length (), j = 0; j < length; j++)
+ {
+ const char *policy_name = (*limits_applied_ptr)[j];
+ ACE_DEBUG ((LM_DEBUG, "%s\n",
+ static_cast<const char*> (policy_name)));
+ }
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Offer_Importer::perform_queries");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Offer_Importer::display_results (const CosTrading::OfferSeq& offer_seq,
+ CosTrading::OfferIterator_ptr offer_iterator
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ CORBA::ULong length = 0, i = 0;
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ ACE_DEBUG ((LM_DEBUG, "Offers in the sequence:\n"));
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ for (length = offer_seq.length (), i = 0; i < length; i++)
+ {
+ // Call back to the exported object.
+ TAO_Trader_Test::Remote_Output_var remote_output =
+ TAO_Trader_Test::Remote_Output::_narrow (offer_seq[i].reference.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ remote_output->confirm (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TT_Info::dump_properties (offer_seq[i].properties, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ }
+
+ ACE_DEBUG ((LM_DEBUG, " Offers in the iterator:\n"));
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ if (! CORBA::is_nil (offer_iterator))
+ {
+ length = offer_seq.length ();
+ CORBA::Boolean any_left = 0;
+
+ do
+ {
+ CosTrading::OfferSeq *iter_offers_ptr;
+ CosTrading::OfferSeq_out iter_offers_out (iter_offers_ptr);
+
+ any_left = offer_iterator->next_n (length,
+ iter_offers_out
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTrading::OfferSeq_var iter_offers (iter_offers_ptr);
+ for (length = iter_offers->length (), i = 0; i < length; i++)
+ {
+ // Call back to the exported object.
+ TAO_Trader_Test::Remote_Output_var remote_output =
+ TAO_Trader_Test::Remote_Output::_narrow (offer_seq[i].reference.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ remote_output->confirm (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CosTrading::PropertySeq& props = iter_offers[i].properties;
+ TT_Info::dump_properties (props, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ }
+
+ } while (any_left);
+
+ offer_iterator->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Offer_Importer::display_results");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
diff --git a/TAO/orbsvcs/tests/Trading/Offer_Importer.h b/TAO/orbsvcs/tests/Trading/Offer_Importer.h
new file mode 100644
index 00000000000..2a5e78885b3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Offer_Importer.h
@@ -0,0 +1,96 @@
+// $Id$
+
+// ========================================================================
+//
+// = FILE
+// Offer_Importer.h
+//
+// = DESCRIPTION
+// Class that tests the Trading Service's Lookup Interface
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// =======================================================================
+
+#ifndef TAO_OFFER_IMPORTER
+#define TAO_OFFER_IMPORTER
+
+#include "TT_Info.h"
+#include "ace/Task_T.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/Trader/Trader_Utils.h"
+#include "ttest_export.h"
+
+class TAO_TTest_Export TAO_Offer_Importer
+{
+public:
+
+ TAO_Offer_Importer (CosTrading::Lookup_ptr lookup_if,
+ CORBA::Boolean verbose = 1);
+
+ void perform_queries (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Lookup::IllegalPreference,
+ CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName));
+ // Barrage the bootstrapped-to trader with queries.
+
+ void perform_directed_queries (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Lookup::IllegalPreference,
+ CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName));
+ // Direct a query to a trader two graph edges distant from the
+ // bootstrapped-to trader.
+
+private:
+
+ void perform_queries_with_policies (const TAO_Policy_Creator& policy_manager
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTrading::IllegalConstraint,
+ CosTrading::Lookup::IllegalPreference,
+ CosTrading::Lookup::IllegalPolicyName,
+ CosTrading::Lookup::PolicyTypeMismatch,
+ CosTrading::Lookup::InvalidPolicyValue,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTrading::DuplicatePolicyName));
+ // Perform a query on the bootstrapped-to trader given the policies
+ // pass in <policy_manager>.
+
+ void display_results (const CosTrading::OfferSeq& offer_seq,
+ CosTrading::OfferIterator_ptr offer_iterator
+ ACE_ENV_ARG_DECL) const
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // Display the results of the query to the screen.
+
+ CORBA::Boolean verbose_;
+ // Output the contents of each returned offer, if true.
+
+ CosTrading::Lookup_ptr lookup_;
+ // The interface on which to perform all those wonderful queries.
+};
+
+#endif /* TAO_OFFER_IMPORTER */
diff --git a/TAO/orbsvcs/tests/Trading/README b/TAO/orbsvcs/tests/Trading/README
new file mode 100644
index 00000000000..dfc43d6023d
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/README
@@ -0,0 +1,3301 @@
+$Id$
+
+The TAO Trading Service Tests
+
+Thank you for your interest in the TAO Trading Service. Documentation
+on using the Trading Service and its tests can be found in:
+
+ $TAO_ROOT/docs/releasenotes/trader.html
+
+Just for reference, a correct execution of the tests is included below:
+
+Enjoy!
+
+> export_test
+
+*** Bootstrap to the Lookup interface.
+*** Narrowing the lookup interface.
+*** Running the Service Type Exporter tests.
+*** TAO_Service_Type_Exporter::removing all types from the Repository.
+Service type not yet registered: PostScript_Printer
+Service type not yet registered: File_System
+Service type not yet registered: Printer
+Service type not yet registered: Plotter
+Service type not yet registered: Remote_IO
+*** TAO_Service_Type_Exporter::adding all types to the Repository.
+*** TAO_Service_Type_Exporter::removing all types from the Repository.
+*** TAO_Service_Type_Exporter::adding all types to the Repository.
+*** TAO_Service_Type_Exporter::listing all types in the Repository.
+type name: Plotter
+type name: Printer
+type name: Remote_IO
+type name: File_System
+type name: PostScript_Printer
+*** TAO_Service_Type_Exporter::describing all types in the Repository.
+Type Name: Remote_IO
+Interface Name: IDL:TAO_Trader_Test/Remote_Output:1.0
+Property: Miscellaneous Mode: Normal
+Property: Trader_Name Mode: Normal
+Property: Host_Name Mode: Mandatory
+Property: Description Mode: Normal
+Property: Location Mode: Mandatory
+Property: Name Mode: Mandatory and Readonly
+------------------------------
+Type Name: Plotter
+Interface Name: IDL:TAO_Trader_Test/Plotter:1.0
+Super Type: Remote_IO
+Property: File_Sizes_Pending Mode: Normal
+Property: User_Queue Mode: Normal
+Property: Model_Number Mode: Read only
+Property: Cost_Per_Page Mode: Normal
+Property: Auto_Loading Mode: Read only
+Property: Num_Colors Mode: Normal
+------------------------------
+Type Name: Printer
+Interface Name: IDL:TAO_Trader_Test/Printer:1.0
+Super Type: Remote_IO
+Property: File_Sizes_Pending Mode: Normal
+Property: User_Queue Mode: Normal
+Property: Pages_Per_Sec Mode: Read only
+Property: Model_Number Mode: Read only
+Property: Cost_Per_Page Mode: Normal
+Property: Double_Sided Mode: Read only
+Property: Color Mode: Mandatory and Readonly
+------------------------------
+Type Name: File_System
+Interface Name: IDL:TAO_Trader_Test/File_System:1.0
+Super Type: Remote_IO
+Property: Permission_Level Mode: Normal
+Property: Space_Remaining Mode: Normal
+Property: Disk_Space Mode: Mandatory and Readonly
+------------------------------
+Type Name: PostScript_Printer
+Interface Name: IDL:TAO_Trader_Test/PostScript_Printer:1.0
+Super Type: Printer
+Property: Version Mode: Mandatory and Readonly
+------------------------------
+*** TAO_Service_Type_Exporter::fully describing all types in the Repository.
+Type Name: Remote_IO
+Interface Name: IDL:TAO_Trader_Test/Remote_Output:1.0
+Property: Name Mode: Mandatory and Readonly
+Property: Location Mode: Mandatory
+Property: Description Mode: Normal
+Property: Host_Name Mode: Mandatory
+Property: Trader_Name Mode: Normal
+Property: Miscellaneous Mode: Normal
+------------------------------
+Type Name: Plotter
+Interface Name: IDL:TAO_Trader_Test/Plotter:1.0
+Super Type: Remote_IO
+Property: Name Mode: Mandatory and Readonly
+Property: Location Mode: Mandatory
+Property: Description Mode: Normal
+Property: Host_Name Mode: Mandatory
+Property: Trader_Name Mode: Normal
+Property: Miscellaneous Mode: Normal
+Property: Num_Colors Mode: Normal
+Property: Auto_Loading Mode: Read only
+Property: Cost_Per_Page Mode: Normal
+Property: Model_Number Mode: Read only
+Property: User_Queue Mode: Normal
+Property: File_Sizes_Pending Mode: Normal
+------------------------------
+Type Name: Printer
+Interface Name: IDL:TAO_Trader_Test/Printer:1.0
+Super Type: Remote_IO
+Property: Name Mode: Mandatory and Readonly
+Property: Location Mode: Mandatory
+Property: Description Mode: Normal
+Property: Host_Name Mode: Mandatory
+Property: Trader_Name Mode: Normal
+Property: Miscellaneous Mode: Normal
+Property: Color Mode: Mandatory and Readonly
+Property: Double_Sided Mode: Read only
+Property: Cost_Per_Page Mode: Normal
+Property: Model_Number Mode: Read only
+Property: Pages_Per_Sec Mode: Read only
+Property: User_Queue Mode: Normal
+Property: File_Sizes_Pending Mode: Normal
+------------------------------
+Type Name: File_System
+Interface Name: IDL:TAO_Trader_Test/File_System:1.0
+Super Type: Remote_IO
+Property: Name Mode: Mandatory and Readonly
+Property: Location Mode: Mandatory
+Property: Description Mode: Normal
+Property: Host_Name Mode: Mandatory
+Property: Trader_Name Mode: Normal
+Property: Miscellaneous Mode: Normal
+Property: Disk_Space Mode: Mandatory and Readonly
+Property: Space_Remaining Mode: Normal
+Property: Permission_Level Mode: Normal
+------------------------------
+Type Name: PostScript_Printer
+Interface Name: IDL:TAO_Trader_Test/PostScript_Printer:1.0
+Super Type: Remote_IO
+Super Type: Printer
+Property: Name Mode: Mandatory and Readonly
+Property: Location Mode: Mandatory
+Property: Description Mode: Normal
+Property: Host_Name Mode: Mandatory
+Property: Trader_Name Mode: Normal
+Property: Miscellaneous Mode: Normal
+Property: Color Mode: Mandatory and Readonly
+Property: Double_Sided Mode: Read only
+Property: Cost_Per_Page Mode: Normal
+Property: Model_Number Mode: Read only
+Property: Pages_Per_Sec Mode: Read only
+Property: User_Queue Mode: Normal
+Property: File_Sizes_Pending Mode: Normal
+Property: Version Mode: Mandatory and Readonly
+------------------------------
+*** Service Type Exporter tests complete.
+*** Running the Offer Exporter tests.
+*** TAO_Offer_Exporter::Withdrawing all offers.
+TAO_Offer_Exporter::Grabbing all offer ids.
+The following offer ids are registered:
+*** TAO_Offer_Exporter::Exporting offers.
+Registered offer id: 0000000000000001Plotter.
+Registered offer id: 0000000000000001Printer.
+Registered offer id: 0000000000000001File_System.
+Registered offer id: 0000000000000002Plotter.
+Registered offer id: 0000000000000002Printer.
+Registered offer id: 0000000000000002File_System.
+Registered offer id: 0000000000000003Plotter.
+Registered offer id: 0000000000000003Printer.
+Registered offer id: 0000000000000003File_System.
+Registered offer id: 0000000000000004Plotter.
+Registered offer id: 0000000000000004Printer.
+Registered offer id: 0000000000000004File_System.
+Registered offer id: 0000000000000005Plotter.
+Registered offer id: 0000000000000005Printer.
+Registered offer id: 0000000000000005File_System.
+Registered offer id: 0000000000000006Plotter.
+Registered offer id: 0000000000000006Printer.
+Registered offer id: 0000000000000006File_System.
+Registered offer id: 0000000000000007Plotter.
+Registered offer id: 0000000000000007Printer.
+Registered offer id: 0000000000000007File_System.
+Registered offer id: 0000000000000008Plotter.
+Registered offer id: 0000000000000008Printer.
+Registered offer id: 0000000000000008File_System.
+Registered offer id: 0000000000000009Plotter.
+Registered offer id: 0000000000000009Printer.
+Registered offer id: 0000000000000009File_System.
+Registered offer id: 0000000000000010Plotter.
+Registered offer id: 0000000000000010Printer.
+Registered offer id: 0000000000000010File_System.
+Registered offer id: 0000000000000011Plotter.
+Registered offer id: 0000000000000011Printer.
+Registered offer id: 0000000000000011File_System.
+Registered offer id: 0000000000000012Plotter.
+Registered offer id: 0000000000000012Printer.
+Registered offer id: 0000000000000012File_System.
+Registered offer id: 0000000000000013Plotter.
+Registered offer id: 0000000000000013Printer.
+Registered offer id: 0000000000000013File_System.
+Registered offer id: 0000000000000014Plotter.
+Registered offer id: 0000000000000014Printer.
+Registered offer id: 0000000000000014File_System.
+Registered offer id: 0000000000000015Plotter.
+Registered offer id: 0000000000000015Printer.
+Registered offer id: 0000000000000015File_System.
+*** TAO_Offer_Exporter::Describing all offers.
+TAO_Offer_Exporter::Grabbing all offer ids.
+The following offer ids are registered:
+Offer Id: 0000000000000001File_System
+Offer Id: 0000000000000002File_System
+Offer Id: 0000000000000003File_System
+Offer Id: 0000000000000004File_System
+Offer Id: 0000000000000005File_System
+Offer Id: 0000000000000006File_System
+Offer Id: 0000000000000007File_System
+Offer Id: 0000000000000008File_System
+Offer Id: 0000000000000009File_System
+Offer Id: 0000000000000010File_System
+Offer Id: 0000000000000011File_System
+Offer Id: 0000000000000012File_System
+Offer Id: 0000000000000013File_System
+Offer Id: 0000000000000014File_System
+Offer Id: 0000000000000015File_System
+Offer Id: 0000000000000001Printer
+Offer Id: 0000000000000002Printer
+Offer Id: 0000000000000003Printer
+Offer Id: 0000000000000004Printer
+Offer Id: 0000000000000005Printer
+Offer Id: 0000000000000006Printer
+Offer Id: 0000000000000007Printer
+Offer Id: 0000000000000008Printer
+Offer Id: 0000000000000009Printer
+Offer Id: 0000000000000010Printer
+Offer Id: 0000000000000011Printer
+Offer Id: 0000000000000012Printer
+Offer Id: 0000000000000013Printer
+Offer Id: 0000000000000014Printer
+Offer Id: 0000000000000015Printer
+Offer Id: 0000000000000001Plotter
+Offer Id: 0000000000000002Plotter
+Offer Id: 0000000000000003Plotter
+Offer Id: 0000000000000004Plotter
+Offer Id: 0000000000000005Plotter
+Offer Id: 0000000000000006Plotter
+Offer Id: 0000000000000007Plotter
+Offer Id: 0000000000000008Plotter
+Offer Id: 0000000000000009Plotter
+Offer Id: 0000000000000010Plotter
+Offer Id: 0000000000000011Plotter
+Offer Id: 0000000000000012Plotter
+Offer Id: 0000000000000013Plotter
+Offer Id: 0000000000000014Plotter
+Offer Id: 0000000000000015Plotter
+------------------------------
+Offer Id: 0000000000000001File_System
+Service Type: File_System
+Name : String File System #0
+Location : String Bryan 509
+Description : String File System #0 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 0
+Permission_Level: UShort 1
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000002File_System
+Service Type: File_System
+Name : String File System #1
+Location : String Bryan 503
+Description : String File System #1 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 2000000
+Permission_Level: UShort 2
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000003File_System
+Service Type: File_System
+Name : String File System #2
+Location : String Dunker 102
+Description : String File System #2 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 4000000
+Permission_Level: UShort 3
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000004File_System
+Service Type: File_System
+Name : String File System #3
+Location : String Jolley 408
+Description : String File System #3 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 6000000
+Permission_Level: UShort 4
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000005File_System
+Service Type: File_System
+Name : String File System #4
+Location : String Lopata 401
+Description : String File System #4 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 8000000
+Permission_Level: UShort 5
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000006File_System
+Service Type: File_System
+Name : String File System #5
+Location : String January 110
+Description : String File System #5 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 10000000
+Permission_Level: UShort 6
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000007File_System
+Service Type: File_System
+Name : String File System #6
+Location : String Cupples I 30
+Description : String File System #6 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 12000000
+Permission_Level: UShort 7
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000008File_System
+Service Type: File_System
+Name : String File System #7
+Location : String Cupples II 201
+Description : String File System #7 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 14000000
+Permission_Level: UShort 8
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000009File_System
+Service Type: File_System
+Name : String File System #8
+Location : String Urbauer 321
+Description : String File System #8 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 16000000
+Permission_Level: UShort 9
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000010File_System
+Service Type: File_System
+Name : String File System #9
+Location : String Umrath 302
+Description : String File System #9 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 18000000
+Permission_Level: UShort 10
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000011File_System
+Service Type: File_System
+Name : String File System #10
+Location : String Wilson 110
+Description : String File System #10 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 20000000
+Permission_Level: UShort 11
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000012File_System
+Service Type: File_System
+Name : String File System #11
+Location : String Olin 239
+Description : String File System #11 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 22000000
+Permission_Level: UShort 12
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000013File_System
+Service Type: File_System
+Name : String File System #12
+Location : String Simon 238
+Description : String File System #12 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 24000000
+Permission_Level: UShort 13
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000014File_System
+Service Type: File_System
+Name : String File System #13
+Location : String Rebstock 232
+Description : String File System #13 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 26000000
+Permission_Level: UShort 14
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000015File_System
+Service Type: File_System
+Name : String File System #14
+Location : String McMillan 123
+Description : String File System #14 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 28000000
+Permission_Level: UShort 15
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000001Printer
+Service Type: Printer
+Name : String Printer #0
+Location : String Bryan 509
+Description : String Printer #0 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+Pages_Per_Sec : UShort 0
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000002Printer
+Service Type: Printer
+Name : String Printer #1
+Location : String Bryan 503
+Description : String Printer #1 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+Pages_Per_Sec : UShort 1
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000003Printer
+Service Type: Printer
+Name : String Printer #2
+Location : String Dunker 102
+Description : String Printer #2 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+Pages_Per_Sec : UShort 2
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000004Printer
+Service Type: Printer
+Name : String Printer #3
+Location : String Jolley 408
+Description : String Printer #3 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+Pages_Per_Sec : UShort 3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000005Printer
+Service Type: Printer
+Name : String Printer #4
+Location : String Lopata 401
+Description : String Printer #4 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+Pages_Per_Sec : UShort 4
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000006Printer
+Service Type: Printer
+Name : String Printer #5
+Location : String January 110
+Description : String Printer #5 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+Pages_Per_Sec : UShort 5
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000007Printer
+Service Type: Printer
+Name : String Printer #6
+Location : String Cupples I 30
+Description : String Printer #6 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+Pages_Per_Sec : UShort 6
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000008Printer
+Service Type: Printer
+Name : String Printer #7
+Location : String Cupples II 201
+Description : String Printer #7 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000009Printer
+Service Type: Printer
+Name : String Printer #8
+Location : String Urbauer 321
+Description : String Printer #8 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+Pages_Per_Sec : UShort 8
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000010Printer
+Service Type: Printer
+Name : String Printer #9
+Location : String Umrath 302
+Description : String Printer #9 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+Pages_Per_Sec : UShort 9
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000011Printer
+Service Type: Printer
+Name : String Printer #10
+Location : String Wilson 110
+Description : String Printer #10 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+Pages_Per_Sec : UShort 10
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000012Printer
+Service Type: Printer
+Name : String Printer #11
+Location : String Olin 239
+Description : String Printer #11 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+Pages_Per_Sec : UShort 11
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000013Printer
+Service Type: Printer
+Name : String Printer #12
+Location : String Simon 238
+Description : String Printer #12 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+Pages_Per_Sec : UShort 12
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000014Printer
+Service Type: Printer
+Name : String Printer #13
+Location : String Rebstock 232
+Description : String Printer #13 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+Pages_Per_Sec : UShort 13
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000015Printer
+Service Type: Printer
+Name : String Printer #14
+Location : String McMillan 123
+Description : String Printer #14 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+Pages_Per_Sec : UShort 14
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000001Plotter
+Service Type: Plotter
+Name : String Plotter #0
+Location : String Bryan 509
+Description : String Plotter #0 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 0
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000002Plotter
+Service Type: Plotter
+Name : String Plotter #1
+Location : String Bryan 503
+Description : String Plotter #1 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 2
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000003Plotter
+Service Type: Plotter
+Name : String Plotter #2
+Location : String Dunker 102
+Description : String Plotter #2 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 4
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000004Plotter
+Service Type: Plotter
+Name : String Plotter #3
+Location : String Jolley 408
+Description : String Plotter #3 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 6
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000005Plotter
+Service Type: Plotter
+Name : String Plotter #4
+Location : String Lopata 401
+Description : String Plotter #4 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 8
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000006Plotter
+Service Type: Plotter
+Name : String Plotter #5
+Location : String January 110
+Description : String Plotter #5 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 10
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000007Plotter
+Service Type: Plotter
+Name : String Plotter #6
+Location : String Cupples I 30
+Description : String Plotter #6 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 12
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000008Plotter
+Service Type: Plotter
+Name : String Plotter #7
+Location : String Cupples II 201
+Description : String Plotter #7 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 14
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000009Plotter
+Service Type: Plotter
+Name : String Plotter #8
+Location : String Urbauer 321
+Description : String Plotter #8 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 16
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000010Plotter
+Service Type: Plotter
+Name : String Plotter #9
+Location : String Umrath 302
+Description : String Plotter #9 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 18
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000011Plotter
+Service Type: Plotter
+Name : String Plotter #10
+Location : String Wilson 110
+Description : String Plotter #10 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 20
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000012Plotter
+Service Type: Plotter
+Name : String Plotter #11
+Location : String Olin 239
+Description : String Plotter #11 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 22
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000013Plotter
+Service Type: Plotter
+Name : String Plotter #12
+Location : String Simon 238
+Description : String Plotter #12 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 24
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000014Plotter
+Service Type: Plotter
+Name : String Plotter #13
+Location : String Rebstock 232
+Description : String Plotter #13 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 26
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000015Plotter
+Service Type: Plotter
+Name : String Plotter #14
+Location : String McMillan 123
+Description : String Plotter #14 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 28
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+*** TAO_Offer_Exporter::Modifying all offers.
+TAO_Offer_Exporter::Grabbing all offer ids.
+The following offer ids are registered:
+Offer Id: 0000000000000001File_System
+Offer Id: 0000000000000002File_System
+Offer Id: 0000000000000003File_System
+Offer Id: 0000000000000004File_System
+Offer Id: 0000000000000005File_System
+Offer Id: 0000000000000006File_System
+Offer Id: 0000000000000007File_System
+Offer Id: 0000000000000008File_System
+Offer Id: 0000000000000009File_System
+Offer Id: 0000000000000010File_System
+Offer Id: 0000000000000011File_System
+Offer Id: 0000000000000012File_System
+Offer Id: 0000000000000013File_System
+Offer Id: 0000000000000014File_System
+Offer Id: 0000000000000015File_System
+Offer Id: 0000000000000001Printer
+Offer Id: 0000000000000002Printer
+Offer Id: 0000000000000003Printer
+Offer Id: 0000000000000004Printer
+Offer Id: 0000000000000005Printer
+Offer Id: 0000000000000006Printer
+Offer Id: 0000000000000007Printer
+Offer Id: 0000000000000008Printer
+Offer Id: 0000000000000009Printer
+Offer Id: 0000000000000010Printer
+Offer Id: 0000000000000011Printer
+Offer Id: 0000000000000012Printer
+Offer Id: 0000000000000013Printer
+Offer Id: 0000000000000014Printer
+Offer Id: 0000000000000015Printer
+Offer Id: 0000000000000001Plotter
+Offer Id: 0000000000000002Plotter
+Offer Id: 0000000000000003Plotter
+Offer Id: 0000000000000004Plotter
+Offer Id: 0000000000000005Plotter
+Offer Id: 0000000000000006Plotter
+Offer Id: 0000000000000007Plotter
+Offer Id: 0000000000000008Plotter
+Offer Id: 0000000000000009Plotter
+Offer Id: 0000000000000010Plotter
+Offer Id: 0000000000000011Plotter
+Offer Id: 0000000000000012Plotter
+Offer Id: 0000000000000013Plotter
+Offer Id: 0000000000000014Plotter
+Offer Id: 0000000000000015Plotter
+*** TAO_Offer_Exporter::Describing all offers.
+TAO_Offer_Exporter::Grabbing all offer ids.
+The following offer ids are registered:
+Offer Id: 0000000000000001File_System
+Offer Id: 0000000000000002File_System
+Offer Id: 0000000000000003File_System
+Offer Id: 0000000000000004File_System
+Offer Id: 0000000000000005File_System
+Offer Id: 0000000000000006File_System
+Offer Id: 0000000000000007File_System
+Offer Id: 0000000000000008File_System
+Offer Id: 0000000000000009File_System
+Offer Id: 0000000000000010File_System
+Offer Id: 0000000000000011File_System
+Offer Id: 0000000000000012File_System
+Offer Id: 0000000000000013File_System
+Offer Id: 0000000000000014File_System
+Offer Id: 0000000000000015File_System
+Offer Id: 0000000000000001Printer
+Offer Id: 0000000000000002Printer
+Offer Id: 0000000000000003Printer
+Offer Id: 0000000000000004Printer
+Offer Id: 0000000000000005Printer
+Offer Id: 0000000000000006Printer
+Offer Id: 0000000000000007Printer
+Offer Id: 0000000000000008Printer
+Offer Id: 0000000000000009Printer
+Offer Id: 0000000000000010Printer
+Offer Id: 0000000000000011Printer
+Offer Id: 0000000000000012Printer
+Offer Id: 0000000000000013Printer
+Offer Id: 0000000000000014Printer
+Offer Id: 0000000000000015Printer
+Offer Id: 0000000000000001Plotter
+Offer Id: 0000000000000002Plotter
+Offer Id: 0000000000000003Plotter
+Offer Id: 0000000000000004Plotter
+Offer Id: 0000000000000005Plotter
+Offer Id: 0000000000000006Plotter
+Offer Id: 0000000000000007Plotter
+Offer Id: 0000000000000008Plotter
+Offer Id: 0000000000000009Plotter
+Offer Id: 0000000000000010Plotter
+Offer Id: 0000000000000011Plotter
+Offer Id: 0000000000000012Plotter
+Offer Id: 0000000000000013Plotter
+Offer Id: 0000000000000014Plotter
+Offer Id: 0000000000000015Plotter
+------------------------------
+Offer Id: 0000000000000001File_System
+Service Type: File_System
+Name : String File System #0
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 0
+Permission_Level: UShort 1
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000002File_System
+Service Type: File_System
+Name : String File System #1
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 2000000
+Permission_Level: UShort 2
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000003File_System
+Service Type: File_System
+Name : String File System #2
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 4000000
+Permission_Level: UShort 3
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000004File_System
+Service Type: File_System
+Name : String File System #3
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 6000000
+Permission_Level: UShort 4
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000005File_System
+Service Type: File_System
+Name : String File System #4
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 8000000
+Permission_Level: UShort 5
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000006File_System
+Service Type: File_System
+Name : String File System #5
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 10000000
+Permission_Level: UShort 6
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000007File_System
+Service Type: File_System
+Name : String File System #6
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 12000000
+Permission_Level: UShort 7
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000008File_System
+Service Type: File_System
+Name : String File System #7
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 14000000
+Permission_Level: UShort 8
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000009File_System
+Service Type: File_System
+Name : String File System #8
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 16000000
+Permission_Level: UShort 9
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000010File_System
+Service Type: File_System
+Name : String File System #9
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 18000000
+Permission_Level: UShort 10
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000011File_System
+Service Type: File_System
+Name : String File System #10
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 20000000
+Permission_Level: UShort 11
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000012File_System
+Service Type: File_System
+Name : String File System #11
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 22000000
+Permission_Level: UShort 12
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000013File_System
+Service Type: File_System
+Name : String File System #12
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 24000000
+Permission_Level: UShort 13
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000014File_System
+Service Type: File_System
+Name : String File System #13
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 26000000
+Permission_Level: UShort 14
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000015File_System
+Service Type: File_System
+Name : String File System #14
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 28000000
+Permission_Level: UShort 15
+Space_Remaining: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000001Printer
+Service Type: Printer
+Name : String Printer #0
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+Pages_Per_Sec : UShort 0
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000002Printer
+Service Type: Printer
+Name : String Printer #1
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+Pages_Per_Sec : UShort 1
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000003Printer
+Service Type: Printer
+Name : String Printer #2
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+Pages_Per_Sec : UShort 2
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000004Printer
+Service Type: Printer
+Name : String Printer #3
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+Pages_Per_Sec : UShort 3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000005Printer
+Service Type: Printer
+Name : String Printer #4
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+Pages_Per_Sec : UShort 4
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000006Printer
+Service Type: Printer
+Name : String Printer #5
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+Pages_Per_Sec : UShort 5
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000007Printer
+Service Type: Printer
+Name : String Printer #6
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+Pages_Per_Sec : UShort 6
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000008Printer
+Service Type: Printer
+Name : String Printer #7
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000009Printer
+Service Type: Printer
+Name : String Printer #8
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+Pages_Per_Sec : UShort 8
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000010Printer
+Service Type: Printer
+Name : String Printer #9
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+Pages_Per_Sec : UShort 9
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000011Printer
+Service Type: Printer
+Name : String Printer #10
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+Pages_Per_Sec : UShort 10
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000012Printer
+Service Type: Printer
+Name : String Printer #11
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+Pages_Per_Sec : UShort 11
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000013Printer
+Service Type: Printer
+Name : String Printer #12
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+Pages_Per_Sec : UShort 12
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000014Printer
+Service Type: Printer
+Name : String Printer #13
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+Pages_Per_Sec : UShort 13
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000015Printer
+Service Type: Printer
+Name : String Printer #14
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+Pages_Per_Sec : UShort 14
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000001Plotter
+Service Type: Plotter
+Name : String Plotter #0
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 0
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000002Plotter
+Service Type: Plotter
+Name : String Plotter #1
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 2
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000003Plotter
+Service Type: Plotter
+Name : String Plotter #2
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 4
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000004Plotter
+Service Type: Plotter
+Name : String Plotter #3
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 6
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000005Plotter
+Service Type: Plotter
+Name : String Plotter #4
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 8
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000006Plotter
+Service Type: Plotter
+Name : String Plotter #5
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 10
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000007Plotter
+Service Type: Plotter
+Name : String Plotter #6
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 12
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000008Plotter
+Service Type: Plotter
+Name : String Plotter #7
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 14
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000009Plotter
+Service Type: Plotter
+Name : String Plotter #8
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 16
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000010Plotter
+Service Type: Plotter
+Name : String Plotter #9
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 18
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000011Plotter
+Service Type: Plotter
+Name : String Plotter #10
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 20
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000012Plotter
+Service Type: Plotter
+Name : String Plotter #11
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 22
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000013Plotter
+Service Type: Plotter
+Name : String Plotter #12
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 24
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000014Plotter
+Service Type: Plotter
+Name : String Plotter #13
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 26
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+Offer Id: 0000000000000015Plotter
+Service Type: Plotter
+Name : String Plotter #14
+Location : String MODIFIED
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 28
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+Miscellaneous : String MODIFIED
+------------------------------
+*** TAO_Offer_Exporter::Withdrawing with constraint.
+Constraint: (not exist Description) and (Location == 'MODIFIED') and (exist Name)
+*** TAO_Offer_Exporter::Describing all offers.
+TAO_Offer_Exporter::Grabbing all offer ids.
+The following offer ids are registered:
+------------------------------
+*** TAO_Offer_Exporter::Withdrawing all offers.
+TAO_Offer_Exporter::Grabbing all offer ids.
+The following offer ids are registered:
+*** TAO_Offer_Exporter::Exporting offers.
+Registered offer id: 0000000000000001Plotter.
+Registered offer id: 0000000000000001Printer.
+Registered offer id: 0000000000000001File_System.
+Registered offer id: 0000000000000002Plotter.
+Registered offer id: 0000000000000002Printer.
+Registered offer id: 0000000000000002File_System.
+Registered offer id: 0000000000000003Plotter.
+Registered offer id: 0000000000000003Printer.
+Registered offer id: 0000000000000003File_System.
+Registered offer id: 0000000000000004Plotter.
+Registered offer id: 0000000000000004Printer.
+Registered offer id: 0000000000000004File_System.
+Registered offer id: 0000000000000005Plotter.
+Registered offer id: 0000000000000005Printer.
+Registered offer id: 0000000000000005File_System.
+Registered offer id: 0000000000000006Plotter.
+Registered offer id: 0000000000000006Printer.
+Registered offer id: 0000000000000006File_System.
+Registered offer id: 0000000000000007Plotter.
+Registered offer id: 0000000000000007Printer.
+Registered offer id: 0000000000000007File_System.
+Registered offer id: 0000000000000008Plotter.
+Registered offer id: 0000000000000008Printer.
+Registered offer id: 0000000000000008File_System.
+Registered offer id: 0000000000000009Plotter.
+Registered offer id: 0000000000000009Printer.
+Registered offer id: 0000000000000009File_System.
+Registered offer id: 0000000000000010Plotter.
+Registered offer id: 0000000000000010Printer.
+Registered offer id: 0000000000000010File_System.
+Registered offer id: 0000000000000011Plotter.
+Registered offer id: 0000000000000011Printer.
+Registered offer id: 0000000000000011File_System.
+Registered offer id: 0000000000000012Plotter.
+Registered offer id: 0000000000000012Printer.
+Registered offer id: 0000000000000012File_System.
+Registered offer id: 0000000000000013Plotter.
+Registered offer id: 0000000000000013Printer.
+Registered offer id: 0000000000000013File_System.
+Registered offer id: 0000000000000014Plotter.
+Registered offer id: 0000000000000014Printer.
+Registered offer id: 0000000000000014File_System.
+Registered offer id: 0000000000000015Plotter.
+Registered offer id: 0000000000000015Printer.
+Registered offer id: 0000000000000015File_System.
+*** TAO_Offer_Exporter::Describing all offers.
+TAO_Offer_Exporter::Grabbing all offer ids.
+The following offer ids are registered:
+Offer Id: 0000000000000001File_System
+Offer Id: 0000000000000002File_System
+Offer Id: 0000000000000003File_System
+Offer Id: 0000000000000004File_System
+Offer Id: 0000000000000005File_System
+Offer Id: 0000000000000006File_System
+Offer Id: 0000000000000007File_System
+Offer Id: 0000000000000008File_System
+Offer Id: 0000000000000009File_System
+Offer Id: 0000000000000010File_System
+Offer Id: 0000000000000011File_System
+Offer Id: 0000000000000012File_System
+Offer Id: 0000000000000013File_System
+Offer Id: 0000000000000014File_System
+Offer Id: 0000000000000015File_System
+Offer Id: 0000000000000001Printer
+Offer Id: 0000000000000002Printer
+Offer Id: 0000000000000003Printer
+Offer Id: 0000000000000004Printer
+Offer Id: 0000000000000005Printer
+Offer Id: 0000000000000006Printer
+Offer Id: 0000000000000007Printer
+Offer Id: 0000000000000008Printer
+Offer Id: 0000000000000009Printer
+Offer Id: 0000000000000010Printer
+Offer Id: 0000000000000011Printer
+Offer Id: 0000000000000012Printer
+Offer Id: 0000000000000013Printer
+Offer Id: 0000000000000014Printer
+Offer Id: 0000000000000015Printer
+Offer Id: 0000000000000001Plotter
+Offer Id: 0000000000000002Plotter
+Offer Id: 0000000000000003Plotter
+Offer Id: 0000000000000004Plotter
+Offer Id: 0000000000000005Plotter
+Offer Id: 0000000000000006Plotter
+Offer Id: 0000000000000007Plotter
+Offer Id: 0000000000000008Plotter
+Offer Id: 0000000000000009Plotter
+Offer Id: 0000000000000010Plotter
+Offer Id: 0000000000000011Plotter
+Offer Id: 0000000000000012Plotter
+Offer Id: 0000000000000013Plotter
+Offer Id: 0000000000000014Plotter
+Offer Id: 0000000000000015Plotter
+------------------------------
+Offer Id: 0000000000000001File_System
+Service Type: File_System
+Name : String File System #0
+Location : String Bryan 509
+Description : String File System #0 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 0
+Permission_Level: UShort 1
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000002File_System
+Service Type: File_System
+Name : String File System #1
+Location : String Bryan 503
+Description : String File System #1 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 2000000
+Permission_Level: UShort 2
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000003File_System
+Service Type: File_System
+Name : String File System #2
+Location : String Dunker 102
+Description : String File System #2 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 4000000
+Permission_Level: UShort 3
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000004File_System
+Service Type: File_System
+Name : String File System #3
+Location : String Jolley 408
+Description : String File System #3 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 6000000
+Permission_Level: UShort 4
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000005File_System
+Service Type: File_System
+Name : String File System #4
+Location : String Lopata 401
+Description : String File System #4 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 8000000
+Permission_Level: UShort 5
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000006File_System
+Service Type: File_System
+Name : String File System #5
+Location : String January 110
+Description : String File System #5 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 10000000
+Permission_Level: UShort 6
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000007File_System
+Service Type: File_System
+Name : String File System #6
+Location : String Cupples I 30
+Description : String File System #6 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 12000000
+Permission_Level: UShort 7
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000008File_System
+Service Type: File_System
+Name : String File System #7
+Location : String Cupples II 201
+Description : String File System #7 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 14000000
+Permission_Level: UShort 8
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000009File_System
+Service Type: File_System
+Name : String File System #8
+Location : String Urbauer 321
+Description : String File System #8 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 16000000
+Permission_Level: UShort 9
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000010File_System
+Service Type: File_System
+Name : String File System #9
+Location : String Umrath 302
+Description : String File System #9 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 18000000
+Permission_Level: UShort 10
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000011File_System
+Service Type: File_System
+Name : String File System #10
+Location : String Wilson 110
+Description : String File System #10 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 20000000
+Permission_Level: UShort 11
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000012File_System
+Service Type: File_System
+Name : String File System #11
+Location : String Olin 239
+Description : String File System #11 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 22000000
+Permission_Level: UShort 12
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000013File_System
+Service Type: File_System
+Name : String File System #12
+Location : String Simon 238
+Description : String File System #12 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 24000000
+Permission_Level: UShort 13
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000014File_System
+Service Type: File_System
+Name : String File System #13
+Location : String Rebstock 232
+Description : String File System #13 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 26000000
+Permission_Level: UShort 14
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000015File_System
+Service Type: File_System
+Name : String File System #14
+Location : String McMillan 123
+Description : String File System #14 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 28000000
+Permission_Level: UShort 15
+Space_Remaining: Dynamic Property
+------------------------------
+Offer Id: 0000000000000001Printer
+Service Type: Printer
+Name : String Printer #0
+Location : String Bryan 509
+Description : String Printer #0 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+Pages_Per_Sec : UShort 0
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000002Printer
+Service Type: Printer
+Name : String Printer #1
+Location : String Bryan 503
+Description : String Printer #1 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+Pages_Per_Sec : UShort 1
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000003Printer
+Service Type: Printer
+Name : String Printer #2
+Location : String Dunker 102
+Description : String Printer #2 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+Pages_Per_Sec : UShort 2
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000004Printer
+Service Type: Printer
+Name : String Printer #3
+Location : String Jolley 408
+Description : String Printer #3 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+Pages_Per_Sec : UShort 3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000005Printer
+Service Type: Printer
+Name : String Printer #4
+Location : String Lopata 401
+Description : String Printer #4 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+Pages_Per_Sec : UShort 4
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000006Printer
+Service Type: Printer
+Name : String Printer #5
+Location : String January 110
+Description : String Printer #5 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+Pages_Per_Sec : UShort 5
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000007Printer
+Service Type: Printer
+Name : String Printer #6
+Location : String Cupples I 30
+Description : String Printer #6 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+Pages_Per_Sec : UShort 6
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000008Printer
+Service Type: Printer
+Name : String Printer #7
+Location : String Cupples II 201
+Description : String Printer #7 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000009Printer
+Service Type: Printer
+Name : String Printer #8
+Location : String Urbauer 321
+Description : String Printer #8 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+Pages_Per_Sec : UShort 8
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000010Printer
+Service Type: Printer
+Name : String Printer #9
+Location : String Umrath 302
+Description : String Printer #9 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+Pages_Per_Sec : UShort 9
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000011Printer
+Service Type: Printer
+Name : String Printer #10
+Location : String Wilson 110
+Description : String Printer #10 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+Pages_Per_Sec : UShort 10
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000012Printer
+Service Type: Printer
+Name : String Printer #11
+Location : String Olin 239
+Description : String Printer #11 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+Pages_Per_Sec : UShort 11
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000013Printer
+Service Type: Printer
+Name : String Printer #12
+Location : String Simon 238
+Description : String Printer #12 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+Pages_Per_Sec : UShort 12
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000014Printer
+Service Type: Printer
+Name : String Printer #13
+Location : String Rebstock 232
+Description : String Printer #13 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+Pages_Per_Sec : UShort 13
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000015Printer
+Service Type: Printer
+Name : String Printer #14
+Location : String McMillan 123
+Description : String Printer #14 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+Pages_Per_Sec : UShort 14
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000001Plotter
+Service Type: Plotter
+Name : String Plotter #0
+Location : String Bryan 509
+Description : String Plotter #0 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 0
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000002Plotter
+Service Type: Plotter
+Name : String Plotter #1
+Location : String Bryan 503
+Description : String Plotter #1 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 2
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000003Plotter
+Service Type: Plotter
+Name : String Plotter #2
+Location : String Dunker 102
+Description : String Plotter #2 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 4
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000004Plotter
+Service Type: Plotter
+Name : String Plotter #3
+Location : String Jolley 408
+Description : String Plotter #3 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 6
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000005Plotter
+Service Type: Plotter
+Name : String Plotter #4
+Location : String Lopata 401
+Description : String Plotter #4 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 8
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000006Plotter
+Service Type: Plotter
+Name : String Plotter #5
+Location : String January 110
+Description : String Plotter #5 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 10
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000007Plotter
+Service Type: Plotter
+Name : String Plotter #6
+Location : String Cupples I 30
+Description : String Plotter #6 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 12
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000008Plotter
+Service Type: Plotter
+Name : String Plotter #7
+Location : String Cupples II 201
+Description : String Plotter #7 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 14
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000009Plotter
+Service Type: Plotter
+Name : String Plotter #8
+Location : String Urbauer 321
+Description : String Plotter #8 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 16
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000010Plotter
+Service Type: Plotter
+Name : String Plotter #9
+Location : String Umrath 302
+Description : String Plotter #9 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 18
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000011Plotter
+Service Type: Plotter
+Name : String Plotter #10
+Location : String Wilson 110
+Description : String Plotter #10 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 20
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000012Plotter
+Service Type: Plotter
+Name : String Plotter #11
+Location : String Olin 239
+Description : String Plotter #11 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 22
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000013Plotter
+Service Type: Plotter
+Name : String Plotter #12
+Location : String Simon 238
+Description : String Plotter #12 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 24
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000014Plotter
+Service Type: Plotter
+Name : String Plotter #13
+Location : String Rebstock 232
+Description : String Plotter #13 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 26
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+Offer Id: 0000000000000015Plotter
+Service Type: Plotter
+Name : String Plotter #14
+Location : String McMillan 123
+Description : String Plotter #14 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 28
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+User_Queue : Dynamic Property
+File_Sizes_Pending: Dynamic Property
+------------------------------
+*** Offer Exporter tests complete.
+*** Now serving dynamic properties.
+
+> import_test
+
+Bootstrap to the Lookup interface.
+Narrowing the lookup interface.
+Running the Offer Importer tests.
+*** TAO_Offer_Importer::Federated Query.
+
+*** Performing query for Remote_IO.
+*** Query:
+*** Preferences:
+*** Results:
+
+------------------------------
+Offers in the sequence:
+------------------------------
+Name : String File System #0
+Location : String Bryan 509
+Description : String File System #0 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 0
+Permission_Level: UShort 1
+Space_Remaining: ULong 0
+------------------------------
+Name : String File System #1
+Location : String Bryan 503
+Description : String File System #1 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 2000000
+Permission_Level: UShort 2
+Space_Remaining: ULong 4434343
+------------------------------
+Name : String File System #2
+Location : String Dunker 102
+Description : String File System #2 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 4000000
+Permission_Level: UShort 3
+Space_Remaining: ULong 8868686
+------------------------------
+Name : String File System #3
+Location : String Jolley 408
+Description : String File System #3 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 6000000
+Permission_Level: UShort 4
+Space_Remaining: ULong 13303029
+------------------------------
+Name : String File System #4
+Location : String Lopata 401
+Description : String File System #4 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 8000000
+Permission_Level: UShort 5
+Space_Remaining: ULong 17737372
+------------------------------
+Name : String File System #5
+Location : String January 110
+Description : String File System #5 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 10000000
+Permission_Level: UShort 6
+Space_Remaining: ULong 22171715
+------------------------------
+Name : String File System #6
+Location : String Cupples I 30
+Description : String File System #6 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 12000000
+Permission_Level: UShort 7
+Space_Remaining: ULong 26606058
+------------------------------
+Name : String File System #7
+Location : String Cupples II 201
+Description : String File System #7 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 14000000
+Permission_Level: UShort 8
+Space_Remaining: ULong 31040401
+------------------------------
+ Offers in the iterator:
+------------------------------
+Name : String File System #8
+Location : String Urbauer 321
+Description : String File System #8 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 16000000
+Permission_Level: UShort 9
+Space_Remaining: ULong 35474744
+------------------------------
+Name : String File System #9
+Location : String Umrath 302
+Description : String File System #9 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 18000000
+Permission_Level: UShort 10
+Space_Remaining: ULong 39909087
+------------------------------
+Name : String File System #10
+Location : String Wilson 110
+Description : String File System #10 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 20000000
+Permission_Level: UShort 11
+Space_Remaining: ULong 44343430
+------------------------------
+Name : String File System #11
+Location : String Olin 239
+Description : String File System #11 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 22000000
+Permission_Level: UShort 12
+Space_Remaining: ULong 48777773
+------------------------------
+Name : String File System #12
+Location : String Simon 238
+Description : String File System #12 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 24000000
+Permission_Level: UShort 13
+Space_Remaining: ULong 53212116
+------------------------------
+Name : String File System #13
+Location : String Rebstock 232
+Description : String File System #13 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 26000000
+Permission_Level: UShort 14
+Space_Remaining: ULong 57646459
+------------------------------
+Name : String File System #14
+Location : String McMillan 123
+Description : String File System #14 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 28000000
+Permission_Level: UShort 15
+Space_Remaining: ULong 62080802
+------------------------------
+Name : String Printer #0
+Location : String Bryan 509
+Description : String Printer #0 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+Pages_Per_Sec : UShort 0
+User_Queue : sbw1 schmidt naga alex
+File_Sizes_Pending: 0 10000 20000 30000
+------------------------------
+Name : String Printer #1
+Location : String Bryan 503
+Description : String Printer #1 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+Pages_Per_Sec : UShort 1
+User_Queue : mk1 marina sumedh sergio
+File_Sizes_Pending: 40000 50000 60000 70000
+------------------------------
+Name : String Printer #2
+Location : String Dunker 102
+Description : String Printer #2 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+Pages_Per_Sec : UShort 2
+User_Queue : coryan cdgill levine jxh
+File_Sizes_Pending: 80000 90000 100000 110000
+------------------------------
+Name : String Printer #3
+Location : String Jolley 408
+Description : String Printer #3 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+Pages_Per_Sec : UShort 3
+User_Queue : irfan nanbor eea1 sbw1
+File_Sizes_Pending: 120000 130000 140000 0
+------------------------------
+Name : String Printer #4
+Location : String Lopata 401
+Description : String Printer #4 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+Pages_Per_Sec : UShort 4
+User_Queue : schmidt naga alex mk1
+File_Sizes_Pending: 10000 20000 30000 40000
+------------------------------
+Name : String Printer #5
+Location : String January 110
+Description : String Printer #5 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+Pages_Per_Sec : UShort 5
+User_Queue : marina sumedh sergio coryan
+File_Sizes_Pending: 50000 60000 70000 80000
+------------------------------
+Name : String Printer #6
+Location : String Cupples I 30
+Description : String Printer #6 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+Pages_Per_Sec : UShort 6
+User_Queue : cdgill levine jxh irfan
+File_Sizes_Pending: 90000 100000 110000 120000
+------------------------------
+Name : String Printer #7
+Location : String Cupples II 201
+Description : String Printer #7 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+Name : String Printer #8
+Location : String Urbauer 321
+Description : String Printer #8 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+Pages_Per_Sec : UShort 8
+User_Queue : naga alex mk1 marina
+File_Sizes_Pending: 20000 30000 40000 50000
+------------------------------
+Name : String Printer #9
+Location : String Umrath 302
+Description : String Printer #9 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+Pages_Per_Sec : UShort 9
+User_Queue : sumedh sergio coryan cdgill
+File_Sizes_Pending: 60000 70000 80000 90000
+------------------------------
+Name : String Printer #10
+Location : String Wilson 110
+Description : String Printer #10 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+Pages_Per_Sec : UShort 10
+User_Queue : levine jxh irfan nanbor
+File_Sizes_Pending: 100000 110000 120000 130000
+------------------------------
+Name : String Printer #11
+Location : String Olin 239
+Description : String Printer #11 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+Pages_Per_Sec : UShort 11
+User_Queue : eea1 sbw1 schmidt naga
+File_Sizes_Pending: 140000 0 10000 20000
+------------------------------
+Name : String Printer #12
+Location : String Simon 238
+Description : String Printer #12 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+Pages_Per_Sec : UShort 12
+User_Queue : alex mk1 marina sumedh
+File_Sizes_Pending: 30000 40000 50000 60000
+------------------------------
+Name : String Printer #13
+Location : String Rebstock 232
+Description : String Printer #13 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+Pages_Per_Sec : UShort 13
+User_Queue : sergio coryan cdgill levine
+File_Sizes_Pending: 70000 80000 90000 100000
+------------------------------
+Name : String Printer #14
+Location : String McMillan 123
+Description : String Printer #14 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+Pages_Per_Sec : UShort 14
+User_Queue : jxh irfan nanbor eea1
+File_Sizes_Pending: 110000 120000 130000 140000
+------------------------------
+Name : String Plotter #0
+Location : String Bryan 509
+Description : String Plotter #0 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 0
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+User_Queue : sbw1 schmidt naga alex
+File_Sizes_Pending: 0 10000 20000 30000
+------------------------------
+Name : String Plotter #1
+Location : String Bryan 503
+Description : String Plotter #1 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 2
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+User_Queue : mk1 marina sumedh sergio
+File_Sizes_Pending: 40000 50000 60000 70000
+------------------------------
+Name : String Plotter #2
+Location : String Dunker 102
+Description : String Plotter #2 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 4
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+User_Queue : coryan cdgill levine jxh
+File_Sizes_Pending: 80000 90000 100000 110000
+------------------------------
+Name : String Plotter #3
+Location : String Jolley 408
+Description : String Plotter #3 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 6
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+User_Queue : irfan nanbor eea1 sbw1
+File_Sizes_Pending: 120000 130000 140000 0
+------------------------------
+Name : String Plotter #4
+Location : String Lopata 401
+Description : String Plotter #4 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 8
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+User_Queue : schmidt naga alex mk1
+File_Sizes_Pending: 10000 20000 30000 40000
+------------------------------
+Name : String Plotter #5
+Location : String January 110
+Description : String Plotter #5 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 10
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+User_Queue : marina sumedh sergio coryan
+File_Sizes_Pending: 50000 60000 70000 80000
+------------------------------
+Name : String Plotter #6
+Location : String Cupples I 30
+Description : String Plotter #6 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 12
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+User_Queue : cdgill levine jxh irfan
+File_Sizes_Pending: 90000 100000 110000 120000
+------------------------------
+Name : String Plotter #7
+Location : String Cupples II 201
+Description : String Plotter #7 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 14
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+Name : String Plotter #8
+Location : String Urbauer 321
+Description : String Plotter #8 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 16
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+User_Queue : naga alex mk1 marina
+File_Sizes_Pending: 20000 30000 40000 50000
+------------------------------
+Name : String Plotter #9
+Location : String Umrath 302
+Description : String Plotter #9 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 18
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+User_Queue : sumedh sergio coryan cdgill
+File_Sizes_Pending: 60000 70000 80000 90000
+------------------------------
+Name : String Plotter #10
+Location : String Wilson 110
+Description : String Plotter #10 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 20
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+User_Queue : levine jxh irfan nanbor
+File_Sizes_Pending: 100000 110000 120000 130000
+------------------------------
+Name : String Plotter #11
+Location : String Olin 239
+Description : String Plotter #11 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 22
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+User_Queue : eea1 sbw1 schmidt naga
+File_Sizes_Pending: 140000 0 10000 20000
+------------------------------
+Name : String Plotter #12
+Location : String Simon 238
+Description : String Plotter #12 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 24
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+User_Queue : alex mk1 marina sumedh
+File_Sizes_Pending: 30000 40000 50000 60000
+------------------------------
+Name : String Plotter #13
+Location : String Rebstock 232
+Description : String Plotter #13 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 26
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+User_Queue : sergio coryan cdgill levine
+File_Sizes_Pending: 70000 80000 90000 100000
+------------------------------
+Name : String Plotter #14
+Location : String McMillan 123
+Description : String Plotter #14 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 28
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+User_Queue : jxh irfan nanbor eea1
+File_Sizes_Pending: 110000 120000 130000 140000
+------------------------------
+
+*** Performing query for Remote_IO.
+*** Query: Location ~ 'Cupples'
+*** Preferences:
+*** Results:
+
+------------------------------
+Offers in the sequence:
+------------------------------
+Name : String File System #6
+Location : String Cupples I 30
+Description : String File System #6 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 12000000
+Permission_Level: UShort 7
+Space_Remaining: ULong 26606058
+------------------------------
+Name : String File System #7
+Location : String Cupples II 201
+Description : String File System #7 is a File System. It stores stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Disk_Space : ULong 14000000
+Permission_Level: UShort 8
+Space_Remaining: ULong 31040401
+------------------------------
+Name : String Printer #6
+Location : String Cupples I 30
+Description : String Printer #6 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+Pages_Per_Sec : UShort 6
+User_Queue : cdgill levine jxh irfan
+File_Sizes_Pending: 90000 100000 110000 120000
+------------------------------
+Name : String Printer #7
+Location : String Cupples II 201
+Description : String Printer #7 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+Name : String Plotter #6
+Location : String Cupples I 30
+Description : String Plotter #6 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 12
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+User_Queue : cdgill levine jxh irfan
+File_Sizes_Pending: 90000 100000 110000 120000
+------------------------------
+Name : String Plotter #7
+Location : String Cupples II 201
+Description : String Plotter #7 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 14
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+ Offers in the iterator:
+------------------------------
+
+*** Performing query for Plotter.
+*** Query: 'sbw1' in User_Queue
+*** Preferences: min Cost_Per_Page
+*** Results:
+
+------------------------------
+Offers in the sequence:
+------------------------------
+Name : String Plotter #0
+Location : String Bryan 509
+Description : String Plotter #0 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 0
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+User_Queue : sbw1 schmidt naga alex
+File_Sizes_Pending: 0 10000 20000 30000
+------------------------------
+Name : String Plotter #3
+Location : String Jolley 408
+Description : String Plotter #3 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 6
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+User_Queue : irfan nanbor eea1 sbw1
+File_Sizes_Pending: 120000 130000 140000 0
+------------------------------
+Name : String Plotter #7
+Location : String Cupples II 201
+Description : String Plotter #7 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 14
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+Name : String Plotter #11
+Location : String Olin 239
+Description : String Plotter #11 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 22
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+User_Queue : eea1 sbw1 schmidt naga
+File_Sizes_Pending: 140000 0 10000 20000
+------------------------------
+ Offers in the iterator:
+------------------------------
+
+*** Performing query for Plotter.
+*** Query: Num_Colors > 1 and Location ~ 'Cupples'
+*** Preferences: min Cost_Per_Page
+*** Results:
+
+------------------------------
+Offers in the sequence:
+------------------------------
+Name : String Plotter #6
+Location : String Cupples I 30
+Description : String Plotter #6 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 12
+Auto_Loading : Boolean FALSE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+User_Queue : cdgill levine jxh irfan
+File_Sizes_Pending: 90000 100000 110000 120000
+------------------------------
+Name : String Plotter #7
+Location : String Cupples II 201
+Description : String Plotter #7 is a plotter. It plots stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Num_Colors : Long 14
+Auto_Loading : Boolean TRUE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+ Offers in the iterator:
+------------------------------
+
+*** Performing query for Printer.
+*** Query: Pages_Per_Sec > 3 and Color == TRUE
+*** Preferences: with 'sbw1' in User_Queue
+*** Results:
+
+------------------------------
+Offers in the sequence:
+------------------------------
+Name : String Printer #11
+Location : String Olin 239
+Description : String Printer #11 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+Pages_Per_Sec : UShort 11
+User_Queue : eea1 sbw1 schmidt naga
+File_Sizes_Pending: 140000 0 10000 20000
+------------------------------
+Name : String Printer #7
+Location : String Cupples II 201
+Description : String Printer #7 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+Name : String Printer #5
+Location : String January 110
+Description : String Printer #5 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+Pages_Per_Sec : UShort 5
+User_Queue : marina sumedh sergio coryan
+File_Sizes_Pending: 50000 60000 70000 80000
+------------------------------
+Name : String Printer #9
+Location : String Umrath 302
+Description : String Printer #9 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+Pages_Per_Sec : UShort 9
+User_Queue : sumedh sergio coryan cdgill
+File_Sizes_Pending: 60000 70000 80000 90000
+------------------------------
+Name : String Printer #13
+Location : String Rebstock 232
+Description : String Printer #13 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+Pages_Per_Sec : UShort 13
+User_Queue : sergio coryan cdgill levine
+File_Sizes_Pending: 70000 80000 90000 100000
+------------------------------
+ Offers in the iterator:
+------------------------------
+
+*** Performing query for Printer.
+*** Query: Color == TRUE or Double_Sided == TRUE
+*** Preferences: random
+*** Results:
+
+------------------------------
+Offers in the sequence:
+------------------------------
+Name : String Printer #14
+Location : String McMillan 123
+Description : String Printer #14 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 14.000000
+Model_Number : String 9q834jidlj234ujof
+Pages_Per_Sec : UShort 14
+User_Queue : jxh irfan nanbor eea1
+File_Sizes_Pending: 110000 120000 130000 140000
+------------------------------
+Name : String Printer #13
+Location : String Rebstock 232
+Description : String Printer #13 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 13.000000
+Model_Number : String kladfp72wu34j230f
+Pages_Per_Sec : UShort 13
+User_Queue : sergio coryan cdgill levine
+File_Sizes_Pending: 70000 80000 90000 100000
+------------------------------
+Name : String Printer #12
+Location : String Simon 238
+Description : String Printer #12 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 12.000000
+Model_Number : String asdfj0283jkdf0923
+Pages_Per_Sec : UShort 12
+User_Queue : alex mk1 marina sumedh
+File_Sizes_Pending: 30000 40000 50000 60000
+------------------------------
+Name : String Printer #11
+Location : String Olin 239
+Description : String Printer #11 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+Pages_Per_Sec : UShort 11
+User_Queue : eea1 sbw1 schmidt naga
+File_Sizes_Pending: 140000 0 10000 20000
+------------------------------
+Name : String Printer #10
+Location : String Wilson 110
+Description : String Printer #10 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 10.000000
+Model_Number : String 09234kejdfq934jed
+Pages_Per_Sec : UShort 10
+User_Queue : levine jxh irfan nanbor
+File_Sizes_Pending: 100000 110000 120000 130000
+------------------------------
+Name : String Printer #9
+Location : String Umrath 302
+Description : String Printer #9 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 9.000000
+Model_Number : String 09a834ojfda09wu3r
+Pages_Per_Sec : UShort 9
+User_Queue : sumedh sergio coryan cdgill
+File_Sizes_Pending: 60000 70000 80000 90000
+------------------------------
+Name : String Printer #8
+Location : String Urbauer 321
+Description : String Printer #8 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 8.000000
+Model_Number : String 9p83q4jklsdj098q3
+Pages_Per_Sec : UShort 8
+User_Queue : naga alex mk1 marina
+File_Sizes_Pending: 20000 30000 40000 50000
+------------------------------
+Name : String Printer #7
+Location : String Cupples II 201
+Description : String Printer #7 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+ Offers in the iterator:
+------------------------------
+Name : String Printer #6
+Location : String Cupples I 30
+Description : String Printer #6 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 6.000000
+Model_Number : String q834jfda09q834djk
+Pages_Per_Sec : UShort 6
+User_Queue : cdgill levine jxh irfan
+File_Sizes_Pending: 90000 100000 110000 120000
+------------------------------
+Name : String Printer #5
+Location : String January 110
+Description : String Printer #5 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 5.000000
+Model_Number : String q9834fdkjwq0934kf
+Pages_Per_Sec : UShort 5
+User_Queue : marina sumedh sergio coryan
+File_Sizes_Pending: 50000 60000 70000 80000
+------------------------------
+Name : String Printer #4
+Location : String Lopata 401
+Description : String Printer #4 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 4.000000
+Model_Number : String 09q834efjhqw834q3
+Pages_Per_Sec : UShort 4
+User_Queue : schmidt naga alex mk1
+File_Sizes_Pending: 10000 20000 30000 40000
+------------------------------
+Name : String Printer #3
+Location : String Jolley 408
+Description : String Printer #3 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+Pages_Per_Sec : UShort 3
+User_Queue : irfan nanbor eea1 sbw1
+File_Sizes_Pending: 120000 130000 140000 0
+------------------------------
+Name : String Printer #2
+Location : String Dunker 102
+Description : String Printer #2 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 2.000000
+Model_Number : String 8328323n293kljs98
+Pages_Per_Sec : UShort 2
+User_Queue : coryan cdgill levine jxh
+File_Sizes_Pending: 80000 90000 100000 110000
+------------------------------
+Name : String Printer #1
+Location : String Bryan 503
+Description : String Printer #1 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 1.000000
+Model_Number : String PK92839nkse092309
+Pages_Per_Sec : UShort 1
+User_Queue : mk1 marina sumedh sergio
+File_Sizes_Pending: 40000 50000 60000 70000
+------------------------------
+Name : String Printer #0
+Location : String Bryan 509
+Description : String Printer #0 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+Pages_Per_Sec : UShort 0
+User_Queue : sbw1 schmidt naga alex
+File_Sizes_Pending: 0 10000 20000 30000
+------------------------------
+
+*** Performing query for Printer.
+*** Query: (Color or Double_Sided) and 'sbw1' in User_Queue
+*** Preferences: with Location ~ 'Cupples'
+*** Results:
+
+------------------------------
+Offers in the sequence:
+------------------------------
+Name : String Printer #7
+Location : String Cupples II 201
+Description : String Printer #7 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 7.000000
+Model_Number : String kajsd09q384kjda90
+Pages_Per_Sec : UShort 7
+User_Queue : nanbor eea1 sbw1 schmidt
+File_Sizes_Pending: 130000 140000 0 10000
+------------------------------
+Name : String Printer #0
+Location : String Bryan 509
+Description : String Printer #0 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean FALSE
+Double_Sided : Boolean TRUE
+Cost_Per_Page : Float 0.000000
+Model_Number : String HP238293892bn2398
+Pages_Per_Sec : UShort 0
+User_Queue : sbw1 schmidt naga alex
+File_Sizes_Pending: 0 10000 20000 30000
+------------------------------
+Name : String Printer #3
+Location : String Jolley 408
+Description : String Printer #3 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 3.000000
+Model_Number : String 29309sjdkq34jksd2
+Pages_Per_Sec : UShort 3
+User_Queue : irfan nanbor eea1 sbw1
+File_Sizes_Pending: 120000 130000 140000 0
+------------------------------
+Name : String Printer #11
+Location : String Olin 239
+Description : String Printer #11 is a printer. It prints stuff.
+Host_Name : String sophocles.cimds.ri.cmu.edu
+Trader_Name : String Default
+Color : Boolean TRUE
+Double_Sided : Boolean FALSE
+Cost_Per_Page : Float 11.000000
+Model_Number : String 0q83kjefd09384jda
+Pages_Per_Sec : UShort 11
+User_Queue : eea1 sbw1 schmidt naga
+File_Sizes_Pending: 140000 0 10000 20000
+------------------------------
+ Offers in the iterator:
+------------------------------
+
diff --git a/TAO/orbsvcs/tests/Trading/Service_Type_Exporter.cpp b/TAO/orbsvcs/tests/Trading/Service_Type_Exporter.cpp
new file mode 100644
index 00000000000..282c96ae920
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Service_Type_Exporter.cpp
@@ -0,0 +1,518 @@
+// $Id$
+
+#include "Service_Type_Exporter.h"
+
+ACE_RCSID(Trading, Service_Type_Exporter, "$Id$")
+
+TAO_Service_Type_Exporter::
+TAO_Service_Type_Exporter (CosTrading::Lookup_ptr lookup_if,
+ CORBA::Boolean verbose
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+ : verbose_ (verbose),
+ lookup_ (lookup_if)
+{
+ // Obtain the Service Type Repository.
+ CosTrading::TypeRepository_var obj = lookup_if->type_repos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Narrow the Service Type Repository.
+ this->repos_ = CosTradingRepos::ServiceTypeRepository::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ // Build the service type descriptions.
+ this->create_types ();
+}
+
+void
+TAO_Service_Type_Exporter::remove_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::HasSubTypes))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Service_Type_Exporter::removing all"
+ " types from the Repository.\n"));
+
+ for (int i = NUM_TYPES - 1; i >= 0; i--)
+ {
+ ACE_TRY
+ {
+ this->repos_->remove_type (TT_Info::INTERFACE_NAMES[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosTrading::UnknownServiceType, excp)
+ {
+ if (this->verbose_)
+ {
+ if (excp.type.in () != 0)
+ ACE_DEBUG ((LM_DEBUG, "Service type not yet registered: %s\n", excp.type.in ()));
+ }
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Service_Type_Exporter::remove_all_types");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Service_Type_Exporter::add_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeExists,
+ CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName))
+
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Service_Type_Exporter::"
+ "adding all types to the Repository.\n"));
+ this->add_all_types_to (this->repos_.in () ACE_ENV_ARG_PARAMETER);
+ // ACE_CHECK;
+}
+
+void
+TAO_Service_Type_Exporter::add_all_types_to_all (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeExists,
+ CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName))
+{
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Service_Type_Exporter::"
+ "add all types to all repositories.\n"));
+
+ ACE_DEBUG ((LM_DEBUG, "Obtaining link interface.\n"));
+ CosTrading::Link_var link_if = this->lookup_->link_if (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Obtaining references to traders directly"
+ " linked to the root trader.\n"));
+ CosTrading::LinkNameSeq_var link_name_seq = link_if->list_links (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Exporting service types with each of the linked"
+ " traders.\n"));
+ for (CORBA::ULong i = link_name_seq->length () - 1; i > 0; i--)
+ {
+ CosTradingRepos::ServiceTypeRepository_ptr str = 0;
+ ACE_TRY
+ {
+ ACE_DEBUG ((LM_DEBUG, "Getting link information for %s\n",
+ static_cast<const char*> (link_name_seq[i])));
+ CosTrading::Link::LinkInfo_var link_info =
+ link_if->describe_link (link_name_seq[i] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "Adding service types to %s\n",
+ static_cast<const char*> (link_name_seq[i])));
+
+ CosTrading::TypeRepository_var remote_repos =
+ link_info->target->type_repos (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ str =
+ CosTradingRepos::ServiceTypeRepository::_narrow (remote_repos.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ }
+ ACE_CATCHANY
+ {
+ // @@ Seth, Ignore all these exceptions?
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ // @@ Seth, But this one?
+ this->add_all_types_to (str ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Service_Type_Exporter::
+add_all_types_to (CosTradingRepos::ServiceTypeRepository_ptr repos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeExists,
+ CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName))
+{
+ for (int i = 0; i < NUM_TYPES; i++)
+ {
+ ACE_TRY
+ {
+ repos->add_type (TT_Info::INTERFACE_NAMES[i],
+ this->type_structs_[i].if_name,
+ this->type_structs_[i].props,
+ this->type_structs_[i].super_types
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CosTradingRepos::ServiceTypeRepository::ServiceTypeExists, ste)
+ {
+ ACE_PRINT_EXCEPTION (ste, "TAO_Service_Type_Exporter::add_all_types");
+
+ if (ste.name.in () != 0)
+ ACE_DEBUG ((LM_DEBUG, "Invalid name: %s\n", ste.name.in ()));
+ }
+ ACE_CATCH (CosTrading::IllegalPropertyName, excp)
+ {
+ ACE_PRINT_EXCEPTION (excp, "TAO_Service_Type_Exporter::add_all_types");
+
+ if (excp.name.in () != 0)
+ ACE_DEBUG ((LM_DEBUG, "Invalid name: %s\n", excp.name.in ()));
+ }
+ ACE_CATCH (CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition, vtr)
+ {
+ ACE_PRINT_EXCEPTION (vtr, "TAO_Service_Type_Exporter::add_all_types");
+
+ if (vtr.type_1.in () != 0)
+ ACE_DEBUG ((LM_DEBUG, "Type One: %s\n", vtr.type_2.in ()));
+ if (vtr.type_2.in () != 0)
+ ACE_DEBUG ((LM_DEBUG, "Type Two: %s\n", vtr.type_2.in ()));
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Service_Type_Exporter::add_all_types");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
+
+void
+TAO_Service_Type_Exporter::list_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_TRY
+ {
+ CosTradingRepos::ServiceTypeRepository::SpecifiedServiceTypes sst;
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Service_Type_Exporter::"
+ "listing all types in the Repository.\n"));
+
+ sst.all_ (1);
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq_var type_names =
+ this->repos_->list_types (sst ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ULong l = type_names->length ();
+ for (CORBA::ULong i = 0; i != l; ++i)
+ {
+ CORBA::ULong index = l - 1 - i;
+ if (this->verbose_)
+ {
+ ACE_DEBUG ((LM_DEBUG, "type name: %s\n",
+ static_cast<const char *> (type_names[index])));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Service_Type_Exporter::list_all_types");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ // ACE_CHECK;
+}
+
+void
+TAO_Service_Type_Exporter::describe_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType))
+{
+ ACE_TRY
+ {
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Service_Type_Exporter::"
+ "describing all types in the Repository.\n"));
+
+ for (int i = 0; i < NUM_TYPES; i++)
+ {
+ CosTradingRepos::ServiceTypeRepository::TypeStruct_var type_struct =
+ this->repos_->describe_type (TT_Info::INTERFACE_NAMES[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->verbose_)
+ {
+ this->dump_typestruct (TT_Info::INTERFACE_NAMES[i], type_struct.in ());
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Service_Type_Exporter::describe_all_types");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Service_Type_Exporter::fully_describe_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType))
+{
+ ACE_TRY
+ {
+ ACE_DEBUG ((LM_DEBUG, "*** TAO_Service_Type_Exporter::"
+ "fully describing all types in the Repository.\n"));
+
+ for (int i = 0; i < NUM_TYPES; i++)
+ {
+ CosTradingRepos::ServiceTypeRepository::TypeStruct_var type_struct =
+ this->repos_->fully_describe_type (TT_Info::INTERFACE_NAMES[i]
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->verbose_)
+ {
+ this->dump_typestruct (TT_Info::INTERFACE_NAMES[i], type_struct.in ());
+ ACE_DEBUG ((LM_DEBUG, "------------------------------\n"));
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_Service_Type_Exporter::fully_describe_all_types");
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+TAO_Service_Type_Exporter::
+dump_typestruct (const char* type_name,
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct& type_struct) const
+{
+ const char* mode_str[] =
+ {
+ "Normal",
+ "Read only",
+ "Mandatory",
+ "Mandatory and Readonly"
+ };
+
+ ACE_DEBUG ((LM_DEBUG, "Type Name: %s\n", type_name));
+ ACE_DEBUG ((LM_DEBUG, "Interface Name: %s\n", type_struct.if_name.in ()));
+
+ int i = 0;
+ for (i = type_struct.super_types.length () - 1; i >= 0; i--)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Super Type: %s\n",
+ (const char *) type_struct.super_types[i]));
+ }
+
+ for (i = type_struct.props.length () - 1; i >= 0; i--)
+ {
+ ACE_DEBUG ((LM_DEBUG, "Property: %-20s Mode: %-24s\n",
+ type_struct.props[i].name.in (),
+ mode_str[type_struct.props[i].mode]));
+ }
+}
+
+void
+TAO_Service_Type_Exporter::create_types (void)
+{
+ TT_Info::Remote_Output ro;
+ this->type_structs_[TT_Info::REMOTE_IO].props.length (6);
+ this->type_structs_[TT_Info::REMOTE_IO].props[0].name =
+ TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::NAME];
+ this->type_structs_[TT_Info::REMOTE_IO].props[0].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::REMOTE_IO].props[0].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY_READONLY;
+ this->type_structs_[TT_Info::REMOTE_IO].props[1].name =
+ TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::LOCATION];
+ this->type_structs_[TT_Info::REMOTE_IO].props[1].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::REMOTE_IO].props[1].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY;
+ this->type_structs_[TT_Info::REMOTE_IO].props[2].name =
+ TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::DESCRIPTION];
+ this->type_structs_[TT_Info::REMOTE_IO].props[2].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::REMOTE_IO].props[2].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::REMOTE_IO].props[3].name =
+ TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::HOST_NAME];
+ this->type_structs_[TT_Info::REMOTE_IO].props[3].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::REMOTE_IO].props[3].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY;
+ this->type_structs_[TT_Info::REMOTE_IO].props[4].name =
+ TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::TRADER_NAME];
+ this->type_structs_[TT_Info::REMOTE_IO].props[4].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::REMOTE_IO].props[4].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::REMOTE_IO].props[5].name =
+ TT_Info::REMOTE_IO_PROPERTY_NAMES[TT_Info::MISCELLANEOUS];
+ this->type_structs_[TT_Info::REMOTE_IO].props[5].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::REMOTE_IO].props[5].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+
+ this->type_structs_[TT_Info::REMOTE_IO].if_name =
+ ro._interface_repository_id ();
+
+ TT_Info::Plotter pl;
+ this->type_structs_[TT_Info::PLOTTER].props.length (6);
+ this->type_structs_[TT_Info::PLOTTER].super_types.length (1);
+ this->type_structs_[TT_Info::PLOTTER].super_types[0] =
+ TT_Info::INTERFACE_NAMES[TT_Info::REMOTE_IO];
+ this->type_structs_[TT_Info::PLOTTER].props[0].name =
+ TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_NUM_COLORS];
+ this->type_structs_[TT_Info::PLOTTER].props[0].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_long);
+ this->type_structs_[TT_Info::PLOTTER].props[0].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::PLOTTER].props[1].name =
+ TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_AUTO_LOADING];
+ this->type_structs_[TT_Info::PLOTTER].props[1].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_boolean);
+ this->type_structs_[TT_Info::PLOTTER].props[1].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_READONLY;
+ this->type_structs_[TT_Info::PLOTTER].props[2].name =
+ TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_COST_PER_PAGE];
+ this->type_structs_[TT_Info::PLOTTER].props[2].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_float);
+ this->type_structs_[TT_Info::PLOTTER].props[2].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::PLOTTER].props[3].name =
+ TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_MODEL_NUMBER];
+ this->type_structs_[TT_Info::PLOTTER].props[3].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::PLOTTER].props[3].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_READONLY;
+ this->type_structs_[TT_Info::PLOTTER].props[4].name =
+ TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_USER_QUEUE];
+ this->type_structs_[TT_Info::PLOTTER].props[4].value_type =
+ CORBA::TypeCode::_duplicate (TAO_Trader_Test::_tc_StringSeq);
+ this->type_structs_[TT_Info::PLOTTER].props[4].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::PLOTTER].props[5].name =
+ TT_Info::PLOTTER_PROPERTY_NAMES[TT_Info::PLOTTER_FILE_SIZES_PENDING];
+ this->type_structs_[TT_Info::PLOTTER].props[5].value_type =
+ CORBA::TypeCode::_duplicate (TAO_Trader_Test::_tc_ULongSeq);
+ this->type_structs_[TT_Info::PLOTTER].props[5].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::PLOTTER].if_name =
+ pl._interface_repository_id ();
+
+ TT_Info::Printer pr;
+ this->type_structs_[TT_Info::PRINTER].props.length (7);
+ this->type_structs_[TT_Info::PRINTER].super_types.length (1);
+ this->type_structs_[TT_Info::PRINTER].super_types[0] =
+ TT_Info::INTERFACE_NAMES[TT_Info::REMOTE_IO];
+ this->type_structs_[TT_Info::PRINTER].props[0].name =
+ TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_COLOR];
+ this->type_structs_[TT_Info::PRINTER].props[0].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_boolean);
+ this->type_structs_[TT_Info::PRINTER].props[0].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY_READONLY;
+ this->type_structs_[TT_Info::PRINTER].props[1].name =
+ TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_DOUBLE_SIDED];
+ this->type_structs_[TT_Info::PRINTER].props[1].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_boolean);
+ this->type_structs_[TT_Info::PRINTER].props[1].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_READONLY;
+ this->type_structs_[TT_Info::PRINTER].props[2].name =
+ TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_COST_PER_PAGE];
+ this->type_structs_[TT_Info::PRINTER].props[2].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_float);
+ this->type_structs_[TT_Info::PRINTER].props[2].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::PRINTER].props[3].name =
+ TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_MODEL_NUMBER];
+ this->type_structs_[TT_Info::PRINTER].props[3].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_string);
+ this->type_structs_[TT_Info::PRINTER].props[3].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_READONLY;
+ this->type_structs_[TT_Info::PRINTER].props[4].name =
+ TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_PAGES_PER_SEC];
+ this->type_structs_[TT_Info::PRINTER].props[4].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_ushort);
+ this->type_structs_[TT_Info::PRINTER].props[4].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_READONLY;
+ this->type_structs_[TT_Info::PRINTER].props[5].name =
+ TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_USER_QUEUE];
+ this->type_structs_[TT_Info::PRINTER].props[5].value_type =
+ CORBA::TypeCode::_duplicate (TAO_Trader_Test::_tc_StringSeq);
+ this->type_structs_[TT_Info::PRINTER].props[5].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::PRINTER].props[6].name =
+ TT_Info::PRINTER_PROPERTY_NAMES[TT_Info::PRINTER_FILE_SIZES_PENDING];
+ this->type_structs_[TT_Info::PRINTER].props[6].value_type =
+ CORBA::TypeCode::_duplicate (TAO_Trader_Test::_tc_ULongSeq);
+ this->type_structs_[TT_Info::PRINTER].props[6].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::PRINTER].if_name =
+ pr._interface_repository_id ();
+
+ TT_Info::File_System fs;
+ this->type_structs_[TT_Info::FILESYSTEM].props.length (3);
+ this->type_structs_[TT_Info::FILESYSTEM].super_types.length (1);
+ this->type_structs_[TT_Info::FILESYSTEM].super_types[0] =
+ TT_Info::INTERFACE_NAMES[TT_Info::REMOTE_IO];
+ this->type_structs_[TT_Info::FILESYSTEM].props[0].name =
+ TT_Info::FILESYSTEM_PROPERTY_NAMES[TT_Info::DISK_SIZE];
+ this->type_structs_[TT_Info::FILESYSTEM].props[0].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_ulong);
+ this->type_structs_[TT_Info::FILESYSTEM].props[0].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY_READONLY;
+ this->type_structs_[TT_Info::FILESYSTEM].props[1].name =
+ TT_Info::FILESYSTEM_PROPERTY_NAMES[TT_Info::SPACE_REMAINING];
+ this->type_structs_[TT_Info::FILESYSTEM].props[1].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_ulong);
+ this->type_structs_[TT_Info::FILESYSTEM].props[1].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::FILESYSTEM].props[2].name =
+ TT_Info::FILESYSTEM_PROPERTY_NAMES[TT_Info::PERMISSION_LEVEL];
+ this->type_structs_[TT_Info::FILESYSTEM].props[2].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_ushort);
+ this->type_structs_[TT_Info::FILESYSTEM].props[2].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
+ this->type_structs_[TT_Info::FILESYSTEM].if_name =
+ fs._interface_repository_id ();
+
+ TT_Info::PostScript_Printer ps;
+ this->type_structs_[TT_Info::PS_PRINTER].props.length (1);
+ this->type_structs_[TT_Info::PS_PRINTER].super_types.length (1);
+ this->type_structs_[TT_Info::PS_PRINTER].super_types[0] =
+ TT_Info::INTERFACE_NAMES[TT_Info::PRINTER];
+ this->type_structs_[TT_Info::PS_PRINTER].props[0].name =
+ TT_Info::PS_PRINTER_PROPERTY_NAMES[TT_Info::VERSION];
+ this->type_structs_[TT_Info::PS_PRINTER].props[0].value_type =
+ CORBA::TypeCode::_duplicate (CORBA::_tc_ushort);
+ this->type_structs_[TT_Info::PS_PRINTER].props[0].mode =
+ CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY_READONLY;
+ this->type_structs_[TT_Info::PS_PRINTER].if_name =
+ ps._interface_repository_id ();
+}
diff --git a/TAO/orbsvcs/tests/Trading/Service_Type_Exporter.h b/TAO/orbsvcs/tests/Trading/Service_Type_Exporter.h
new file mode 100644
index 00000000000..a4a0e011e77
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Service_Type_Exporter.h
@@ -0,0 +1,122 @@
+// $Id$
+
+// ========================================================================
+//
+// = FILE
+// Offer_Exporter.h
+//
+// = DESCRIPTION
+// Class that tests the Trading Service's Service Type Repository
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// =======================================================================
+
+#ifndef TAO_SERVICE_TYPE_EXPORTER_H
+#define TAO_SERVICE_TYPE_EXPORTER_H
+
+#include "TT_Info.h"
+#include "ttest_export.h"
+
+class TAO_TTest_Export TAO_Service_Type_Exporter
+{
+public:
+
+ TAO_Service_Type_Exporter (CosTrading::Lookup_ptr lookup_if,
+ CORBA::Boolean verbose
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void remove_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::HasSubTypes));
+ // Remove all service types from the trading service instance.
+
+ void add_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeExists,
+ CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName));
+ // Add all the generated service types to the trading service instance.
+
+ void add_all_types_to_all (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeExists,
+ CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName));
+ // Add all the generated service types to all the trading service
+ // instances linked to the trading service we bootstrapped to.
+
+ void list_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ // List all the service types registered with the trading service
+ // instance.
+
+ void describe_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType));
+ // Describe all the service types registered with the trading
+ // service instance.
+
+ void fully_describe_all_types (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTrading::UnknownServiceType));
+ // Same as describe_all_types, but fully describe lists the
+ // properties of all service types the described service type
+ // inherits from.
+
+private:
+
+ void create_types (void);
+ // Generate the service type description structures.
+
+ void add_all_types_to (CosTradingRepos::ServiceTypeRepository_ptr repos
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CosTrading::IllegalServiceType,
+ CosTradingRepos::ServiceTypeRepository::ServiceTypeExists,
+ CosTradingRepos::ServiceTypeRepository::InterfaceTypeMismatch,
+ CosTrading::IllegalPropertyName,
+ CosTrading::DuplicatePropertyName,
+ CosTradingRepos::ServiceTypeRepository::ValueTypeRedefinition,
+ CosTrading::UnknownServiceType,
+ CosTradingRepos::ServiceTypeRepository::DuplicateServiceTypeName));
+ // Add all types to a sepcified service type repository reference.
+
+ void
+ dump_typestruct (const char* type_name,
+ const CosTradingRepos::ServiceTypeRepository::TypeStruct& type_struct) const;
+ // Dump the contents of a service type description to standard
+ // output.
+
+ CORBA::Boolean verbose_;
+ // True if the user want profuse output.
+
+ CosTrading::Lookup_ptr lookup_;
+ // A reference to the lookup interface of the trading service
+ // instance.
+
+ CosTradingRepos::ServiceTypeRepository_var repos_;
+ // A reference to a service type repository instance.
+
+ CosTradingRepos::ServiceTypeRepository::TypeStruct type_structs_[NUM_TYPES];
+ // Descriptions of all the service types whose property names are
+ // defined in TT_Info.
+};
+
+#endif /* TAO_SERVICE_TYPE_EXPORTER_H */
diff --git a/TAO/orbsvcs/tests/Trading/Simple_Dynamic.cpp b/TAO/orbsvcs/tests/Trading/Simple_Dynamic.cpp
new file mode 100644
index 00000000000..c28feb6e4f3
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Simple_Dynamic.cpp
@@ -0,0 +1,30 @@
+// $Id$
+
+#ifndef TAO_SIMPLE_DYNAMIC_C
+#define TAO_SIMPLE_DYNAMIC_C
+
+#include "Simple_Dynamic.h"
+
+ACE_RCSID(Trading, Simple_Dynamic, "$Id$")
+
+template <class T>
+TAO_Simple_Dynamic_Property<T>::TAO_Simple_Dynamic_Property (const T& dp)
+ : dp_ (dp)
+{
+}
+
+template <class T> CORBA::Any*
+TAO_Simple_Dynamic_Property<T>::evalDP (const char*,
+ CORBA::TypeCode_ptr,
+ const CORBA::Any&
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure))
+{
+ CORBA::Any* return_value = 0;
+ ACE_NEW_RETURN (return_value, CORBA::Any, 0);
+
+ (*return_value) <<= this->dp_;
+ return return_value;
+}
+
+#endif /* TAO_SIMPLE_DYNAMIC_C */
diff --git a/TAO/orbsvcs/tests/Trading/Simple_Dynamic.h b/TAO/orbsvcs/tests/Trading/Simple_Dynamic.h
new file mode 100644
index 00000000000..0f7e395b8f5
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Simple_Dynamic.h
@@ -0,0 +1,51 @@
+// $Id$
+
+// ========================================================================
+//
+// = FILE
+// Simple_Dyanmic.h
+//
+// = DESCRIPTION
+// Class that implements a really simple dynamic property.
+//
+// = AUTHOR
+// Seth Widoff <sbw1@cs.wustl.edu>
+//
+// =======================================================================
+
+#ifndef TAO_SIMPLE_DYNAMIC_H
+#define TAO_SIMPLE_DYNAMIC_H
+
+#include "orbsvcs/Trader/Trader_Utils.h"
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+template<class T>
+class TAO_Simple_Dynamic_Property : public TAO_Dynamic_Property
+{
+public:
+
+ TAO_Simple_Dynamic_Property (const T& dp);
+
+ virtual CORBA::Any* evalDP (const char* /* name */,
+ CORBA::TypeCode_ptr /* returned_type */,
+ const CORBA::Any& /* extra_info */
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure));
+
+private:
+ T dp_;
+};
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Simple_Dynamic.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#endif /* TAO_SIMPLE_DYNAMIC_H */
diff --git a/TAO/orbsvcs/tests/Trading/TT_Info.cpp b/TAO/orbsvcs/tests/Trading/TT_Info.cpp
new file mode 100644
index 00000000000..e13b3b0766b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/TT_Info.cpp
@@ -0,0 +1,354 @@
+// $Id$
+
+#include "TT_Info.h"
+#include "orbsvcs/Trader/Trader_Utils.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_string.h"
+
+ACE_RCSID(Trading, TT_Info, "$Id$")
+
+const char* TT_Info::INTERFACE_NAMES[] =
+{
+ "TAO_Trader_Test::Remote_IO",
+ "TAO_Trader_Test::Plotter",
+ "TAO_Trader_Test::Printer",
+ "TAO_Trader_Test::File_System",
+ "TAO_Trader_Test::PostScript_Printer"
+};
+
+const char* TT_Info::REMOTE_IO_NAME = "Remote_IO";
+
+const char* TT_Info::REMOTE_IO_PROPERTY_NAMES[] =
+{
+ "Name",
+ "Location",
+ "Description",
+ "Host_Name",
+ "Trader_Name",
+ "Miscellaneous"
+};
+
+const char* TT_Info::PLOTTER_NAME = "Plotter";
+
+const char* TT_Info::PLOTTER_PROPERTY_NAMES[] =
+{
+ "Num_Colors",
+ "Auto_Loading",
+ "Cost_Per_Page",
+ "Model_Number",
+ "User_Queue",
+ "File_Sizes_Pending"
+};
+
+const char* TT_Info::PRINTER_NAME = "Printer";
+
+const char* TT_Info::PRINTER_PROPERTY_NAMES[] =
+{
+ "Color",
+ "Double_Sided",
+ "Cost_Per_Page",
+ "Model_Number",
+ "Pages_Per_Sec",
+ "User_Queue",
+ "File_Sizes_Pending"
+};
+
+const char* TT_Info::FILESYSTEM_NAME = "File_System";
+
+const char* TT_Info::FILESYSTEM_PROPERTY_NAMES[] =
+{
+ "Disk_Space",
+ "Space_Remaining",
+ "Permission_Level"
+};
+
+const char* TT_Info::PS_PRINTER_PROPERTY_NAMES[] =
+{
+ "Version"
+};
+
+const char* TT_Info::PS_PRINTER_NAME = "PostScript_Printer";
+
+const char* TT_Info::LOCATIONS[] =
+{
+ "Bryan 509",
+ "Bryan 503",
+ "Dunker 102",
+ "Jolley 408",
+ "Lopata 401",
+ "January 110",
+ "Cupples I 30",
+ "Cupples II 201",
+ "Urbauer 321",
+ "Umrath 302",
+ "Wilson 110",
+ "Olin 239",
+ "Simon 238",
+ "Rebstock 232",
+ "McMillan 123"
+};
+
+const char* TT_Info::USERS[] =
+{
+ "sbw1",
+ "schmidt",
+ "naga",
+ "alex",
+ "mk1",
+ "marina",
+ "sumedh",
+ "sergio",
+ "coryan",
+ "cdgill",
+ "levine",
+ "jxh",
+ "irfan",
+ "nanbor",
+ "eea1",
+ "brunsch"
+};
+
+const char* TT_Info::MODEL_NUMBERS[] =
+{
+ "HP238293892bn2398",
+ "PK92839nkse092309",
+ "8328323n293kljs98",
+ "29309sjdkq34jksd2",
+ "09q834efjhqw834q3",
+ "q9834fdkjwq0934kf",
+ "q834jfda09q834djk",
+ "kajsd09q384kjda90",
+ "9p83q4jklsdj098q3",
+ "09a834ojfda09wu3r",
+ "09234kejdfq934jed",
+ "0q83kjefd09384jda",
+ "asdfj0283jkdf0923",
+ "kladfp72wu34j230f",
+ "9q834jidlj234ujof"
+};
+
+const int TT_Info::NUM_QUERIES = 7;
+const char* TT_Info::QUERIES[][3] =
+{
+ {INTERFACE_NAMES[REMOTE_IO], "", ""},
+ {INTERFACE_NAMES[REMOTE_IO], "'Cupples' ~ Location", ""},
+ {INTERFACE_NAMES[PLOTTER], "'sbw1' in User_Queue", "min Cost_Per_Page"},
+ {INTERFACE_NAMES[PLOTTER], "Num_Colors > 1 and 'Cupples' ~ Location", "min Cost_Per_Page"},
+ {INTERFACE_NAMES[PRINTER], "Pages_Per_Sec > 3 and Color == TRUE", "with 'sbw1' in User_Queue"},
+ {INTERFACE_NAMES[PRINTER], "Color == TRUE or Double_Sided == TRUE", "random"},
+ {INTERFACE_NAMES[PRINTER], "(Color or Double_Sided) and 'sbw1' in User_Queue", "with 'Cupples' ~ Location"}
+};
+
+void
+TT_Info::dump_properties (const CosTrading::PropertySeq& prop_seq,
+ CORBA::Boolean print_dynamic
+ ACE_ENV_ARG_DECL)
+{
+ TAO_Property_Evaluator prop_eval (prop_seq);
+
+ for (int length = prop_seq.length (), k = 0; k < length; k++)
+ {
+ CORBA::ULong seq_length = 0, i= 0;
+ CORBA::Any* value = 0;
+ CORBA::TypeCode_ptr tc = 0;
+ ACE_DEBUG ((LM_DEBUG, "%-15s: ", prop_seq[k].name.in ()));
+ ACE_TRY
+ {
+ CORBA::Boolean is_dynamic = prop_eval.is_dynamic_property (k);
+ ACE_TRY_CHECK;
+
+ if (print_dynamic || ! is_dynamic)
+ {
+ value = prop_eval.property_value(k ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ tc = value->type ();
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Dynamic Property\n"));
+ }
+ }
+ ACE_CATCHANY
+ {
+ // @@ Seth, don't pass the exceptions back?
+ ACE_DEBUG ((LM_DEBUG, "Error retrieving property value.\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ if (tc == 0)
+ continue;
+ int check = tc->equal (TAO_Trader_Test::_tc_StringSeq ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (check)
+ {
+ TAO_Trader_Test::StringSeq* str_seq;
+ (*value) >>= str_seq;
+
+ for (seq_length = str_seq->length (), i = 0; i < seq_length; i++)
+ ACE_DEBUG ((LM_DEBUG, "%s ", (const char *) (*str_seq)[i]));
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ }
+ else
+ {
+ check = tc->equal (TAO_Trader_Test::_tc_ULongSeq ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (check)
+ {
+ TAO_Trader_Test::ULongSeq* ulong_seq;
+ (*value) >>= ulong_seq;
+
+ for (seq_length = ulong_seq->length (), i = 0; i < seq_length; i++)
+ ACE_DEBUG ((LM_DEBUG, "%d ", (*ulong_seq)[i]));
+
+ ACE_DEBUG ((LM_DEBUG, "\n"));
+ }
+ else
+ {
+ // @@ Print the any value...
+ CORBA::Char char_val;
+ CORBA::Octet octet_val;
+ CORBA::Boolean boolean_val;
+ CORBA::Short short_val;
+ CORBA::UShort ushort_val;
+ CORBA::Long long_val;
+ CORBA::ULong ulong_val;
+ CORBA::Float float_val;
+ CORBA::Double double_val;
+ const char * string_val;
+
+ if ((*value) >>= CORBA::Any::to_char (char_val))
+ {
+ ACE_DEBUG ((LM_DEBUG, "%c\n", char_val));
+ }
+ else if ((*value) >>= CORBA::Any::to_octet (octet_val))
+ {
+ ACE_DEBUG ((LM_DEBUG, "%c\n", octet_val));
+ }
+ else if ((*value) >>= CORBA::Any::to_boolean (boolean_val))
+ {
+ ACE_DEBUG ((LM_DEBUG, "%s\n",
+ boolean_val?"TRUE":"FALSE"));
+ }
+ else if ((*value) >>= short_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%d\n", short_val));
+ }
+ else if ((*value) >>= ushort_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%ld\n", ushort_val));
+ }
+ else if ((*value) >>= long_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%d\n", long_val));
+ }
+ else if ((*value) >>= ulong_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%ld\n", ulong_val));
+ }
+ else if ((*value) >>= float_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%f\n", long_val));
+ }
+ else if ((*value) >>= double_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%f\n", double_val));
+ }
+ else if ((*value) >>= string_val)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%s\n", string_val));
+ }
+ }
+ }
+ }
+}
+
+TT_Parse_Args::TT_Parse_Args (int& argc, char** argv)
+ : federated_ (0),
+ quiet_ (0),
+ ior_ (0)
+{
+ ACE_Arg_Shifter arg_shifter (argc, argv);
+
+ while (arg_shifter.is_anything_left ())
+ {
+ const char *current_arg = arg_shifter.get_current ();
+
+ if (ACE_OS::strcmp (current_arg, "-f") == 0 ||
+ ACE_OS::strcmp (current_arg, "-federate") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->federated_ = 1;
+ }
+ else if (ACE_OS::strcmp (current_arg, "-q") == 0 ||
+ ACE_OS::strcmp (current_arg, "-quiet") == 0)
+ {
+ arg_shifter.consume_arg ();
+ this->quiet_ = 1;
+ }
+ else if (ACE_OS::strcmp (current_arg, "-i") == 0 ||
+ ACE_OS::strcmp (current_arg, "-iorfile") == 0)
+ {
+ arg_shifter.consume_arg ();
+ FILE* ior_file = 0;
+
+ if (arg_shifter.is_parameter_next ())
+ {
+ const char* file_name = arg_shifter.get_current ();
+ ior_file = ACE_OS::fopen (file_name, "r");
+
+ if (ior_file == 0)
+ ACE_ERROR ((LM_ERROR,
+ "Unable to open %s for reading: %p\n",
+ file_name));
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ ior_file = ACE_OS::fdopen (ACE_STDIN, "r");
+
+ if (ior_file != 0)
+ {
+ ACE_Read_Buffer read_buffer (ior_file, 1);
+ this->ior_ = read_buffer.read ();
+ }
+ else
+ ACE_ERROR ((LM_ERROR, "Couldn't load ior.\n"));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Ignoring argument <%s>\n",
+ current_arg));
+ arg_shifter.consume_arg ();
+ }
+ }
+}
+
+TT_Parse_Args::~TT_Parse_Args ()
+{
+ // Reclaim the ior string's memory.
+ ACE_Allocator* alloc = ACE_Allocator::instance ();
+ alloc->free (this->ior_);
+}
+
+int
+TT_Parse_Args::federated () const
+{
+ return this->federated_;
+}
+
+int
+TT_Parse_Args::quiet () const
+{
+ return this->quiet_;
+}
+
+char*
+TT_Parse_Args::ior () const
+{
+ return this->ior_;
+}
diff --git a/TAO/orbsvcs/tests/Trading/TT_Info.h b/TAO/orbsvcs/tests/Trading/TT_Info.h
new file mode 100644
index 00000000000..de4935df75c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/TT_Info.h
@@ -0,0 +1,206 @@
+// $Id$
+
+#ifndef TAO_TRADER_TEST_UTILS_H
+#define TAO_TRADER_TEST_UTILS_H
+
+#include "TTestS.h"
+#include "ace/Arg_Shifter.h"
+#include "ace/Read_Buffer.h"
+#include "orbsvcs/CosTradingC.h"
+#include "orbsvcs/CosTradingReposC.h"
+#include "orbsvcs/CosTradingDynamicC.h"
+#include "ttest_export.h"
+
+class TAO_TTest_Export TT_Info
+{
+public:
+
+ static void dump_properties (const CosTrading::PropertySeq& prop_seq,
+ CORBA::Boolean print_dynamic = 1
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ // Dump the contents of this property sequence.
+
+ enum INTERFACES
+ {
+ REMOTE_IO,
+ PLOTTER,
+ PRINTER,
+ FILESYSTEM,
+ PS_PRINTER
+ };
+
+ // = Test servants.
+
+ class Remote_Output :
+ public POA_TAO_Trader_Test::Remote_Output
+ {
+ public:
+
+ Remote_Output (void) {}
+
+ virtual void confirm (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException)) {}
+ // Method to test that the importer received a valid reference to
+ // the exported object.
+ };
+
+ class TAO_TTest_Export Printer :
+ public POA_TAO_Trader_Test::Printer
+ {
+ public:
+
+ Printer (void) {}
+
+ virtual void confirm (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException)) {}
+ // Method to test that the importer received a valid reference to
+ // the exported object.
+ };
+
+ class TAO_TTest_Export Plotter :
+ public POA_TAO_Trader_Test::Plotter
+ {
+ public:
+ Plotter (void) {}
+
+ virtual void confirm (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException)) {}
+ // Method to test that the importer received a valid reference to
+ // the exported object.
+ };
+
+ class TAO_TTest_Export File_System :
+ public POA_TAO_Trader_Test::File_System
+ {
+ public:
+ File_System (void) {}
+
+ virtual void confirm (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException)) {}
+ // Method to test that the importer received a valid reference to
+ // the exported object.
+ };
+
+ class TAO_TTest_Export PostScript_Printer :
+ public POA_TAO_Trader_Test::PostScript_Printer
+ {
+ public:
+ PostScript_Printer (void) {}
+
+ virtual void confirm (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException)) {}
+ // Method to test that the importer received a valid reference to
+ // the exported object.
+ };
+
+#define NUM_TYPES 5
+ static const char* INTERFACE_NAMES[];
+
+ // = Remote IO property descriptions
+
+ enum REMOTE_IO_PROPERTIES
+ {
+ NAME,
+ LOCATION,
+ DESCRIPTION,
+ HOST_NAME,
+ TRADER_NAME,
+ MISCELLANEOUS
+ };
+
+ static const char* REMOTE_IO_NAME;
+ static const char* REMOTE_IO_PROPERTY_NAMES[];
+
+ // = Plotter property descriptions
+
+ enum PLOTTER_PROPERTIES
+ {
+ PLOTTER_NUM_COLORS,
+ PLOTTER_AUTO_LOADING,
+ PLOTTER_COST_PER_PAGE,
+ PLOTTER_MODEL_NUMBER,
+ PLOTTER_USER_QUEUE,
+ PLOTTER_FILE_SIZES_PENDING
+ };
+
+ static const char* PLOTTER_NAME;
+ static const char* PLOTTER_PROPERTY_NAMES[];
+
+ // = Printer property descriptions
+
+ enum PRINTER_PROPERTIES
+ {
+ PRINTER_COLOR,
+ PRINTER_DOUBLE_SIDED,
+ PRINTER_COST_PER_PAGE,
+ PRINTER_MODEL_NUMBER,
+ PRINTER_PAGES_PER_SEC,
+ PRINTER_USER_QUEUE,
+ PRINTER_FILE_SIZES_PENDING
+ };
+
+ static const char* PRINTER_NAME;
+ static const char* PRINTER_PROPERTY_NAMES[];
+
+ // = File System Property Descriptions
+
+ enum FILESYSTEM_PROPERTIES
+ {
+ DISK_SIZE,
+ SPACE_REMAINING,
+ PERMISSION_LEVEL
+ };
+
+ static const char* FILESYSTEM_NAME;
+ static const char* FILESYSTEM_PROPERTY_NAMES[];
+
+ // = PostScript Printer property descriptions.
+
+ enum PS_PRINTER_PROPERTIES
+ {
+ VERSION
+ };
+
+ static const char* PS_PRINTER_NAME;
+ static const char* PS_PRINTER_PROPERTY_NAMES[];
+
+ // = Offer Info
+
+#define NUM_OFFERS 15
+ static const char* LOCATIONS[];
+ static const char* USERS[];
+ static const char* MODEL_NUMBERS[];
+
+ // = Query info
+
+ static const int NUM_QUERIES;
+ static const char* QUERIES[][3];
+};
+
+class TAO_TTest_Export TT_Parse_Args
+ // = TITLE
+ // Utility to parse the command-line arguments to the trading service tests.
+{
+ public:
+
+ TT_Parse_Args (int& argc, char** argv);
+
+ ~TT_Parse_Args ();
+
+ int federated () const;
+ // True if the test should test the federated features of the trading
+ // service.
+
+ int quiet () const;
+ // True if the tests should supress all but the most essential output.
+
+ char* ior () const;
+ // Not null if the test user supplied an explicit ior.
+
+ private:
+
+ int federated_, quiet_;
+ char* ior_;
+};
+
+#endif /* TAO_TRADER_TEST_UTILS_H */
diff --git a/TAO/orbsvcs/tests/Trading/TTest.idl b/TAO/orbsvcs/tests/Trading/TTest.idl
new file mode 100644
index 00000000000..d518aa1b58f
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/TTest.idl
@@ -0,0 +1,44 @@
+// $Id$
+
+#include <orb.idl>
+
+module TAO_Trader_Test
+{
+
+interface Remote_Output
+{
+ // Ensure that the object reference returned from the query actually
+ // works.
+ void confirm ();
+};
+
+interface Plotter : Remote_Output
+{
+};
+
+interface Printer : Remote_Output
+{
+};
+
+interface File_System : Remote_Output
+{
+};
+
+interface PostScript_Printer : Remote_Output
+{
+};
+
+// Sequences used to test sequence type equivalence in the trader.
+typedef sequence<short> ShortSeq;
+typedef sequence<unsigned short> UShortSeq;
+typedef sequence<long> LongSeq;
+typedef sequence<unsigned long> ULongSeq;
+typedef sequence<boolean> BooleanSeq;
+typedef sequence<float> FloatSeq;
+typedef sequence<double> DoubleSeq;
+typedef sequence<string> StringSeq;
+};
+
+
+
+
diff --git a/TAO/orbsvcs/tests/Trading/Trading.mpc b/TAO/orbsvcs/tests/Trading/Trading.mpc
new file mode 100644
index 00000000000..008ef7449a7
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/Trading.mpc
@@ -0,0 +1,61 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Test Lib): orbsvcslib, trading_serv, naming, utils, pi, codecfactory {
+ sharedname = TTest
+ idlflags += -I..\..\.. -I..\..\..\orbsvcs -Sc -Wb,export_macro=TAO_TTest_Export -Wb,export_include=ttest_export.h
+ dynamicflags = TAO_TTEST_BUILD_DLL
+
+ Source_Files {
+ TT_Info.cpp
+ Service_Type_Exporter.cpp
+ Offer_Exporter.cpp
+ Offer_Importer.cpp
+ Simple_Dynamic.cpp
+ }
+ Header_Files {
+ ttest_export.h
+ TT_Info.h
+ Service_Type_Exporter.h
+ Offer_Exporter.h
+ Offer_Importer.h
+ Simple_Dynamic.h
+ }
+}
+
+project(*export test): namingexe, trading_serv, utils {
+ after += Trading_Test_Lib
+ libs += TTest
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ export_test.cpp
+ }
+}
+
+project(*import test): namingexe, trading_serv, utils {
+ after += Trading_Test_Lib
+ libs += TTest
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ import_test.cpp
+ }
+}
+
+project(*colocated test): namingexe, trading_serv, utils {
+ after += Trading_Test_Lib
+ libs += TTest
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ colocated_test.cpp
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/Trading/colocated_test.cpp b/TAO/orbsvcs/tests/Trading/colocated_test.cpp
new file mode 100644
index 00000000000..67d9232a315
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/colocated_test.cpp
@@ -0,0 +1,133 @@
+// $Id$
+
+#include "ace/Auto_Ptr.h"
+#include "ace/Get_Opt.h"
+#include "tao/Utils/ORB_Manager.h"
+#include "Offer_Exporter.h"
+#include "Offer_Importer.h"
+#include "Service_Type_Exporter.h"
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Service_Type_Repository.h"
+
+ACE_RCSID (Trading,
+ colocated_test,
+ "$Id$")
+
+void
+parse_args (int argc, char *argv[],
+ CORBA::Boolean& verbose)
+{
+ int opt;
+ ACE_Get_Opt get_opt (argc, argv, "fq");
+
+ verbose = 1;
+ while ((opt = get_opt ()) != EOF)
+ {
+ if (opt == 'q')
+ verbose = 0;
+ }
+}
+
+int
+main (int argc, char** argv)
+{
+ ACE_TRY_NEW_ENV
+ {
+ TAO_ORB_Manager orb_manager;
+ orb_manager.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Command line argument interpretation.
+ CORBA::Boolean verbose = 0;
+ ::parse_args (argc, argv, verbose);
+
+ // Initialize ORB.
+ CORBA::ORB_var orb = orb_manager.orb ();
+
+ // Create a Service Type Repository and a Trader Object.
+ TAO_Service_Type_Repository type_repos;
+ auto_ptr<TAO_Trader_Factory::TAO_TRADER> trader (TAO_Trader_Factory::create_trader (argc, argv));
+ TAO_Support_Attributes_i& sup_attr = trader->support_attributes ();
+ TAO_Trading_Components_i& trd_comp = trader->trading_components ();
+
+ // Set the service type repository
+ sup_attr.type_repos (type_repos._this (ACE_ENV_SINGLE_ARG_PARAMETER));
+ ACE_TRY_CHECK;
+
+ // Run the Service Type Exporter tests
+ ACE_DEBUG ((LM_DEBUG, "*** Running the Service Type Exporter tests.\n"));
+ TAO_Service_Type_Exporter type_exporter
+ (CosTrading::Lookup::_duplicate (trd_comp.lookup_if ()),
+ verbose
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.remove_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.add_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.list_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.describe_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.fully_describe_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the Offer Exporter tests
+ ACE_DEBUG ((LM_DEBUG, "*** Running the Offer Exporter tests.\n"));
+ TAO_Offer_Exporter offer_exporter
+ (CosTrading::Lookup::_duplicate (trd_comp.lookup_if ()),
+ verbose
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.withdraw_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.export_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.modify_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.withdraw_offers_using_constraints (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.withdraw_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.export_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the Offer Importer tests
+ ACE_DEBUG ((LM_DEBUG, "*** Running the Offer Importer tests.\n"));
+ TAO_Offer_Importer offer_importer
+ (CosTrading::Lookup::_duplicate (trd_comp.lookup_if ()), verbose);
+
+ offer_importer.perform_queries (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "Trader Export Tests Failed"), -1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Trading/export_test.cpp b/TAO/orbsvcs/tests/Trading/export_test.cpp
new file mode 100644
index 00000000000..9078aa74b23
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/export_test.cpp
@@ -0,0 +1,158 @@
+// $Id$
+
+#include "tao/Utils/ORB_Manager.h"
+#include "Offer_Exporter.h"
+#include "Offer_Importer.h"
+#include "Service_Type_Exporter.h"
+#include "ace/Auto_Ptr.h"
+#include "orbsvcs/Trader/Trader.h"
+#include "orbsvcs/Trader/Service_Type_Repository.h"
+
+ACE_RCSID (Trading,
+ export_test,
+ "$Id$")
+
+int
+main (int argc, char** argv)
+{
+ ACE_TRY_NEW_ENV
+ {
+ TAO_ORB_Manager orb_manager;
+ orb_manager.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Command line argument interpretation.
+ TT_Parse_Args parse_args (argc, argv);
+
+ // Init the orb and bootstrap to the trading service.
+ CORBA::ORB_var orb = orb_manager.orb ();
+ ACE_DEBUG ((LM_ERROR, "*** Bootstrap to the Lookup interface.\n"));
+
+ char* ior = parse_args.ior ();
+ CORBA::Object_var trading_obj = (ior == 0) ?
+ orb->resolve_initial_references ("TradingService") :
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (trading_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to bootstrap to the Trading Service.\n"),
+ -1);
+
+ // Narrow the lookup interface.
+ ACE_DEBUG ((LM_DEBUG, "*** Narrowing the lookup interface.\n"));
+ CosTrading::Lookup_var lookup_if =
+ CosTrading::Lookup::_narrow (trading_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the Service Type Exporter tests
+ ACE_DEBUG ((LM_DEBUG, "*** Running the Service Type Exporter tests.\n"));
+ TAO_Service_Type_Exporter type_exporter (lookup_if.in (),
+ ! parse_args.quiet ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.remove_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.add_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.remove_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.add_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args.federated ())
+ {
+ type_exporter.add_all_types_to_all (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ type_exporter.list_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.describe_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ type_exporter.fully_describe_all_types (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "*** Service Type Exporter tests complete.\n"));
+
+ // Run the Offer Exporter tests
+ ACE_DEBUG ((LM_DEBUG, "*** Running the Offer Exporter tests.\n"));
+ TAO_Offer_Exporter offer_exporter (lookup_if.in (), ! parse_args.quiet () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // = Test series.
+
+ offer_exporter.withdraw_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.export_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.modify_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.withdraw_offers_using_constraints (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.withdraw_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ offer_exporter.export_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args.federated ())
+ {
+ offer_exporter.export_offers_to_all (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ offer_exporter.describe_offers (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "*** Offer Exporter tests complete.\n"));
+ ACE_DEBUG ((LM_DEBUG, "*** Now serving dynamic properties.\n"));
+
+ size_t offset = 0;
+ char file[1024];
+ ACE_OS::strcpy(file, argv[0]);
+ if ((offset = (size_t)ACE_OS::strrchr(file, '/')) != 0) {
+ offset -= ((size_t)file - 1);
+ }
+ ACE_OS::strcpy(file + offset, "export_test_ready");
+
+ FILE *ready_file =
+ ACE_OS::fopen (file, "w");
+ if (ready_file != 0) {
+ ACE_OS::fprintf (ready_file, "The export test is ready\n");
+ ACE_OS::fclose (ready_file);
+ }
+ else {
+ ACE_DEBUG ((LM_WARNING, "Unable to open %s for output.\n", file));
+ }
+
+ orb_manager.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Trader Export Tests Failed"), -1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Trading/import_test.cpp b/TAO/orbsvcs/tests/Trading/import_test.cpp
new file mode 100644
index 00000000000..f303d292998
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/import_test.cpp
@@ -0,0 +1,60 @@
+// $Id$
+
+#include "tao/Utils/ORB_Manager.h"
+#include "Offer_Importer.h"
+
+ACE_RCSID(Trading, import_test, "$Id$")
+
+int
+main (int argc, char** argv)
+{
+ ACE_TRY_NEW_ENV
+ {
+ TAO_ORB_Manager orb_manager;
+ orb_manager.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Command line argument interpretation.
+ TT_Parse_Args parse_args (argc, argv);
+
+ // Initialize the ORB and bootstrap to the Lookup interface.
+ CORBA::ORB_var orb = orb_manager.orb ();
+ ACE_DEBUG ((LM_ERROR, "*** Bootstrap to the Lookup interface.\n"));
+ char* ior = parse_args.ior ();
+ CORBA::Object_var trading_obj = (ior == 0) ?
+ orb->resolve_initial_references ("TradingService") :
+ orb->string_to_object (ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (trading_obj.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the Trading Service.\n"),
+ -1);
+
+ // Narrow the lookup interface.
+ ACE_DEBUG ((LM_DEBUG, "*** Narrowing the lookup interface.\n"));
+ CosTrading::Lookup_var lookup_if =
+ CosTrading::Lookup::_narrow (trading_obj.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the Offer Importer tests
+ ACE_DEBUG ((LM_DEBUG, "*** Running the Offer Importer tests.\n"));
+ TAO_Offer_Importer offer_importer (lookup_if.in (), ! parse_args.quiet ());
+
+ offer_importer.perform_queries (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args.federated ())
+ {
+ offer_importer.perform_directed_queries (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "Trader Import Tests Failed."), -1);
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/Trading/run_test.pl b/TAO/orbsvcs/tests/Trading/run_test.pl
new file mode 100755
index 00000000000..845aff2f28c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/run_test.pl
@@ -0,0 +1,63 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$ior = PerlACE::LocalFile ("trading.ior");
+$ready_file = PerlACE::LocalFile ("export_test_ready");
+$sleeptime = 20;
+$port = PerlACE::random_port();
+
+unlink $ior;
+unlink $ready_file;
+
+## Specify and endpoint so that we may test the corbaloc in the
+## -ORBInitRef. We retain one -ORBInitRef using the file just to test
+## both ways.
+$TS = new PerlACE::Process ("../../Trading_Service/Trading_Service",
+ "-ORBEndpoint iiop://:$port -TSdumpior $ior");
+$E = new PerlACE::Process ("export_test",
+ "-ORBInitRef TradingService=corbaloc:::$port/TradingService -quiet");
+$I = new PerlACE::Process ("import_test",
+ "-ORBInitRef TradingService=file://$ior -quiet");
+
+if ($TS->Spawn () == -1) {
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ($ior, $sleeptime) == -1) {
+ print STDERR "ERROR: waiting for trading service IOR file\n";
+ $TS->Kill ();
+ exit 1;
+}
+
+if ($E->Spawn () == -1) {
+ $TS->Kill ();
+ exit 1;
+}
+
+if (PerlACE::waitforfile_timed ($ready_file, 120) == -1) {
+ print STDERR "ERROR: waiting for the export test to finish\n";
+ $E->Kill ();
+ $TS->Kill ();
+ exit 1;
+}
+
+$test = $I->SpawnWaitKill (60);
+$E->Kill ();
+$TS->Kill ();
+
+unlink $ior;
+unlink $ready_file;
+
+if ($test != 0) {
+ print STDERR "ERROR: import test returned $test\n";
+ exit 1;
+}
+
+exit 0;
diff --git a/TAO/orbsvcs/tests/Trading/ttest_export.h b/TAO/orbsvcs/tests/Trading/ttest_export.h
new file mode 100644
index 00000000000..630a38f0c14
--- /dev/null
+++ b/TAO/orbsvcs/tests/Trading/ttest_export.h
@@ -0,0 +1,40 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl
+// ------------------------------
+#ifndef TAO_TTEST_EXPORT_H
+#define TAO_TTEST_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (TAO_AS_STATIC_LIBS)
+# if !defined (TAO_TTEST_HAS_DLL)
+# define TAO_TTEST_HAS_DLL 0
+# endif /* ! TAO_TTEST_HAS_DLL */
+#else
+# if !defined (TAO_TTEST_HAS_DLL)
+# define TAO_TTEST_HAS_DLL 1
+# endif /* ! TAO_TTEST_HAS_DLL */
+#endif
+
+#if defined (TAO_TTEST_HAS_DLL) && (TAO_TTEST_HAS_DLL == 1)
+# if defined (TAO_TTEST_BUILD_DLL)
+# define TAO_TTest_Export ACE_Proper_Export_Flag
+# define TAO_TTest_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_TTest_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_TTEST_BUILD_DLL */
+# define TAO_TTest_Export ACE_Proper_Import_Flag
+# define TAO_TTest_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_TTest_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_TTEST_BUILD_DLL */
+#else /* TAO_TTEST_HAS_DLL == 1 */
+# define TAO_TTest_Export
+# define TAO_TTest_SINGLETON_DECLARATION(T)
+# define TAO_TTest_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_TTEST_HAS_DLL == 1 */
+
+#endif /* TAO_TTEST_EXPORT_H */
+
+// End of auto generated file.
diff --git a/TAO/orbsvcs/tests/ior_corbaname/Makefile.am b/TAO/orbsvcs/tests/ior_corbaname/Makefile.am
new file mode 100644
index 00000000000..52542ab8cec
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/Makefile.am
@@ -0,0 +1,105 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl
+TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf
+TAO_ROOT = $(top_srcdir)
+
+## Makefile.ior_corbaname_idl.am
+
+BUILT_SOURCES = \
+ corbanameC.cpp \
+ corbanameC.h \
+ corbanameC.inl \
+ corbanameS.cpp \
+ corbanameS.h \
+ corbanameS.inl
+
+CLEANFILES = \
+ corbaname-stamp \
+ corbanameC.cpp \
+ corbanameC.h \
+ corbanameC.inl \
+ corbanameS.cpp \
+ corbanameS.h \
+ corbanameS.inl
+
+corbanameC.cpp corbanameC.h corbanameC.inl corbanameS.cpp corbanameS.h corbanameS.inl: corbaname-stamp
+
+corbaname-stamp: $(srcdir)/corbaname.idl $(TAO_IDL_DEP)
+ $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/corbaname.idl
+ @touch $@
+
+
+noinst_HEADERS = \
+ corbaname.idl
+
+## Makefile.ior_corbaname_client.am
+
+noinst_PROGRAMS = client
+
+client_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+client_SOURCES = \
+ client.cpp \
+ corbanameC.cpp \
+ ior_corbaname_client_i.cpp \
+ ior_corbaname_client_i.h
+
+client_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Makefile.ior_corbaname_server.am
+
+noinst_PROGRAMS += server
+
+server_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR) \
+ -I$(TAO_ROOT)/orbsvcs \
+ -I$(TAO_BUILDDIR)/orbsvcs
+
+server_SOURCES = \
+ corbanameC.cpp \
+ corbanameS.cpp \
+ server.cpp \
+ status_i.cpp \
+ status_i.h
+
+server_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \
+ $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \
+ $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/ior_corbaname/README b/TAO/orbsvcs/tests/ior_corbaname/README
new file mode 100644
index 00000000000..75035230361
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/README
@@ -0,0 +1,32 @@
+// $Id$
+
+Here is a simple to test the corbaname: style URL. The simple way to
+test is to run the run_test.pl.
+
+To test manually:
+
+1. Run the NamingService at a specified endpoint.
+
+ $NamingService -ORBEndPoint iiop://doc.ece.uci.edu:12345 &
+
+2. Run the server.
+
+ ./server &
+
+3. Run the client as one of these.
+
+ a) ./client corbaname:doc.ece.uci.edu:12345
+
+ CORBANAME style URL is used and the protocol used to
+ contact the naming context is <iiop> implicitly.
+
+ b) ./client corbaname::iiop:doc.ece.uci.edu:12345
+
+ CORBANAME style URL is used and the protocol used to
+ contact the naming context is <iiop>.
+
+
+ c) ./client corbaname:rir:
+
+ CORBANAME style URL is used and the protocol used to
+ contact the naming context is <rir>.
diff --git a/TAO/orbsvcs/tests/ior_corbaname/client.cpp b/TAO/orbsvcs/tests/ior_corbaname/client.cpp
new file mode 100644
index 00000000000..54eb5f996f4
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/client.cpp
@@ -0,0 +1,46 @@
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/ior_corbaname/
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// This implements a simple CORBA client for the
+// corbaname: style IOR parser
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//
+// ============================================================================
+
+#include "ior_corbaname_client_i.h"
+
+int main (int argc, char *argv [])
+{
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ IOR_corbaname_Client_i client;
+
+ if (client.init (argc, argv) == -1)
+ return 1;
+ else
+ {
+ return client.run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ }
+ ACE_ENDTRY;
+ return 1;
+}
diff --git a/TAO/orbsvcs/tests/ior_corbaname/corbaname.idl b/TAO/orbsvcs/tests/ior_corbaname/corbaname.idl
new file mode 100644
index 00000000000..d0650d5d6b9
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/corbaname.idl
@@ -0,0 +1,20 @@
+// $Id$
+
+module corbaname
+{
+
+ interface Status
+ {
+ // = TITLE
+ // A simple interface to check the status of
+ // connection between the client and the server.
+ //
+ // = DESCRIPTION
+ // Prints out the status.
+
+ boolean print_status ();
+ // Return <true> if the server received the
+ // request from the client.
+
+ };
+};
diff --git a/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname.mpc b/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname.mpc
new file mode 100644
index 00000000000..c48d6d35b4e
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname.mpc
@@ -0,0 +1,37 @@
+// -*- MPC -*-
+// $Id$
+
+project(*idl): taoidldefaults {
+ IDL_Files {
+ corbaname.idl
+ }
+ custom_only = 1
+}
+
+project(*server): namingexe, portableserver {
+ exename = server
+
+ after += *idl
+ Source_Files {
+ status_i.cpp
+ server.cpp
+ corbanameS.cpp
+ corbanameC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project(*client): namingexe, portableserver {
+ exename = client
+
+ after += *idl
+ Source_Files {
+ ior_corbaname_client_i.cpp
+ client.cpp
+ corbanameC.cpp
+ }
+ IDL_Files {
+ }
+}
+
diff --git a/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.cpp b/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.cpp
new file mode 100644
index 00000000000..d183b4ff8a9
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.cpp
@@ -0,0 +1,150 @@
+// $Id$
+//
+
+// ===========================================================
+//
+// = LIBRARY
+// TAO/tests/ior_corbaname/
+//
+// = FILENAME
+// ior_corbaname_client_i.cpp
+//
+// = DESCRIPTION
+// This example implements a simple client which sends a corbaname:
+// style url to the server and gets a response from the
+// server to indicate that the server has received the request.
+//
+// = AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//============================================================
+
+#include "ior_corbaname_client_i.h"
+#include "ace/Get_Opt.h"
+#include "ace/Read_Buffer.h"
+#include "ace/SString.h"
+
+// Constructor
+IOR_corbaname_Client_i::IOR_corbaname_Client_i (void)
+{
+}
+
+// Destructor
+IOR_corbaname_Client_i::~IOR_corbaname_Client_i (void)
+{
+}
+
+int
+IOR_corbaname_Client_i::run (ACE_ENV_SINGLE_ARG_DECL)
+{
+
+ ACE_TRY
+ {
+ CosNaming::Name name (1);
+
+ name.length (1);
+ name[0].id = CORBA::string_dup ("STATUS");
+
+ // The corbaname URL contains the host at which an NamingContext
+ // Object can be found and also the stringified form of an entry
+ // in the Naming Service seperated by '#'. For simplicity,
+ // in this example, we are specifying the stringified form of
+ // the binding directly without using <to_string> method on
+ // <name>. "#" refers to the seperator between the host and the
+ // entry.
+
+ ACE_CString corbaname_url (this->argv_[1], 0, 1);
+
+ // Append the seperator '#' to the host.
+ corbaname_url += "#";
+
+ // Append the stringified name to the resultant.
+ corbaname_url += "STATUS";
+
+ // Resolve the stringified name.
+ CORBA::Object_var factory_object =
+ this->orb_->string_to_object (corbaname_url.c_str ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow
+ corbaname::Status_var factory =
+ corbaname::Status::_narrow (factory_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (factory.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ this->argv_[1]),
+ 1);
+ }
+
+ // Invoke a request on the server
+ CORBA::Boolean ret_value =
+ factory->print_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ret_value == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "The server has been successfully contacted.\n",
+ 0));
+ }
+ }
+ ACE_CATCH (CosNaming::NamingContext::NotFound, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "CosNaming::NamingContext::NotFound");
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "A system exception on client side");
+ return -1;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
+
+int
+IOR_corbaname_Client_i::init (int argc, char **argv)
+{
+ this->argc_ = argc;
+ this->argv_ = argv;
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ // First initialize the ORB, that will remove some arguments...
+ this->orb_ =
+ CORBA::ORB_init (this->argc_,
+ this->argv_,
+ "" /* the ORB name, it can be anything! */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // There must be at least one argument, the file that has to be
+ // retrieved
+ if (this->argc_ < 2)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Address of naming context not specified\n",
+ this->argv_[0]),
+ -1);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "client");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.h b/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.h
new file mode 100644
index 00000000000..96fbbdd52d9
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/ior_corbaname_client_i.h
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+// $Id$
+
+// ===========================================================
+//
+// = LIBRARY
+// TAO/tests/ior_corbaname/
+//
+// = FILENAME
+// ior_corbaname_client_i.h
+//
+// = DESCRIPTION
+// This class implements a simple client which sends a corbaname:
+// style url to the server and gets a response from the
+// server to indicate that the server has received the request.
+//
+// = AUTHORS
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+//============================================================
+
+
+#if !defined (IOR_CORBANAME_CLIENT_I_H)
+#define IOR_CORBANAME_CLIENT_I_H
+
+#include "corbanameC.h"
+#include "orbsvcs/CosNamingC.h"
+
+class IOR_corbaname_Client_i
+{
+ // = TITLE
+ // NContextExt Client Implementation
+ //
+ // = DESCRIPTION
+ //
+
+ public:
+ // = COnstructor and destructor.
+ IOR_corbaname_Client_i (void);
+ ~IOR_corbaname_Client_i (void);
+
+ int run (ACE_ENV_SINGLE_ARG_DECL);
+ // Execute the client example code.
+
+ int init (int argc, char **argv);
+ // Initialize the client communication endpoint with the server.
+
+ private:
+
+ int argc_;
+ // # of arguments on the command line.
+
+ char **argv_;
+ // arguments from command line.
+
+ CORBA::ORB_var orb_;
+ // ORB
+
+ CosNaming::NamingContextExt_var naming_context_;
+ // Naming context
+
+};
+
+#endif /* IOR_CORBANAME_CLIENT_I_H */
diff --git a/TAO/orbsvcs/tests/ior_corbaname/server.cpp b/TAO/orbsvcs/tests/ior_corbaname/server.cpp
new file mode 100644
index 00000000000..4582f0445a0
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/server.cpp
@@ -0,0 +1,83 @@
+// $Id$
+
+#include "status_i.h"
+#include "orbsvcs/CosNamingC.h"
+
+int main (int argc, char* argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+
+ // First initialize the ORB, that will remove some arguments...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv,
+ "" /* the ORB name, it can be anything! */
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get a reference to the RootPOA
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow down to the correct reference
+ PortableServer::POA_var poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Set a POA Manager
+ PortableServer::POAManager_var poa_manager =
+ poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Activate the POA Manager
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Create the servant
+ corbaname_Status_i status_i;
+
+ // Activate it to obtain the reference
+ corbaname::Status_var status =
+ status_i._this ();
+
+ // Get a reference to Naming Context
+ CORBA::Object_var naming_context_object =
+ orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow down the reference
+ CosNaming::NamingContext_var naming_context =
+ CosNaming::NamingContext::_narrow (naming_context_object.in()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Bind Status to the Naming Context
+ CosNaming::Name name (1);
+ name.length (1);
+ name[0].id = CORBA::string_dup ("STATUS");
+
+ naming_context->bind (name,
+ status.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Run the orb
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Destroy the POA, waiting until the destruction terminates
+ poa->destroy (1, 1);
+ orb->destroy ();
+
+ }
+ ACE_CATCH (CORBA::SystemException, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "CORBA exception raised in server!");
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ior_corbaname/status_i.cpp b/TAO/orbsvcs/tests/ior_corbaname/status_i.cpp
new file mode 100644
index 00000000000..db6078e18c5
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/status_i.cpp
@@ -0,0 +1,19 @@
+//
+// $Id$
+//
+
+#include "status_i.h"
+
+corbaname_Status_i::corbaname_Status_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+{
+ // Constructor
+}
+
+CORBA::Boolean
+corbaname_Status_i::print_status (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // If the client makes a succesful request, return a true value
+ // indicating that it has successfully reached the server.
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/ior_corbaname/status_i.h b/TAO/orbsvcs/tests/ior_corbaname/status_i.h
new file mode 100644
index 00000000000..9154aacc09e
--- /dev/null
+++ b/TAO/orbsvcs/tests/ior_corbaname/status_i.h
@@ -0,0 +1,19 @@
+//
+// $Id$
+//
+
+#ifndef STATUS_I_H
+#define STATUS_I_H
+
+#include "corbanameS.h"
+
+class corbaname_Status_i : public POA_corbaname::Status {
+public:
+ corbaname_Status_i (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ CORBA::Boolean print_status (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+#endif /* STATUS_I_H */
diff --git a/TAO/orbsvcs/tests/start_services b/TAO/orbsvcs/tests/start_services
new file mode 100755
index 00000000000..5e01e8b85cd
--- /dev/null
+++ b/TAO/orbsvcs/tests/start_services
@@ -0,0 +1,112 @@
+#! /bin/sh
+# $Id$
+
+# = TITLE
+# Restart script
+#
+# = AUTHOR
+# Michael Kircher (mk1@cs.wustl.edu)
+#
+# = DESCRIPTION
+# This script restarts the Naming, Scheduling and Event Service,
+# if "clean" is specified as a parameter, then the old
+# services are only killed and not restarted.
+
+usage="Usage: $0 [-s, to start Scheduling Service] | [clean]"
+
+#### ps options are platform-specific.
+if [ `uname -s` = 'SunOS' ]; then
+ ps_opts=-ef
+else
+ ps_opts=auxw
+fi
+
+#### Get the user name
+if [ "$LOGNAME" ]; then
+ #### LOGNAME is preserved across su
+ login=$LOGNAME
+else
+ #### whoami returns the users login, which changes across su
+ login=`whoami`
+fi
+
+#### Set TAO_ROOT, if it wasn't set.
+if [ ! "$TAO_ROOT" ]; then
+ if [ "$ACE_ROOT" ]; then
+ TAO_ROOT=$ACE_ROOT/TAO
+ else
+ echo $0: you must set ACE_ROOT or TAO_ROOT!
+ exit 1
+ fi
+fi
+
+#### Set up a signal handler.
+trap "/bin/rm -f /tmp/pids$login" 0 1 2 3 15
+
+if [ -s /tmp/nameservicepid_$login ]; then
+ echo // Killing the old services
+ kill `cat /tmp/nameservicepid_$login`
+ /bin/rm /tmp/nameserviceior_$login /tmp/nameservicepid_$login
+fi
+
+ps $ps_opts | grep Service | grep $login | grep -v grep | cut -c10-17 > /tmp/pids$login
+
+if [ -s /tmp/pids$login ]; then
+ pids=`cat /tmp/pids$login`
+ kill $pids
+fi
+
+start_scheduling_service=0
+if [ "$1" ]; then
+ #### Stop here if "start_services clean" was called
+
+ case $1 in
+ '-?' ) echo $usage; exit 0 ;;
+ clean ) exit 0 ;;
+ -s ) start_scheduling_service=1 ;;
+ esac
+fi
+
+echo // Initializing the log file
+
+echo // Logfile for the script which startes Name and Event Service > /tmp/logfile_$login
+
+cd $TAO_ROOT/orbsvcs/Naming_Service
+echo $ ./Naming_Service \
+ -o /tmp/nameserviceior_$login \
+ -p /tmp/nameservicepid_$login >> /tmp/logfile_$login
+./Naming_Service \
+ -o /tmp/nameserviceior_$login \
+ -p /tmp/nameservicepid_$login > /tmp/logfile_Naming_Service_$login 2>&1 &
+
+sleep 8
+
+IOR=`cat /tmp/nameserviceior_$login`
+
+echo // The IOR of the Naming Service: $IOR
+
+echo // Started Naming Service on port $nameserviceport
+
+if [ $start_scheduling_service -eq 1 ]; then
+ cd $TAO_ROOT/orbsvcs/Scheduling_Service
+ echo $ ./Scheduling_Service -ORBInitRef NameService=$IOR >> /tmp/logfile_$login
+ ./Scheduling_Service -ORBInitRef NameService=$IOR > /tmp/logfile_Scheduling_Service_$login 2>&1 &
+ sleep 5
+
+ echo // Started Scheduling Service on port $schedulerserviceport
+fi
+
+cd $TAO_ROOT/orbsvcs/Event_Service
+echo $ ./Event_Service -ORBInitRef NameService=$IOR >> /tmp/logfile_$login
+./Event_Service -ORBInitRef NameService=$IOR > /tmp/logfile_Event_Service_$login 2>&1 &
+
+echo // Started Event Service on port $eventserviceport
+
+echo "// Enjoy the use ;-)"
+ps $ps_opts | grep Service | grep -v grep
+
+echo
+echo Note: if you will be running an application that uses the Naming Service,
+echo you might want to set the NameService environment variable, like this:
+echo 't/csh: % setenv NameServiceIOR `cat /tmp/nameserviceior_'$login'`'
+echo 'bash: $ export NameServiceIOR=`cat /tmp/nameserviceior_'$login'`'
diff --git a/TAO/orbsvcs/tests/tests.mwc b/TAO/orbsvcs/tests/tests.mwc
new file mode 100644
index 00000000000..dd297256b34
--- /dev/null
+++ b/TAO/orbsvcs/tests/tests.mwc
@@ -0,0 +1,5 @@
+// -*- MPC -*-
+// $Id$
+
+workspace {
+}
diff --git a/TAO/orbsvcs/tests/tests_svc_loader/Makefile.am b/TAO/orbsvcs/tests/tests_svc_loader/Makefile.am
new file mode 100644
index 00000000000..57d76e66aeb
--- /dev/null
+++ b/TAO/orbsvcs/tests/tests_svc_loader/Makefile.am
@@ -0,0 +1,44 @@
+## Process this file with automake to create Makefile.in
+##
+## $Id$
+##
+## This file was generated by MPC. Any changes made directly to
+## this file will be lost the next time it is generated.
+##
+## MPC Command:
+## ../bin/mwc.pl -type automake -noreldefs TAO.mwc
+
+ACE_BUILDDIR = $(top_builddir)/..
+ACE_ROOT = $(top_srcdir)/..
+TAO_BUILDDIR = $(top_builddir)
+TAO_ROOT = $(top_srcdir)
+
+
+## Makefile.tests_svc_loader.am
+
+if !BUILD_MINIMUM_CORBA
+
+noinst_PROGRAMS = tests_svc_loader
+
+tests_svc_loader_CPPFLAGS = \
+ -I$(ACE_ROOT) \
+ -I$(ACE_BUILDDIR) \
+ -I$(TAO_ROOT) \
+ -I$(TAO_BUILDDIR)
+
+tests_svc_loader_SOURCES = \
+ tests_svc_loader.cpp
+
+tests_svc_loader_LDADD = \
+ $(TAO_BUILDDIR)/tao/libTAO.la \
+ $(ACE_BUILDDIR)/ace/libACE.la
+
+endif !BUILD_MINIMUM_CORBA
+
+## Clean up template repositories, etc.
+clean-local:
+ -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.*
+ -rm -f gcctemp.c gcctemp so_locations *.ics
+ -rm -rf cxx_repository ptrepository ti_files
+ -rm -rf templateregistry ir.out
+ -rm -rf ptrepository SunWS_cache Templates.DB
diff --git a/TAO/orbsvcs/tests/tests_svc_loader/README b/TAO/orbsvcs/tests/tests_svc_loader/README
new file mode 100644
index 00000000000..1e581782879
--- /dev/null
+++ b/TAO/orbsvcs/tests/tests_svc_loader/README
@@ -0,0 +1,12 @@
+// $Id$
+
+ This directory contains a generic client program. The program
+takes an object reference as a commandline parameter and checks if it
+refers to an existing object and a debug statement is printed out to
+reflect the same.
+
+To Run tests_svc_loader
+=======================
+
+./tests_svc_loader file://ns.ior
+
diff --git a/TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.cpp b/TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.cpp
new file mode 100644
index 00000000000..f4f3d3311c2
--- /dev/null
+++ b/TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.cpp
@@ -0,0 +1,94 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// orbsvcs/tests/tests_svc_loader
+//
+// = FILENAME
+// client.cpp
+//
+// = DESCRIPTION
+// This directory contains a client that checks if a given object
+// reference points to an existing object or not and prints a debug
+// statement to reflect the same. This client is to be used in
+// conjunction with testing the dynamically loadable services. If
+// the service is loaded successfully, the object reference from the
+// server would be a valid one and the corresponding debug statement
+// is printed out. Or viceversa.
+//
+// = AUTHOR
+// Priyanka Gontla <pgontla@ece.uci.edu>
+//
+// ============================================================================
+
+#include "tao/ORB.h"
+#include "tao/Object.h"
+#include "tao/SystemException.h"
+
+#include "ace/Service_Config.h"
+#include "ace/Log_Msg.h"
+#include "ace/CORBA_macros.h"
+
+
+ACE_RCSID (tests_svc_loader,
+ tests_svc_loader,
+ "$Id$")
+
+
+int main (int argc, char *argv [])
+{
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ // First initialize the ORB, that will remove some arguments...
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // There must be at least one argument, the file that has to be
+ // retrieved
+ if (argc < 2)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "Usage: %s <ior>\n",
+ argv[0]));
+
+ return -1;
+ }
+
+ // Use the first argument to create the object reference.
+ CORBA::Object_var object =
+ orb->string_to_object (argv[1] ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Check if this object reference is a valid one..
+ CORBA::Boolean not_exists =
+ object->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (not_exists)
+ {
+ // Object reference was not of an existing object
+ ACE_DEBUG ((LM_ERROR,
+ "The Object is non existent\n"));
+ }
+ else
+ {
+ // The Object exists
+ ACE_DEBUG ((LM_DEBUG,
+ "The object exists!!!\n"));
+ }
+
+ }
+ ACE_CATCH (CORBA::SystemException ,e)
+ {
+ ACE_DEBUG ((LM_ERROR,
+ "CORBA System Exception Raised!\n"));
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.mpc b/TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.mpc
new file mode 100644
index 00000000000..6437d7e9c6f
--- /dev/null
+++ b/TAO/orbsvcs/tests/tests_svc_loader/tests_svc_loader.mpc
@@ -0,0 +1,6 @@
+// -*- MPC -*-
+// $Id$
+
+project: taoexe, minimum_corba {
+ exename = tests_svc_loader
+}